LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-01-2004, 07:08 AM   #1
gevers1
LQ Newbie
 
Registered: Jan 2004
Location: Netherlands
Distribution: fedora
Posts: 17

Rep: Reputation: 0
Virtual Hosting - what does it actually do?


I've been playing around with virtual hosting for a little while, and have got it working - to a point. Perhaps i misunderstand what Virtual Hosting is, so let me explain what I want to do, and can someone tell me if this is possible with Virtual Hosting, or am I just wasting my time .. :-)

I bought a domain a while back (www.mydomain.net), had it hosted at a well known uk-based hosting service. I also had several subdomains set up at that domain.

I've figured out that I can now host my own domain from my linux box, which works a treat, but now i'd like to have access to my sub-domains too.

So i've setup my httpd.conf file (snipped to protect the innocent),


<VirtualHost *:80>
ServerName www.mydomain.net
ServerAlias mydomain.net *.mydomain.net
DocumentRoot /var/www/html/mydomain
ServerSignature email
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>

<VirtualHost *:80>
ServerName www.mysubdomain.net
ServerAlias mysubdomain.net *.mysubdomain.net
DocumentRoot /var/www/html/mysubdomain
ServerSignature email
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>


I also edited my etc/hosts file, because it suggested somewhere else on this forum and it seemed to make things work so ...

Anyway, I can see my Virtual Server from my machine (i use name based Virtual hosting) but when i type in http://www.mysubdomain.net all I see is the original www.mydomain.net

I know that the httpd.conf file determines which is the main server (based on the order it appears in that file) but how do i get access from the internet to my Virutal Subdomain?

I've tried everything, and i cant get it to do what i *think* it should do. Is this what virtual hosting allows you to do? Or is it only for intranets?

thanks
/* Sjg */
 
Old 02-01-2004, 09:23 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Virtual Domains are a way for you to have multiple domains on the same server per se.

Its also used to setup vanity domains like if you had.. www.somedomain.com and you wanted your gallery of pictures to be at gallery.somedomain.com you would set it up using the virtual domain names.

After making your changes to your httpd.conf file, you also have to add these to your DNS so it knows where to find them, etc.
 
Old 02-01-2004, 09:25 AM   #3
gevers1
LQ Newbie
 
Registered: Jan 2004
Location: Netherlands
Distribution: fedora
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks. I had a feeling this is what it is supposed to do. When you say 'add these to your DNS' you mean the /etc/hosts file? Or is there some other trickery i need to do?

/sjg
 
Old 02-01-2004, 09:28 AM   #4
gevers1
LQ Newbie
 
Registered: Jan 2004
Location: Netherlands
Distribution: fedora
Posts: 17

Original Poster
Rep: Reputation: 0
oops no, you mean the Bind Configuration Tool thingie with all the forward zone and reverse zone right? that looks really scary - how do you configure that to user virtual hosts?

sjg
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Hosting? nr5 Linux - Software 10 06-03-2005 01:30 PM
virtual hosting setenv02 Linux - General 6 05-05-2005 02:35 AM
Virtual hosting... id10t Linux - Networking 4 02-02-2004 05:43 PM
Virtual Hosting joseph Linux - General 3 08-20-2003 04:16 AM
Virtual Hosting marson Linux - General 2 12-28-2000 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration