Skip to content

Commit 3566fbf

Browse files
committed
Merge branch 'master' of github.com:openphoto/frontend
2 parents 05e6ec6 + 46e3b7f commit 3566fbf

File tree

1 file changed

+58
-27
lines changed

1 file changed

+58
-27
lines changed

documentation/guides/InstallationOSXMacports.markdown

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ Once you've confirmed that your cloud account is setup you can get started on yo
2626

2727
This guide assumes you have [get it here][Macports installed]. If not you can . The easiest option is to use `.pkg` installer.
2828

29-
port install apache2
30-
port install php5 +apache2
31-
port install php5-exif
32-
port install php5-curl
33-
port install php5-imagick
34-
port install php5-oauth
35-
port install php5-mcrypt
36-
port load apache2
29+
sudo port install apache2
30+
sudo port install php5 +apache2
31+
32+
cd /opt/local/apache2/modules
33+
sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
34+
35+
sudo port install php5-exif
36+
sudo port install php5-curl
37+
sudo port install php5-imagick
38+
sudo port install php5-oauth
39+
sudo port install php5-mcrypt
40+
sudo port load apache2
3741

3842
----------------------------------------
3943

@@ -43,8 +47,8 @@ Download and install the source code. We recommend `~/Sites/yourdomain.com` but
4347

4448
#### Using git clone
4549

46-
# install git if you don't have it already
47-
port install git-core
50+
# OSX should have git already installed. If not:
51+
sudo port install git-core
4852
git clone [email protected]:openphoto/frontend.git ~/Sites/yourdomain.com
4953

5054
#### Using tar
@@ -53,65 +57,92 @@ Download and install the source code. We recommend `~/Sites/yourdomain.com` but
5357
wget https://github.com/openphoto/frontend/tarball/master -O openphoto.tar.gz
5458
tar -zxvf openphoto.tar.gz
5559
mv openphoto-frontend-* yourdomain.com
56-
chown -R www-data:www-data yourdomain.com
5760

5861
Assuming that this is a development machine you can make the config writable by the user Apache runs as. Most likely `_www`.
5962

60-
mkdir ~/Sites/yourdomain.com/src/userdata
61-
chown _www ~/Sites/yourdomain.com/src/userdata
63+
cd ~/Sites/yourdomain.com
64+
mkdir src/userdata
65+
chown _www src/userdata
6266

6367
----------------------------------------
6468

6569
### Setting up Apache and PHP
6670

6771
#### Apache
6872

69-
You'll need to make sure that you have named virtual hosts enabled in your Apache confs. First, copy the contents of `~/Sites/yourdomain.com/configs/openphoto-vhost.conf` onto your clipboard. Then open your `virtualhosts.conf` file.
73+
You'll need to make sure that you have named virtual hosts enabled in your Apache confs.
7074

71-
vi /opt/local/apache2/conf/extra/virtualhosts.conf
75+
sudo nano /opt/local/apache2/conf/httpd.conf
76+
77+
Enable virtual hosts:
7278

73-
By default, any access to ini files is denied with a "Not Found" 404 HTTP code. To enable a 404, or Forbidden return code, change the following lines in the virtual host file.
74-
75-
Uncomment:
79+
# Virtual hosts
80+
Include conf/extra/httpd-vhosts.conf
7681

77-
# 403 Forbidden for ini files
78-
#RewriteRule \.ini$ - [F,NC]
82+
Ensure the PHP module is loaded (various places in `httpd.conf`):
7983

80-
Comment:
84+
LoadModule php5_module modules/libphp5.so
85+
86+
DirectoryIndex index.html index.php
87+
88+
Include conf/extra/mod_php.conf
8189

82-
# 404 Not Found for ini files
83-
AliasMatch \.ini$ /404
90+
Copy the contents of `~/Sites/yourdomain.com/src/configs/openphoto-vhost.conf` onto your clipboard. Then open your `httpd-vhosts.conf` file.
8491

92+
sudo nano /opt/local/apache2/conf/extra/httpd-vhosts.conf
8593

8694
You can put the `NameVirtualHost` directive at the top of the file.
8795

8896
NameVirtualHost *
8997

9098
Paste the contents of your clipboard into the bottom of the file and replace instances of `/path/to/openphoto/html/directory` with `/Users/yourusername/Sites/yourdomain.com/src/html` or wherever you placed the code. In the virtualhost conf make sure to specify the full path to your `Sites` directory.
9199

100+
By default, any access to ini files is denied with a "Not Found" 404 HTTP code. To enable a 404, or Forbidden return code, change the following lines in the virtual host file.
101+
102+
Uncomment:
103+
104+
# 403 Forbidden for ini files
105+
#RewriteRule \.ini$ - [F,NC]
106+
107+
Comment:
108+
109+
# 404 Not Found for ini files
110+
AliasMatch \.ini$ /404
111+
112+
92113
### PHP
93114

94115
You should also verify that your `php.ini` file has a few important values set correctly.
95116

96-
vi /opt/local/etc/php5/php.ini
117+
sudo nano /opt/local/etc/php5/php.ini
118+
119+
If the file is empty, copy the development template file
120+
121+
sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini
97122

98123
Search for the following values and make sure they're correct.
99124

125+
post_max_size = 16M
100126
file_uploads = On
101127
upload_max_filesize = 16M
102-
post_max_size = 16M
103128

104129
Now you're ready to restart apache and visit the site in your browser.
105130

106-
/opt/local/apache2/bin/apachectl restart
131+
sudo /opt/local/apache2/bin/apachectl restart
132+
133+
### Fake domain
134+
135+
If you happen to not have `yourdomain.com` registered, you can fake it by editing your `/etc/hosts` file and adding the following line
136+
137+
127.0.0.1 yourdomain.com
107138

108139
### Launching your OpenPhoto site
109140

110141
Now you're ready to launch your OpenPhoto site. Point your browser to your host and you'll be taken to a setup screen. You'll need your cloud account credentials to continue.
111142

112143
Once you complete the 3 steps your site will be up and running and you'll be redirected there. The _setup_ screen won't show up anymore. If for any reason you want to go through the setup again you will need to delete the generated config file and refresh your browser.
113144

114-
rm /var/www/yourdomain.com/src/configs/generated/settings.ini
145+
rm ~/Sites/yourdomain.com/src/userdata/configs/settings.ini
115146

116147
**ENJOY!**
117148

0 commit comments

Comments
 (0)