Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

something.mysite.com

Status
Not open for further replies.

JurkMonkey

Programmer
Nov 23, 2004
1,731
CA
Hello,

I have DNS server that is redirecting traffic from wiki.mysite.com to a specific server running apache. If it's wiki.mysite.com I want to go to the wiki site hosted on that apache server. If I go to support.mysite.com I want to go to a different site on the same server.

Can I get apache to do this for me automatically or do I have to write some kind of index page that redirects accordingly?

Thanks!

 
Found it.

You have to create a virtual host in your /etc/apache2/httpd.conf file

NameVirtualHost <youripaddress>:80

<VirtualHost <yourip>:80>
ServerName subdomain.localhost
DocumentRoot /var/</VirtualHost>

My config looks like this

NameVirtualHost 192.168.1.5:80

<VirtualHost 192.168.1.5:80>
ServerName wiki.localhost
DocumentRoot /var/lib/mediawiki1.7
</VirtualHost>

Then restart apache

sudo /etc/init.d/apache2 restart

And you're off like a prom dress.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top