HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   ISPConfig, Drupal, and .htaccess (http://www.howtoforge.com/forums/showthread.php?t=788)

jon335 8th October 2005 17:06

ISPConfig, Drupal, and .htaccess
 
I am trying to install Drupal for my website, but I am running into a problem. When I go to my website I get:
500 Internal Server Error

I uploaded all the files for drupal, created the database, and edited the settings file for my site.

Here is part of the log:

Code:

error.log
[Sat Oct 08 10:54:09 2005] [alert] [client 192.168.1.230] /var/www/web1/web/.htaccess: Options not allowed here
[Sat Oct 08 10:54:09 2005] [alert] [client 192.168.1.230] /var/www/web1/web/.htaccess: Options not allowed here
[Sat Oct 08 10:54:09 2005] [alert] [client 192.168.1.230] /var/www/web1/web/.htaccess: Options not allowed here
[Sat Oct 08 10:54:09 2005] [alert] [client 192.168.1.230] /var/www/web1/web/.htaccess: Options not allowed here
[Sat Oct 08 10:54:09 2005] [alert] [client 192.168.1.230] /var/www/web1/web/.htaccess: Options not allowed here
[Sat Oct 08 10:54:09 2005] [alert] [client 192.168.1.230] /var/www/web1/web/.htaccess: Options not allowed here


Code:

.htaccess
#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<Files ~ "(\.(inc|module|pl|sh|sql|theme|engine|xtmpl)|Entries|Repositories|Root|scripts|updates)$">
  Order deny,allow
  Deny from all
</Files>

# Set some options.
Options -Indexes
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More exist in sites/default/settings.php, but
# the following cannot be changed at runtime. The first IfModule is
# for Apache 1.3, the second for Apache 2.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
</IfModule>

<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
</IfModule>

# Reduce the time dynamically generated pages are cache-able.
<IfModule mod_expires.c>
  ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
  #RewriteBase /drupal

  # Rewrite old-style URLs of the form 'node.php?id=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

  # Rewrite current-style URLs of the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $

What should I do?? :confused: :confused:

till 8th October 2005 17:31

At the end of your httpd.conf is a section like this:

Code:

<Directory /home/www/*/web>
    Options +Includes +FollowSymlinks -Indexes
    AllowOverride Indexes AuthConfig Limit FileInfo
    Order allow,deny
    Allow from all

    <Files ~ "^\.ht">
    Deny from all
    </Files>
</Directory>

There you must chnage the AllowOverride statement to allow all settings in the drupal .htaccess file. For test purposes you might even change it to: AllowOverride All

Then restart your apache webserver.

jon335 8th October 2005 17:57

Where is httpd.conf located?

I'm using the Ubuntu 5.04 Perfect Setup.

till 8th October 2005 19:05

Quote:

Originally Posted by jon335
Where is httpd.conf located?

I'm using the Ubuntu 5.04 Perfect Setup.

In Ubuntu the httpd.conf file is named /etc/apache2/apache2.conf

jon335 8th October 2005 23:47

Thanks, that worked perfectly. Is it OK to leave the AllowOverride setting set to All, or should I set it to something else?

till 9th October 2005 12:19

AllowOverride All means that all settings allowed in the vhost configuration can be overridden with .htaccess files. Thats insecure because your customers are able to change their apache configuration. Maybe you have a look at the apache.org website, there is a documentation what settings are allowed with allow override and you can decide which rights you want to give to your customers.

falko 9th October 2005 13:37

Hi jon335,

here's another thread that might be interesting for you: http://www.howtoforge.com/forums/showthread.php?t=38

It has nothing to do with your problem in this thread, but it has also to do with Drupal (and apache rewrite rules). :) In case you run into the same problems when playing around with Drupal... ;)

stamy 4th May 2006 21:02

I've got it !

The solution was to modify this file: /etc/apache2/apache2.conf

<Directory /home/www/*/web>
Options +Includes +FollowSymlinks -Indexes
#===============HERE==============
AllowOverride All
#=================================
Order allow,deny
Allow from all

<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>

Thank's all for your help (maybe there is a cleaner way to do that, lower risk without using "All" for AllowOverride options).

minskog 16th May 2006 14:10

Quote:

Originally Posted by stamy
I've got it !

The solution was to modify this file: /etc/apache2/apache2.conf

<Directory /home/www/*/web>
Options +Includes +FollowSymlinks -Indexes
#===============HERE==============
AllowOverride All
#=================================
Order allow,deny
Allow from all

<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>

Thank's all for your help (maybe there is a cleaner way to do that, lower risk without using "All" for AllowOverride options).

I do it, but dont works for me:

Code:

<Directory /usr/var/www/virtual/*/web>
    Options +Includes -Indexes
    AllowOverride All
    #AllowOverride Indexes AuthConfig Limit FileInfo
    Order allow,deny
    Allow from all
    <Files ~ "^\.ht">
    Deny from all
    </Files>
</Directory>

Gives error 500.

falko 16th May 2006 15:48

What's in your Apache error log?


All times are GMT +2. The time now is 02:52.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.