HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   htaccess not working with ISPconfig (http://www.howtoforge.com/forums/showthread.php?t=26469)

comptcarlik 31st August 2008 11:07

htaccess not working with ISPconfig
 
hi . can anyone help . how can i get htaccess to work on a server working perfectly with ISPconfig . this is the first time i am using ISPconfig it really come in handy . so i am afraid to bust something . thanks

Hans 31st August 2008 12:40

You can not use .htaccess files for the site, because the use of .htaccess files is not allowed on your system.
To allow .htaccess files for a single site, enter the following to the apache directives field on the basis tab of the web within ISPConfig:

<Directory "/var/www/web#/web">
Options FollowSymLinks
AllowOverride All
</Directory>

Note: web# is the webnumber as created by ISPConfig.

Alternative:
Allow the use of .htaccess files on your server globaly, by changing AllowOverride None into AllowOverride All within your Apache configuration file.
Restart Apache afterwards.

bidevi 31st August 2008 16:23

more about .htaccess
 
Hans wrote:

Allow the use of .htaccess files on your server globaly, by changing AllowOverride None into AllowOverride All within your Apache configuration file.
Restart Apache afterwards.


Sorry Hans, unclear for newbies.

1. What is the Apache configuration file? Is this etc/apache2/apache2.conf or some other file?

2. In apache2.conf there are a lot of AllowOverride lines. Which one do we change from what into what or must we add something?

3. And when you state: Restart Apache afterwards, could you, for the sake of helping newbies, please give the command: /etc/init.d/apache2 force-reload?

Thanx in advance for your help

Hans 31st August 2008 21:37

@bidevi,

Here is more specific information:

Within the /etc/apache2/apache2.conf file (somewhere at the end) you find the following lines:

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

To allow .htaccess files globally on your system (within all the webs created by ISPConfig) change AllowOverride None, into: AllowOverride All

After saving the configuration file, restart apache2 again with:
/etc/init.d/apache2 restart or /etc/init.d/apache2 force-reload

bidevi 1st September 2008 00:34

still no luck with .htaccess
 
I followed the instructions as given above.

Then I opened my browser to open my own webpage which is protected with a .htaccess user & password. It works on my Fedora configuration without ISPConfig.

With ISPConfig on Debian Etch I get this:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@mysite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.3 (Debian) PHP/5.2.0-8+etch11 mod_ssl/2.2.3 OpenSSL/0.9.8c Server at www.mysite.com Port 80


Any suggestions?

bidevi 1st September 2008 00:57

My own stupidity
 
Everything works.

Since the path from .htaccess to .htpasswd is not identical on different systems I had to make adjustments.

After I did that, everything worked.

I decided to put this on line for other newbies.

comptcarlik 1st September 2008 02:54

htaccess not working with ISPconfig
 
thank you for your help. i guess i am still doing something wrong . first i was a bit afraid to touch the http.conf file since this is the first time i am using ISPconfig i didn't know how it will react after restarting apache .
i tried all the solution posted above but none seems to work
i am using fedora 9 so i guess my http.conf file is found under /etc/httpd/conf/http.conf
first of all i added

<Directory "/var/www/web#/web">
Options FollowSymLinks
AllowOverride All
</Directory>
replacing # by the number the server gave me that was 8 on the ISPconfig apache Directives
(didn't work after rebooting )
i tried globally both first adding it to the ISPconfig apache directives and the editing my http.conf file ...
(didn't work after rebooting)
i also tried

<Directory /var/www/*/web>
Options +Includes -Indexes
AllowOverride All
AllowOverride Indexes AuthConfig Limit FileInfo
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>
both on the ISPconfig apache directives and the http.conf file
(still didn't work )
i was wondering if folder listing could have something to do with it .
my server doesn't allow folder listing on none of the virtual servers i figure out on our old SUSE server that htaccess only worked if folder listing was allowed . but i am not sure about that .

falko 1st September 2008 17:26

Either put something like

Code:

<Directory "/var/www/web#/web">
AllowOverride All
</Directory>

in the APache Directives field of that web site in the ISPConfig interface, or...

Quote:

Originally Posted by comptcarlik (Post 143138)
i also tried

<Directory /var/www/*/web>
Options +Includes -Indexes
AllowOverride All
AllowOverride Indexes AuthConfig Limit FileInfo
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>
both on the ISPconfig apache directives and the http.conf file
(still didn't work )

... try
Code:

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

instead.

comptcarlik 2nd September 2008 10:16

htaccess not working with ISPconfig
 
thanks for your solution falko .
i guess i have a mis configuration in the apache server . i tried your solution . i still can't get any of them to work .. i guess there is a global directive over taking the optional directives . how can i figure ou what should be commented out in the http.conf file . everytime i make a change i reboot the server hoping it will work . :confused::confused::confused: still not working .

falko 3rd September 2008 12:36

Can you post your Vhosts_ispconfig.conf?


All times are GMT +2. The time now is 09:35.

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