Page 1 of 1

.htaccess is not used by apache (solved)

Posted: 30 Oct 2011, 12:16
by wimr0001
I need .htaccess for rewriting url's and some other things.
The rewriting does not function and after many tests and comparing with an apache webserver on the local pc using the same configuration with .htaccess, I come to the conclusion that the .htaccess file is not used at all.
For instance the construction:
<FilesMatch "\.(txt|htm)$">
Order deny,allow
Deny from all
Allow from none
</FilesMatch>

does not work on the B3. It does however on my local apache server.

Of course, I did not change the apache2.conf (AccessFileName .htaccess), nor did I some override in the httpd.conf

Has anyone an idea?

Re: .htaccess is not used by apache

Posted: 30 Oct 2011, 13:46
by Ubi
Did you even bother to search yourself?

But anyway, here's a link that may help: http://lmgtfy.com/?q=.htaccess+is+not+used+by+apache

the magic line is this:

Code: Select all

What you can put in [.htaccess] files is determined by the AllowOverride directive [from the main apache config]. This directive specifies, in categories, what directives will be honored if they are found in a .htaccess file. If a directive is permitted in a .htaccess file, the documentation for that directive will contain an Override section, specifying what value must be in AllowOverride in order for that directive to be permitted.

Re: .htaccess is not used by apache

Posted: 30 Oct 2011, 15:31
by wimr0001
Thanks for your help.
The solution? change the file 'apache.site' in directory /usr/share/bubba-frontend'?
I prefer not to do so. Is there another solution?

Wim

Re: .htaccess is not used by apache

Posted: 30 Oct 2011, 15:36
by Binkem
You have to make a modification in /etc/apache2/sites-enabled/bubba

Change the red word in het following from None to All (make sure it is in the section <VirtualHost *:80>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/cacert.pem
SSLCertificateKeyFile /etc/apache2/privkey.pem

ServerAdmin webmaster@localhost

DocumentRoot /home/web/
DirectoryIndex index.html index.htm index.cgi index.pl index.php index.xhtml
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /icons/ "/usr/share/apache2/icons/"
<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /home/web/
DirectoryIndex index.html index.htm index.cgi index.pl index.php index.xhtml
<Directory />
Options FollowSymLinks
AllowOverride none
</Directory>
<Directory /home/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /icons/ "/usr/share/apache2/icons/"
<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /music http://localhost:3689
ProxyPassReverse /music http://localhost:3689

</VirtualHost>

Re: .htaccess is not used by apache

Posted: 30 Oct 2011, 16:07
by wimr0001
Thanks. The problem is solved.
This subject can be closed.