FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Virtual Host in Apache





mike_phi
Hi there I need some step by step info to set up a virtual host

here is my problem

I am using Fedora core 5 as my linux distro

I have apache web server set up and have a few sub directories I use for various web pages
at the momment i need to do the folowing to brows my pages

eg

on disk

/var/www/<site A>index.html

in the browser I have to type the following url

http://localhost/<site A>/index.html

what I would like to do is just type

http://<site A>/index.html

and apache should load my local site even if the <site A> = www.example.com


also need to know if there is any DNS setup that would be necessary for this type of arrangement


cheers
jackill
First define:

Code:
127.0.0.1 www.example.com


in Your DNS configuration file /nameserver/.

Then in Apache config:

Code:
NameVirtualHost 127.0.0.1:80

<VirtualHost *:80>
    DocumentRoot "/var/www/site_a"
    ServerName www.example.com
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin qwe@qwe.pl
    DocumentRoot "/var/www"
    ServerName localhost
</VirtualHost>


For details look here: http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Related topics
Aapache Virtual host
Apache
How do i set up a secure socket layer SSL?
Live Web Server Status
apache httpd.conf setup for subdomains
Getting host to connect to my local mysql?
Best way for one IP, many domains, https for all domains?
Is there new Server Status Gif
Can I add tasks to Windows Scheduled Tasks - Using PHP?
how to acces my localhost from another computer
Keep domain name in URL space
Sub-domain vs Sub-page Question
problem with .eu.org domain
How nameserver works --- important
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.