You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming that this is a development machine you can make the config writable by the user Apache runs as. Most likely `_www`.
59
62
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
62
66
63
67
----------------------------------------
64
68
65
69
### Setting up Apache and PHP
66
70
67
71
#### Apache
68
72
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.
70
74
71
-
vi /opt/local/apache2/conf/extra/virtualhosts.conf
75
+
sudo nano /opt/local/apache2/conf/httpd.conf
76
+
77
+
Enable virtual hosts:
72
78
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
76
81
77
-
# 403 Forbidden for ini files
78
-
#RewriteRule \.ini$ - [F,NC]
82
+
Ensure the PHP module is loaded (various places in `httpd.conf`):
79
83
80
-
Comment:
84
+
LoadModule php5_module modules/libphp5.so
85
+
86
+
DirectoryIndex index.html index.php
87
+
88
+
Include conf/extra/mod_php.conf
81
89
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.
You can put the `NameVirtualHost` directive at the top of the file.
87
95
88
96
NameVirtualHost *
89
97
90
98
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.
91
99
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
+
92
113
### PHP
93
114
94
115
You should also verify that your `php.ini` file has a few important values set correctly.
95
116
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
Search for the following values and make sure they're correct.
99
124
125
+
post_max_size = 16M
100
126
file_uploads = On
101
127
upload_max_filesize = 16M
102
-
post_max_size = 16M
103
128
104
129
Now you're ready to restart apache and visit the site in your browser.
105
130
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
107
138
108
139
### Launching your OpenPhoto site
109
140
110
141
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.
111
142
112
143
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.
0 commit comments