#1  
Old 16th May 2010, 10:30
GoremanX GoremanX is offline
Member
 
Join Date: Apr 2010
Posts: 50
Thanks: 2
Thanked 0 Times in 0 Posts
Default .htaccess file for /var/www

Using ISPConfig 3.0.2.1 on Ubuntu 10.04 based on the Perfect Server guide.

I'm not sure where I'm supposed to set AllowOverride to be able to use an .htaccess file in /var/www. There are threads about this on the forum, but the configuration files seem to have changed since those threads were solved.

In addition, I'd like to be able to use an .htaccess file for all requests to port 8080. How would I go about doing that?

What are the minimum permissions needed by an .htpasswd file?

Thanks,
Reply With Quote
Sponsored Links
  #2  
Old 16th May 2010, 18:23
mike_p mike_p is offline
Senior Member
 
Join Date: Mar 2010
Location: Surrey, England
Posts: 140
Thanks: 9
Thanked 28 Times in 17 Posts
Default

An htaccess file needs to be in a folder thats looked at by apache.
eg in the document root of a website

If you have a global directive, put it in your httpd.conf
Reply With Quote
  #3  
Old 16th May 2010, 20:25
GoremanX GoremanX is offline
Member
 
Join Date: Apr 2010
Posts: 50
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by mike_p View Post
An htaccess file needs to be in a folder thats looked at by apache.
eg in the document root of a website

If you have a global directive, put it in your httpd.conf
But /var/www is the document root of a web site. It's the server's root website. If I type myserver.com or my server's ip address in the browser, I get the index.html from /var/www

I have an .htaccess file there, it does nothing. I tried adding the following to httpd.conf:

<Directory /var/www>
AllowOverride All
Order Deny,Allow
Deny from all
</Directory>

and restarted Apache. It didn't work. The .htaccess file still does nothing.
Reply With Quote
  #4  
Old 16th May 2010, 23:26
ChaosRealm ChaosRealm is offline
Junior Member
 
Join Date: May 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default htaccess

If your using debian/ubuntu, the reason for this is most likely due to the fact that inside /etc/apache2/sites-enabled/000-default /var/www is set as follows:
Code:
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
Which will override your changes defined in httpd.conf.
In order to allow processing of htaccess Options for files inside /var/www, you will need to change the AllowOverride line from that file to something other than None.

HTH,

Keith

Last edited by ChaosRealm; 16th May 2010 at 23:28.
Reply With Quote
  #5  
Old 17th May 2010, 03:06
GoremanX GoremanX is offline
Member
 
Join Date: Apr 2010
Posts: 50
Thanks: 2
Thanked 0 Times in 0 Posts
 
Default

That's the file I was looking for! Thank you!

Instead of using an .htaccess file, I just changed /etc/apache2/sites-enabled/000-default like this:

Code:
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order deny,allow
                deny from all
        </Directory>
And now the spam/scraper/harvester bots are hitting a "permission denied" page rather than a "file not found" page.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix delivery problem erebus Installation/Configuration 8 29th July 2014 20:17
All my mail is going to /var/mail/vmail _sluimers_ Installation/Configuration 21 10th January 2011 13:21
Chroot SSH + ISPConfig Norman Installation/Configuration 27 26th March 2007 03:40
HotSaNIC domino Tips/Tricks/Mods 23 6th November 2006 05:19
jamed up my table borders?? Boon-Dog-Danny Installation/Configuration 5 23rd September 2006 16:12


All times are GMT +2. The time now is 20:22.


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