Can't get Apache Virtual Domain to Work

Well I think I'm close, but I have 2 domains that I am trying to get to work with apache on my linode. The first domain works fine, but the second domain is getting 403 Forbidden errors. I have tried chown to apache and chmod all seems fine in that area, path exists and has an index.html file etc.

Here are my settings:

NameVirtualHost 64.5.53.200

 <virtualhost 64.5.53.200="">ServerName garzsbarg.com
ServerAlias *.garzsbarg.com garzsbarg.com
ServerPath /home/httpd
DocumentRoot /home/httpd/htdocs</virtualhost> 

 <virtualhost 64.5.53.200="">ServerName firestormers.com
ServerAlias *.firestormers.com firestormers.com
ServerPath /home/fs
DocumentRoot /home/fs/htdocs</virtualhost> 

Anyone have any ideas?

9 Replies

Update, it seems I can only get it to work if it is a path somewhere past /home/httpd/htdocs

i.e i cant use /home and add its own dir there.

For what you're trying to do, /home should be set world rx, or at least rx with the user Apache runs as.

What are the permissions on /home and /home/fs?

-Chris

Also have you set-up the Directory settings in the httpd.conf file

for the /home directory etc

The /home/httpd/htdocs is set-up by default.

Adam

> Update, it seems I can only get it to work if it is a path somewhere past /home/httpd/htdocs

i.e i cant use /home and add its own dir there.

You need to add an additional section with the path.

Apache is careful with which (sub)directories you can put your documents in.

chmod go+x

chmod 2755

chmod 755

Check your httpd.conf and make sure there's a section like

Options FollowSymLinks

AllowOverride None

This will allow apache to use any directory as it's DocumentRoot, By default it's there.

Next, make sure that the directory you're using is accessible by httpd user.

You could su - and go that directory to make sure it's readable.

If you get "this account is disabled" message, chances are that user has /sbin/nologin shell. Do a "usermod -s /bin/bash " first.

What I normally do is nest the parts inside the parts, which is slightly more secure than doing it in the main part of httpd.conf.

For example, I might do something like this for a typical domain:

NameVirtualHost 12.34.56.78:80

 <virtualhost 12.34.56.78:80="">ServerName some.domain.com
  DocumentRoot /home/someuser/public_html
  User someuser
  Group someuser
  ErrorLog /home/someuser/logs/error_log
  CustomLog /home/someuser/logs/access_log combined
  <directory "="" home="" someuser="" public_html"="">Options -Indexes ExecCGI
    AllowOverride all
    Order allow,deny
    Allow from all</directory></virtualhost> 

Hope this helps. :)

Sorry hehe got this fixed a long time ago ;)

Ooo, I didn't notice the thread date properly. The month began with J and the year was 2004, so my brain read it as July. :D Anyway, you (or someone else) might find that layout helpful anyway. :)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct