Setting up subdomains using virtual host?

snowgurl

Registered
I've been searching for this info and have found so many confusing things ... I still don't understand what to do.

I have a dns registered and I used mydomain.com to get the nameservers, etc. It's all working fine. But, I also set up 2 subdomains, let's say sub1.domain.com and sub2.domain.com. I pointed them both to my IP -- as I did with the original domain.com. That's where I get stuck. I pinged all of them and they are all there. I tried to edit the virtualhost portion of httpd.conf (the part at the bottom) as I read elsewhere, but they still don't register via the browser. I set up 2 folders within the /Library/Webservers/ folder (my root) and used them to map the path. Is there something I'm missing? Do I need to un-# some other line in the file? Or do something in NetInfo?

Also, I can't access my web site using the domain name I have from my own computer, but I can from any other computer out there. I can use localhost or 127.0.0.1 from here so it's not that big of a deal. I'm just wondering why. It's a pain when I have hard links on pages that use the domain name -- I can't follow the links.

I know I'm still alittle confused about the whole dns/host/IP thing, but it seemed to make sense until now. I've also read about using "named" or "bind" to set up your own dsn thing but I'd rather just do it the easy way -- if it is easier.

Any suggestions?
 
hey

at my company we do webhosting on G4's

i'll post the configs as far as possible but anonymized;
please let me know if you need more

the path to the websites:
/Local/Library/WebServer/WebSites/www.domain.com

entry at
/Local/Library/WebServer/Configuration/apache.conf

<VirtualHost ip-adress:80>
ServerName www.domain.com
<Directory /Local/Library/WebServer/WebSites/www.domain.com>
Options Indexes FollowSymLinks IncludesNoExec
</Directory>
DocumentRoot /Local/Library/WebServer/WebSites/www.domain.com
NameVirtualHost ip-adress
ServerAlias domain.com
TransferLog Logs/the-domain-com.log
ScriptAlias /cgi /Local/Library/WebServer/WebSites/www.domain.com/cgi
</VirtualHost>

at subdomains the same game :)
 
Back
Top