Jump to content

apache2 and vhosts the difinitive guide?


isaac_golding
 Share

Recommended Posts

:wall:

So here I am with mandrake 10 and apache2. Out of the box it works great but the moment I wandered into /etc/httpd/conf/vhosts/Vhosts.conf things have gone to crap. So after experiencing hours of 403 not allowed errors on a vhost that point to /home/isaac/website1_public_html/ I return to this forum to read that alot of other people have had the same if not similar problems. So I go back and try all of the advice about vhosts and apahe2 and none of it seems to work.

 

What would be nice is if somebody could point me to a start to finish solution for this mess as I know that everywhere else but in mandrake advx land the vhosts settings I've used work just fine. Anybody got a good url??

 

 

:help:

 

P.S. at this point I've removed EVERYTHING related to apache from the server to include the config files so I can start with a clean slate.

Link to comment
Share on other sites

Hi Isaac,

 

**** Edited Post ****

After some thought, I finally figured out what you meant. And good news is that there is actually nothing to it....

 

Apache2 has many ACL abilities, specifically on Directories. And although *strictly speaking* a Vhost should work without ACL, Apache2 by default RPM install adds all sorts of order by deny, allow, deny from all rules.

 

In any event, the answer you your problem:

 

Add the following directive INSIDE your VHOST directive (you can do this inside your VHosts file)....

 

<VirtualHost yourvhost.com:*>

DocumentRoot /path/to/documents

ServerName yourvhost.com

HostNameLookups off

UseCanonicalName off

DirectoryIndex index.htm index.php index.pl #whatever else you want

IndexOptions FancyIndexing

# the following part is the ACL part

<Directory "/path/to/documents/">

allow from all

order allow,deny

</Directory>

# end ACL part

</VirtualHost>

 

 

Remember to do a configtest (apachectl configtest or /path/to/apache/bin/apachectl configtest) after editing any conf files.

 

 

Hope that helps,

 

Regards,

Armond

**** End Edited Post *****

 

I always install from source, as I need lots of other config options that don't get honored with RPM installs. To install from source, get the latest tarball from http://httpd.apache.org/, unpack (tar zxf httpd-whatever.tar.gz, ./configure --with-prefix=/path/to/where/you/want [other configure options] make and make install. This also installs a couple different conf files. remember, if you install apache from source, to uninstall the RPM (rpm -e httpd should do the trick).

 

to learn more about apaches virtual host directives, visit http://httpd.apache.org/docs-2.0/vhosts/

 

Good Luck,

 

Regards,

Armond

Edited by armondf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...