LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2012, 07:06 AM   #1
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Rep: Reputation: Disabled
configuring httpd.conf in centos


In a virtual hosting environment how can i set AllowOverride to ALL for .htaccess file in the httpd.conf file only for a particular virtual host in a Centos server.

Because a particular client can view only his homepage and not others so i think it has got to with .htaccess file.


Or is it ok if i make AllowOverride to ALL for all the virtual hosts?
 
Old 03-23-2012, 12:06 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,671

Rep: Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562
Hi,
Quote:
In a virtual hosting environment how can i set AllowOverride to ALL for .htaccess file in the httpd.conf file only for a particular virtual host in a Centos server.
You can put the "AllowOverride All" inside a <Directory /path/to/vhost/docroot>...</Directory> section in the vhost container of the particular vhost.
E.g.
Code:
<VirtualHost*:80>
ServerName www.domain.com
DocumentRoot /var/www/html/domain.com
<Directory /var/www/html/domain.com>
AllowOverride All
...
</Directory>
...
</VirtualHost>

Quote:
Or is it ok if i make AllowOverride to ALL for all the virtual hosts?
If you don't need .htaccess files, don't enable them globally, as it slows down your webserver. For an explanation have a look here

Regards
 
Old 03-27-2012, 07:14 AM   #3
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Original Poster
Rep: Reputation: Disabled
<VirtualHost *:80>
ServerAdmin webmaster@host.com
DocumentRoot /var/www/html/example
<Directory /var/www/html/example>
AllowOverride ALL
</Directory>
ServerName www.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

For some reason i have changed the name of the host n the sites here but the configuration is exactly the same and i did as told making this particular virtual host only to read the htaccess file..

Is this correct?
 
Old 03-27-2012, 12:03 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,671

Rep: Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562Reputation: 1562
Hi,

Yes it's ok. Apache will look for .htaccess file only for the www.example.com vhost

Regards
 
Old 03-27-2012, 11:59 PM   #5
SarahGurung
Member
 
Registered: Jul 2011
Posts: 322

Original Poster
Rep: Reputation: Disabled
Hey thanks a lot.....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backing up httpd.conf on CentOS 5 nootkan Linux - Newbie 3 01-13-2011 09:32 PM
[SOLVED] Change of Apache httpd.conf doesn't work on CentOS/RedHat? photonxp Linux - Server 1 07-01-2010 12:12 AM
(CentOS 5.3 server) httpd.conf configuration issue involving DirectoryIndex xshad0wfx Linux - Server 4 06-19-2009 10:32 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
Configuring httpd.conf for CGI in Apache 2.x clinton Linux - Newbie 2 01-01-2005 01:13 AM


All times are GMT -5. The time now is 04:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration