By mixersoft on
I'm installing Drupal 5.1 on top of the following: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch4 Server/MySQL 5.0.32-Debian_7etch1-log
I followed the directions to the letter, was able to run install.php to successfully create the db, but then I hit one of 2 problems,
1) index.php is not being picked up by default, and that makes me think there is a problem with .htaccess
2) I can navigate to index.php manually, but when I try to go to ?q=user/register I get a page not found.
my .htaccess is straight from the gzip file (below)
Any help would be appreciated.
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>
Comments
The DirectoryIndex going
The DirectoryIndex going wrong (not using index.php) is probably an error in your apache configuration. You can choose to set the DirectoryIndex for all your sites of apache, or you should at least enable the AllowOverride directive, so that the webserver takes the .htaccess files into account.
What the 404 problem is, I don't really know, but it may have to do with the previous, try going to index.php?q=user/register and see if that works. If it does, the DirectoryIndex is the problemmaker.
Hope this helps,
SabbeRubbish
Nevermind
I did some more searching after I thought out the problem and discovered that my apache2 config had
AllowOveride None
for my drupal dirctory. I changed it to AllowOverride All and it was fine.
But is this the proper configuration, or am I opening myself up to some security flaw?
The AllowOverride directive
The AllowOverride directive is used to allow .htaccess files change configuration settings for the directory that .htaccess file is in (and its subdirectories). Settings like enabling the rewrite engine, setting the directory index, ...
You may want to check out the apache documentation about that (http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride). It looks like its not such a big threat to enable it, but if possible, try to limit that to a small set of directives you would allow an .htaccess file to override.
Of course, this is more about apache ethics, so if it's a local server, don't worry. If it's a production server, think more carefully.
Hope this helps,
SabbeRubbish