So I've made the switch to running a full webserver from home and save myself some cash. Now i've got a dns service (zoneedit.com) am running xampp(apache/mercurymail/filezillaftp/mysql for windows (i know I know, when i get the spare hardware I'll be running linux on a seperate machine) and I can see the site from everywhere i've tried. Now what I want to do is run sub domains for each of the features I want, ie: ftp.chrisgilroy.ca - FTP server mail.chrisgilroy.ca - Mail server etc etc i would love any instructions as to how this can be done!
Double check your ISP, most of the time if your caught running a web server that people can access from home they can "own" all the data.
Why would you want separate subdomains for each function if they are all running on the same machine under the same IP? If you really want a load of subdomains pointing to the same IP as the main one, which seems pointless to me, you can add them all using ZoneEdit.
Well I've added them using zoneEdit, but when I use the url in a browser, it takes me to the mainpage of the site. I also have a problem with a subdomain I setup in apache doing the exact same thing, pointing to the home directory instead of the proper sub as for my isp their cool with it, i checked.
Well, the subdomains are going to take you to the main page of the site if you put them in a browser, because it is the same IP - you didn't say you wanted the domains to show different things in a browser. You need to setup 'virtual hosts' in your Apache conf if you want them to display different things, it's in the manual and simple enough. You specify the subdomain you want it to respond to, and then tell it the directory to look in for the pages.
Code: <VirtualHost *:80> ServerAdmin [email]webmaster@chrisgilroy.ca[/email] DocumentRoot ../htdocs/portfolio/ ServerName [url]www.chrisgilroy.ca:80[/url] ServerAlias *.chrisgilroy.ca </VirtualHost> <VirtualHost *:80> ServerAdmin [email]webmaster@chrisgilroy.ca[/email] DocumentRoot ../htdocs/personal/ ServerName personal.chrisgilroy.ca:80 ServerAlias [url]www.personal.chrisgilroy.ca[/url] </VirtualHost> <Directory ../htdocs/portfolio/> Options All AllowOverride All Order allow,deny Allow from all </Directory> <Directory ../htdocs/personal/> Options All AllowOverride All Order allow,deny Allow from all </Directory> However, the personal directory still points to the damn portfolio folder when you use the url.
Yeah i've always had problems with apache and virtual domains on windows boxes...dunno why... I just use IIS now for that if I need virtual domains...
Have you tried putting the blocks the other way around, so that it would try and match the personal space first? Got a feeling that *. might be confusing it. I've just looked at my .conf and can't see any significant difference from yours, if that doesn't work, try it without the ServerAlias lines just to simplify things.
yea thats what i've been reading, that you need to declare you subdomains first so that the * catchall grabs whatever the subdomains miss.
*Update* Moved things around in my test server on my lappy, seems to work, I'll give it a spin with the webserver when i get home (can't vnc from here, stupid school firewall)
now, the only issue I seem to have is when I try to use the chrisgilroy.ca instead of www.chrisgilroy.ca it directs to the tutorials section. am I missing anything? Code: <VirtualHost *:80> DocumentRoot ../htdocs/ ServerName localhost:80 </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@chrisgilroy.ca DocumentRoot ../www/tutorials/ ServerName tutorials.chrisgilroy.ca:80 </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@chrisgilroy.ca DocumentRoot ../www/personal/ ServerName personal.chrisgilroy.ca:80 </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@chrisgilroy.ca DocumentRoot ../www/portfolio/ ServerName www.chrisgilroy.ca:80 </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@chrisgilroy.ca DocumentRoot ../www/portfolio/ ServerName *.chrisgilroy.ca:80 </VirtualHost>