Help! Cannot get apache to direct to my virtual hosts! What gives?

I am setting up Apache on a new dedicated server. Using the same httpd.conf data as the last server, but it is not resolving my host names correctly.

I want to serve  /home/public_html/host3/index.html

but when I go to  http://www.myserver.com/~host3  , I get "page cannot be displayed"

in the error_log, it says  " File does not exist: /var/www/html/~host3"

How do I get this to work?

from htttpd.conf:

<Directory />
    Options All
    AllowOverride All
</Directory>

UserDir public_html

NameVirtualHost (my.ip.address)

<VirtualHost (my.ip.address)>
DocumentRoot /home/host3/public_html
ServerName www.host3.com
ServerAlias www.host3.com host3.com
ServerAdmin webmaster@host3.com
</VirtualHost>
alcibiadesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BlazCommented:
Are you trying to access www.host3.com or www.myserver.com?

Also your DocumentRoot in host3 virtual host is wrong
DocumentRoot /home/host3/public_html
0
xDamoxCommented:
Hi,

The reason your getting this error is because you are access you server as follows:

http://www.myserver.com/~host3

you have virtual hosting enabled so all you need to do to access that page is:

http://my.ip.address

replace my.ip.address with the one you used in virutal hosting.

0
alcibiadesAuthor Commented:
I am trying to access www.myserver.com/~host3/index.html

The domain registration for www.host3.com has not been setup yet.

I don't understand Blaz'z comment about the DocumentRoot. His example looks the same as mine .

 xDamox,

I have multiple virtual hosts. So http://my.ip.address is not going to resolve to host3 without additional information. www.myserver.com resolves to the master zone my.ip.address.com
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Gabriel OrozcoSolution ArchitectCommented:
> I want to serve  /home/public_html/host3/index.html
> but when I go to  http://www.myserver.com/~host3  , I get "page cannot be displayed"

I suspect you are trying to use personal home directory accounts when using http://....../~host3/index.html

but that would work for /home/host3/public_html/ if you have setup your apache as default config. Since you (obviously) haven't configured this feature, apache will look at "$DocumentRoot/~host3" directory which is " File does not exist: /var/www/html/~host3"

So, what to do?
well, you can
a) create a temporary virtual host for a domain you aldready own (this is my preferred method) and use it until you have the final domain ready
b) enable mod_userdir, so your query get redirected to the users home_directory/public_html (you should garantee correct permissions on all files)
c) move the test web site to a path under your DocumentRoot subdirectory and test using ip addresses

hope this help
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
alcibiadesAuthor Commented:

What you say makes me wonder if mod_userdir is not enabled. I thought it was. It is selected under Webadmin. I am going to check out your suggestions and see what I can learn.
0
xDamoxCommented:
Hi,

As Redimido said it does look like your wanting to use mod_userdir this would mean you will not need virtual hosintg

In your httpd edit the following:

UserDir enable host3 host2

Notice you have to add the users on that line the reason for that is so root dosntget some web space. You will
also need to uncomment out:

<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.