LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache virtual hosts (http://www.linuxquestions.org/questions/linux-software-2/apache-virtual-hosts-57919/)

Mil0 05-03-2003 02:16 AM

Apache virtual hosts
 
i've been messing with it a bit but cant quite figure this out.


i have a dedicated server standing somewhere on the planet with a fixed ip [say 1.2.3.4]. I bought a domain [say bla.com] and edited the zonefile with these A records :

bla.com A 1.2.3.4
john A 1.2.3.4
* A 1.2.3.4

now my domain and all possible subdomains point to my webserver (latest stable version of apache), which is perfect.

in my webroot i have subfolders for some 'crew' people.
let's call em John and tim

now their homepages will be :
http://www.bla.com/john/
http://www.bla.com/tim/

but i want them to have :
http://john.bla.com
http://tim.bla.com

i can't seem to get this to work with VirtualHosts but i doubt it should be hard ?

I've tried searching google and the man pages but without any luck

:Pengy: so my question is :
- do i need a seperate record for each user in the zonefile ? (a subdomain)

and

- does anyone have an example how to do this or something similar to get me on the right track.

thanks in advance

Milo

mcleodnine 05-03-2003 02:26 AM

they won't work very well if the name server can't resolve the domains for john.blah.com and tim.blah.com.

You need to have a working dns entry in the zone file of the name server you're using for blah.com

KennyK 05-03-2003 01:29 PM

Here is an example of my subs.conf file that you will also need.


<VirtualHost 192.168.0.200>
ErrorLog /home/mydomain/www/logs/error_log
ServerName forum.mydomain.com
ServerAdmin kenny@mydomain.com
CustomLog /home/mydomain/www/logs/access_log combined
DocumentRoot /home/mydomain/www/htdocs/forum
</VirtualHost>


Hope this helps

cyberskye 05-03-2003 02:32 PM

Quote:

- do i need a seperate record for each user in the zonefile ? (a subdomain)
yes. point jon.blah.com and tim.blah.com to the same public addy

Then create separate virtual hosts Containers for each sub domain. The docs for VHosting on the apache site are quite good.

If you are planning on adding more in the future, you might want to create a single, separate domain - crew.blah.com - then add subfolders for each new user - crew.blah.com/jon - that would make dns and httpd.conf maintenance a little easier.

Skye

aero 05-03-2003 03:04 PM

Yes, you need to have a dns server pointing the other domain's to yr IP also... then separate the "waters" with a virtual host entry like the one KennyK posted

CrazyToon 06-02-2003 12:58 AM

You should go read the stuff on apaches website on vhosts. U can rewite the url and stuff.
http://httpd.apache.org/docs-2.0/vhosts/

also might be good to read:
http://httpd.apache.org/docs-2.0/vhosts/mass.html

2nd link is what i use for hosting.


All times are GMT -5. The time now is 12:04 PM.