PDA

View Full Version : Tip: Installing Gallery2 (Linux)


Teej
10-28-2006, 11:48 PM
This might assist someone else who has problems setting the g2data directory of Gallery2 (http://gallery.menalto.com/) outside of the web server's document-root.

Create the directory outside the web-visible area (always replace <domain> and <domain-user> with your system values). You should be logged in as the super-user 'root':

]$ su
Password:

]$ cd /var/www/vhosts/<domain>
]$ mkdir g2data
]$ chown -cR <domain-user>:psaserv g2data
]$ chmod -cR 777 g2data
(See: Gallery2: PHP as mod_php and open_basedir is set restrictive enough (http://codex.gallery2.org/index.php/Gallery2:Security#b.29_PHP_as_mod_php_and_open_basedir_is_set_restrictive_enough))

Alter the Apache httpd virtual-host mod_php5 setting so PHP is based in the /var/www/vhosts/<domain>/ directory and can access g2data/.

Edit /var/www/vhosts/<domain>/conf/httpd.include, locate and edit the following section/line of each <VirtualHost x.y.z.a:ppp> section (there could be one for port 80 and another for port 443):
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/<domain>/httpdocs:/tmp"
</IfModule>
Delete the reference to /httpdocs.

Reload the httpd configuration files (or restart the server).
]$ /sbin/service httpd reload

Finally, when Gallery2 installer asks for the location of the g2data directory specify /var/www/vhosts/<domain>/g2data/