6.9 KiB
OpenPhoto / Installation for Shared Hosting
OpenPhoto, a photo service for the masses
Installation on Shared Hosting
This guide instructs you on how to install OpenPhoto on shared hosting sites such as Dreamhost or Bluehost. OpenPhoto can be difficult to install for users not experienced with PHP, Apache, or MySQL. If you'd like to use OpenPhoto without installing the software yourself, get started here.
If you're using Dreamhost we have a community-written guide for Dreamhost users.
OpenPhoto should be installed in the root directory of a domain or subdomain.
Variables:
- YOURDOMAIN:the subdomain or domain for hosting OpenPhoto
- YOURNAME: your shared hosting username
- OpenPhotoRoot: the root directory for OpenPhoto (e.g., ~/openphoto)
Before you install OpenPhoto
This guide assumes you have:
- Checked that your webhost supports MySQL and PHP
- Shell or FTP access to your web server
- An FTP or SSH client
- A web browser of choice
- An external cloud service account on Amazon or Dropbox (if you want to store your photos there)
The short version
Here's the short version of the instructions for those already comfortable with installing software on a web server. You can check out the detailed instructions below for more information on each step.
-
Download the latest version of OpenPhoto from Github and extract it to the root folder of your website. Direct link to latest version as a .zip file
-
Prepare your cloud storage option and have your credentials ready. (Optional)
-
Create a new MySQL database and a new user for that database. Remember the hostname (the default should be fine), database name, username, and password. Your webhost may have a MySQL control panel such as PhpMyAdmin that you can do this in.
-
Create the following folders and chmod them to 775:
mkdir OpenPhotoRoot/src/html/assets/cache chmod 775 OpenPhotoRoot/src/html/assets/cache mkdir OpenPhotoRoot/src/html/photos chmod 775 OpenPhotoRoot/src/html/photos mkdir OpenPhotoRoot/src/userdata chmod 775 OpenPhotoRoot/src/userdata
-
Visit your website and follow the instructions.
That's it! OpenPhoto should now be installed. Because there are so many special cases specific to individual webhosts along with things that could go wrong, you may want to read the full instructions below.
The detailed version
-
Download OpenPhoto from Github. Direct link to latest version as a .zip file. You can also do the following:
wget https://github.com/photo/frontend/tarball/master -O openphoto.tar.gz tar -zxvf openphoto.tar.gz mv openphoto-frontend-* OpenPhotoRoot
-
Install any dependencies or modules needed. Your webhost may include them by default, but if not, check their documentation. Here's what you'll need:
- OAuth for authentication
- ImageMagick or GD for photo rendering
The method of installing these varies by webhost. Some webhosts let you install them by yourself; others will install these for you if you contact them. Again, consult their documentation.
- Create an account at Amazon AWS or Dropbox if you plan to use them. Create a new bucket (S3) or app (Dropbox). Save your keys since you'll need them soon.
At Amazon: After signing in, visit the S3 panel and select Create a New Bucket. Give your bucket a name and select a region, then select Create. Obtain your access keys and save them.
At Dropbox: Sign in and create a folder for your photos to go in. Visit the developers page, select Create an App, and select the following Settings:
- App Type: Core API
- Access: Full Dropbox This will give you a development app to use for your photos. Save your access keys; you'll need them soon.
-
Visit your control panel for managing databases and create a new database and new user for the database. Remember the hostname (the default should be fine), database name, username, and password. You'll need these during setup.
-
Configure the subdomain or domain. You may have to add the domain if you're bringing in a new domain. Consult your webhost's documentation if needed. Depending on your webhost you may have to visit multiple areas of the site to configure everything, or you may have to configure these separately. But here's what you need to set up.
- PHP: Select the latest version, FastCGI configuration if available
- Web directory: OpenPhotoRoot/src/html
-
Upload the contents of the downloaded OpenPhoto folder to OpenPhotoRoot if you haven't already done that. You can do this with an FTP or SSH client.
-
Create the following directories.
the cache: mkdir OpenPhotoRoot/src/html/assets/cache chmod 775 OpenPhotoRoot/src/html/assets/cache to store your photos if you're planning on local storage: mkdir OpenPhotoRoot/src/html/photos chmod 775 OpenPhotoRoot/src/html/photos to store userdata: mkdir OpenPhotoRoot/src/userdata chmod 775 OpenPhotoRoot/src/userdata
-
After waiting a sufficient amount of time for the subdomain name to propagate, use the browser to connect to the new subdomain. You should see a setup page for OpenPhoto which will allow you to configure your OpenPhoto project.
-
Enter your email address and select a password.
-
Select your image renderer (ImageMagick or GD are the most common options), database (MySQL or InnoDB), and storage (Local filesystem, Amazon S3, Amazon S3+Dropbox, Local filesystem+Dropbox).
-
Enter your credentials for your database, Amazon S3, or Dropbox.
ENJOY!
Troubleshooting
Setup page looks strange (black and white, unstyled)
If the setup page is not colorful and well formatted, then the css and javascript files are most likely not being loaded. Possible causes:
- Web directory root is not properly set (check control panel for the subdomain)
- src/html/assets/cache directory is not writeable by Apache (check your permissions--they should be set to 775)
I set my permissions to 775 and it's still not working. What gives? (or safe_mode issues)
My webhost doesn't recognize OpenPhotoRoot/src/html as the index page.
You can set this in the .htaccess page at OpenPhotoRoot/src
Error setting up the database
Double check all the parameters. Check your database control panel and verify that everything is correct. Also double check that the user for your database has permission to create a database.
ENJOY!