Skip to content

Commit

Permalink
reorganized shared hosting guide #29
Browse files Browse the repository at this point in the history
  • Loading branch information
sushimustwrite committed Apr 9, 2014
1 parent c84dfbf commit 1b595d3
Showing 1 changed file with 47 additions and 69 deletions.
116 changes: 47 additions & 69 deletions docs/guides/InstallationSharedHosting.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

## 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 performing such installations. If you'd like to use OpenPhoto without installing the software yourself, <a href="http://openphoto.me">get started here</a>.
This guide instructs you on how to install OpenPhoto on shared hosting sites such as Dreamhost or Bluehost.

If you're using Dreamhost <a href="https://github.com/photo/frontend/blob/master/documentation/guides/InstallationDreamhost.markdown">we have a community-written guide for Dreamhost users</a>. Because every webhost is unique, we welcome additions to this guide as well as guides on installing OpenPhoto on your webhost.
Because every webhost is different and features can vary widely from host to host, this guide is written at a high level of abstraction.

If you're using Dreamhost <a href="https://github.com/photo/frontend/blob/master/documentation/guides/InstallationDreamhost.markdown">we have a community-written guide for Dreamhost users</a>. We welcome additions to this guide as well as guides on installing OpenPhoto on your own webhost.

*OpenPhoto should be installed in the root directory of a domain or subdomain.*

Expand All @@ -21,104 +23,80 @@ This guide assumes you have:
* An FTP or SSH client
* A web browser of choice
* A text editor (optional)
* 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.

1. Download the latest version of OpenPhoto from Github and extract it to the root folder of your website. <a href="https://github.com/photo/frontend/archive/master.zip">Direct link to latest version as a .zip file</a>
* An external cloud service account on Amazon S3 or Dropbox (if you want to store your photos there)

2. Prepare your cloud storage option and have your credentials ready. (Optional)

3. 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.
### OpenPhoto Installation Instructions

4. Create the following folders and chmod them to 775:
#### 1. Download OpenPhoto from Github.
Download the source from Github and extract the contents of the *src* folder to your *OpenPhotoRoot* folder. <a href="https://github.com/photo/frontend/archive/master.zip">Direct link to latest version as a .zip file</a>. You can also do the following:

mkdir OpenPhotoRoot/src/html/assets/cache
chmod 775 OpenPhotoRoot/src/html/assets/cache
wget https://github.com/photo/frontend/tarball/master -O openphoto.tar.gz
tar -zxvf openphoto.tar.gz
mv frontend-*/src OpenPhotoRoot
mkdir OpenPhotoRoot/src/html/photos
chmod 775 OpenPhotoRoot/src/html/photos
#### 2. Create the following directories.

the cache:
mkdir OpenPhotoRoot/html/assets/cache
chmod 775 OpenPhotoRoot/html/assets/cache
mkdir OpenPhotoRoot/src/userdata
chmod 775 OpenPhotoRoot/src/userdata
to store your photos if you're planning on local storage:
mkdir OpenPhotoRoot/html/photos
chmod 775 OpenPhotoRoot/html/photos
5. 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

#### 1. Download OpenPhoto from Github.
<a href="https://github.com/photo/frontend/archive/master.zip">Direct link to latest version as a .zip file</a>. You can also do the following:
to store userdata:
mkdir OpenPhotoRoot/userdata
chmod 775 OpenPhotoRoot/userdata

wget https://github.com/photo/frontend/tarball/master -O openphoto.tar.gz
tar -zxvf openphoto.tar.gz
mv openphoto-frontend-* OpenPhotoRoot
You can also do this with your FTP client. If you choose this route, the user and group should have read, write, and execute privileges. World should have read and execute privileges.

#### 2. Install any dependencies or modules needed.
Your webhost may include them by default. Check their documentation. Here's what you'll need:
#### 3. Install any dependencies or modules needed.
Your webhost may include them or let you install them, so check their documentation. Here's what you'll need:

