LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with Virtual Hosts? (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-virtual-hosts-339291/)

econnections 07-02-2005 05:11 AM

Help with Virtual Hosts?
 
Hello everyone,

I want to set-up two domains on my REDHAT 8 server accessed from the Internet. I've registered the domains and set-up the Name Servers and DNS. The default virtual host point to wwwmyweb1couk and all the sub directories that have been set-up are accessible.

I then tried to set-up the second virtual host using the tool:

HTTP SERVER/VIRTUAL HOSTS
Add new domian
Set Document Root Directory: /var/www/html/myweb2

Host Information: Name based virtual host

IP address: *:80
Host Name: wwwmyweb2couk

I then checked the httpd.conf file and everything looked OK.

I created /var/www/html/myweb2/index.html and set folder and file permissions to the same values on the default web. And added index.html to the Directory Page Search List.

Finally I restarted the httpd service.

However, when I enter wwwmyweb2couk into my browser (IE6) I get the default root home page saying this is an Apache server and not the page in the Doc Root Director.

I'm running a Zonealarm firewall on the client machine but this shouldn't make any difference. And the server is a seperate box.

Any ideas - I've been struggeling on this for weeks?

Graham UK

hardcorelinux 07-02-2005 05:29 AM

Try this

NameVirtualHost 192.168.0.1:80


<VirtualHost 192.168.0.1>
ServerAlias www.yourdomain.com yourdomain.com
ServerAdmin webmaster@yourdomain.com
DocumentRoot /home/yourdomain/public_html
BytesLog domlogs/yourdomain.com-bytes_log
ServerName www.yourdomain.com
</VirtualHost>


check the permissions of public_html folder set to 755



restart apache

econnections 07-02-2005 08:03 AM

Thanks, this appears to have resolved the problem.

I removed the default virtual host and the additional vhost then created to new vhost sections as you have shown. When I restated the httpd service all worked as expected. In future I think it might be easier to edit httpd.conf than use the HTTP Server tools.

Many thanks
Graham

econnections 07-02-2005 12:39 PM

.


All times are GMT -5. The time now is 01:19 PM.