htaccess does not work on Ubuntu Dapper Drake

Discussion in 'Installation/Configuration' started by praenti, Feb 8, 2007.

  1. praenti

    praenti New Member

    Hi,

    I need some help with setup my Apache. I did the Perfect Setup on the server where ISPConfig is running. The problem is that Apache ignores my .htaccess files in the web directorys.
    For example, I have here a directory /data/www/web9/web where a .htaccess is present (ReWrite and Auth doesn't work, configuration is OK because on my other server this works very well and writing the rules directly into teh vhost config gets them running).
    Looking into /var/log/apache2/error.log on LogLevel debug doesn't show any error, so the file is ignored because I get the index.html and a corresponding entry in the access-log.

    Changing the entry to this state:
    <Directory /var/www/*/web>
    Options +Includes -Indexes -ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    <Files ~ "^\.ht">
    Deny from all
    </Files>
    </Directory>
    doesn't bring any effect :-(. Also a AllowOverride directive in the vhost config doesn't have any effect.

    So the only conclusion is that ISPConfig uses a configuration, which ignores .htaccess files, if you install it on a standard Ubuntu Apache (which in other cases does not ignore .htaccess).
    So whats wrong there, I need help here!

    Btw. I've also seen that there are Filter-Directives in the vhost configuration which produce an error on the configuration. Is there a special meaning behind, because I don't see what they should do.

    Cheers,
    Mike
     
  2. martinfst

    martinfst Member Moderator

    The errors are logged per site, not in the main Apache2 error log.

    Look in /var/www/web1/log/error.log for site related errors. Substitute of course your ispweb location and the web_id with your site specifics. Have you set the permissions and owner/group correctly for .htaccess?
     
  3. praenti

    praenti New Member

    Are you shure that the errors are logged per site? Because you need then a ErrorLog directive in the vhost which is not present. And I see other errors in the main error log from vhosts, which are coming from the PHP Filter-Directives ("[Thu Feb 08 21:05:35 2007] [error] an unknown filter was not added: PHP
    ").

    At the moment the htaccess has permissions "rw-r-r web9_admin web9". Is this insufficient, because on my other server the htaccess-files have the same permissions.
     
  4. praenti

    praenti New Member

    Ahh. Wait a moment, I'm somehow a little bit blind... There is an ErrorLog directive :). Thank you. The helps a lot. I will post a solution if I have one!
     
  5. praenti

    praenti New Member

    I had also an error into the directory names because I moved the /var/www to /data/www and created a softlink. I corrected that now to /data/www, because Apache was confused about that. So the Directory-Directives are working now correctly.

    Also there no error message. If I rename the index.html I get an index forbidden error, as I expect, so no error. Just an ignored htaccess file.

    What else can I do?
     
  6. praenti

    praenti New Member

    Ok. .htaccess is now working. Looks like in the test before, mod_rewrite does not work. Implementing a http-auth works.

    So thank for your help. Perhaps anybody has a hint why mod_rewrite does not work in htaccess files?

    Cheers,
    Mike
     
  7. martinfst

    martinfst Member Moderator

    Rewrite in .htaccess works perfect for me. :confused:
    I've set the RewriteLogLevel to 5 or 9 to get more debug info and I created a rewrite log to see what happens. You need to do that in the text block of ISPConfig website, setting the log level cannot be done in a .htaccess file.
     

    Attached Files:

  8. praenti

    praenti New Member

    That was the hint what I needed. My Log says:
    applying pattern '^/(.+)$' to uri '' for http://www.xyz.de/
    and
    applying pattern '^/$' to uri 'index.html' for http://www.xyz.de/index.html

    Normally I would expect that in the first case the URI is '/' and in the second case '/index.html' (see RFC 3986). I don't know why Ubuntu's Apache doesn't care about the RFC if I understood it correctly (my two other Apaches give here a heading '/') and why the heading '/' is missing in the URI but I think with this knowlegde I can do a correct rewrite.

    So thank you for your help.

    Cheers,
    Mike
     
    Last edited: Feb 8, 2007

Share This Page