* The Pecl extension `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.

#### 3. Create your cloud accounts (if you plan on using them).
#### 4. Create your cloud accounts (if you plan on using them).
Create an account at <a href="https://aws.amazon.com/s3">Amazon AWS</a> or <a href="http://www.dropbox.com">Dropbox</a> 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:
* Sign in and visit <a href="https://console.aws.amazon.com/s3/home">the S3 panel</a> and select Create a New Bucket.
* Give your bucket a name and select a region, then select Create.
* <a href="https://portal.aws.amazon.com/gp/aws/securityCredentials">Obtain your access keys</a> and save them.

**Note**: OpenPhoto will create a bucket for you during the installation process, so you don't need to do that yet.

At Dropbox:
* Sign in and create a folder for your photos to go in.
* Visit <a href="https://www.dropbox.com/developers/apps">the developers page</a>
* Select Create an App, and select Core API for App Type and Full Dropbox Access.
* Select Create an App, and select Core API for App Type and Folder Access.

This will give you a development app to use for your photos. Save your access keys; you'll need them soon.

#### 4. Create a database and user.
Visit your control panel for managing databases and create a new database and new user for the database. Give the user `CREATE DATABASE` privileges if you haven't created the database yet. Remember the hostname (the default should be fine), database name, username, and password. You'll need these during setup.
#### 5. Create a database and user.
Visit your control panel for managing databases and create a new database and new user for the database. Give the user `CREATE DATABASE` privileges if you haven't created the database yet. Remember the hostname (the default should be fine), database name, username, and password.

#### 5. Configure the subdomain or domain.
Your webhost may have a graphical interface such as cPanel or phpMyAdmin that you can do this in.

#### 6. 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. Here's what you need to set up.

* PHP: Select the latest version, FastCGI configuration if available
* Web directory: OpenPhotoRoot/src/html
* PHP: Select the latest stable version, FastCGI configuration if available
* Web directory: OpenPhotoRoot/html

If you can't set the web directory to OpenPhotoRoot/src/html through a web interface, you can create an .htaccess file in the root directory. Open a text editor and include the following:
If you can't set the web directory to OpenPhotoRoot/html through a web interface, you can create an .htaccess file in the root directory. Open a text editor and include the following:

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^your.domain.com$ [NC,OR]
RewriteCond %{REQUEST_URI} !src/html/
RewriteRule (.*) /src/html/$1 [L]
RewriteCond %{HTTP_HOST} ^your.domain$ [NC,OR]
RewriteCond %{REQUEST_URI} !html/
RewriteRule (.*) /html/$1 [L]
Save the file as .htaccess and upload it to the root folder of your site if you haven't already, along with the OpenPhoto folder.

#### 6. Upload OpenPhoto.
Upload the contents of the downloaded OpenPhoto folder to the root directory if you haven't already. You can do this with an FTP or SSH client.
Save the file as .htaccess and upload it to the root folder of your site.

#### 7. 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

You can also do this with your FTP client. If you do, the user and group should have read, write, and execute privileges. World should have read and execute privileges.

#### 8. Install OpenPhoto
#### 7. Install OpenPhoto
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 site.

* Enter your email address and select a password.
Expand All @@ -132,16 +110,16 @@ After waiting a sufficient amount of time for the subdomain name to propagate, u
### 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:
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)
- Web directory root is not properly set (check control panel for the subdomain or your .htaccess file)
- html/assets/cache directory is not writeable by Apache (check your permissions)

#### My webhost doesn't recognize OpenPhotoRoot/src/html as the index directory.
#### My webhost doesn't recognize OpenPhotoRoot/html as the index directory.
You can set this in the .htaccess page at OpenPhotoRoot. If your webhost lets you set this through the web panel you can also do that there.

#### 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 if you haven't already created a database.

####Help! I'm stuck and I have questions!
#### Help! I'm stuck and I have questions!
If you have questions we're always around to help. We've got several contact options listed on the <a href="http://theopenphotoproject.org/contribute">contribute</a> page.

0 comments on commit 1b595d3

Please sign in to comment.