[solved] Apache 2/Ubuntu doesn't allow .htaccess to override

Yuan

Joined: 2003-12-03
Posts: 144
Posted: Sun, 2007-08-05 00:19

I am trying to transfer my site to a new server, but Gallery complains that Apache is not behaving:

Quote:
Apache is not obeying the 'php_value' lines in your .htaccess file. Try entering the following into your web server's httpd.conf file:

<Directory /var/gallery>
AllowOverride Options FileInfo
</Directory>

If you are running PHP in CGI mode, this message is unavoidable.

I have indeed inserted the suggested line to the Directory section but to no avail. The server is a newly installed Ubuntu 7.04. After years of working on Linux and Apache, I found myself unfamiliar with this OS "made for human ^and servers^". The server root is put under /etc/apache2, and configuration files broken into several directories, with the main file named apache2.conf. mod_php5.c is compile to file libphp5.so. And so on. And so on. On my old RedHat with PHP4.2 and Apache 2.0.50, Gallery runs without a problem.

Any way, I made certain that mod_rewrite is present and loaded. (phpinfo.php also confirms this.) PHP is running from libphp5.so and not as CGI. gallery/setup/.htaccess exists (http://gallery.menalto.com/node/26436#comment-117029) and contains instructions for mod_php5.c. Then checked http://gallery.menalto.com/node/2447#comment-7846, tried to comment out FollowSymLinks. But still can't get this part to work. Any ideas? I really need to get rewrite to work.

Yuan

The following information is required to get an answer:
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful): http://solid77.doodle22.com:8080/?newlang=en_US
Gallery version: 1.5.2-pl2
Apache version: Apache/2.2.3 (Ubuntu) PHP/5.2.1
PHP version (don't just say PHP 4, please): PHP/5.2.1
Graphics Toolkit: NetPBM
Operating system: Linux 2.6.20-15-server
Web browser/version (if applicable): N/A

 
Yuan

Joined: 2003-12-03
Posts: 144
Posted: Sun, 2007-08-05 06:00

I found the problem. Indeed Ubuntu package does wonders - in the sense that it makes me wonder "why the %@#!"

The default virtual host file contains a Directory directive for /. It sets AllowOverride None. Due to Apache 2 scoping, this will disallow override in any directory underneath /, i.e., any directory at all. I even tried AllowOverride All in /var/gallery to no avail.

Removing this section from virtual host solved this problem, although it raised a different problem, which I'll discuss in a different post.