apache, with virtualhosts on multiple ports

Here mainly because i forget this. If you want to set up a new VirtualHost ,on your Apache Server,on new port i.e. 81 just add this to your HTTPD.conf file

<VirtualHost 127.0.0.1:81>
   ServerAdmin temp@temp.com
   DocumentRoot "c:/wwwroot/"
   ServerName www.newsiteport81.com
</VirtualHost>

but before you restart the services don't forget to make Apache Listen on that port as well by adding the following under "LISTEN 80"

# ADD PORT 81
Listen 81

Without this Apache will not be listening on PORT 81, and you'll be sitting in front of your box wondering what you've missed - you'll realise - then you'll blog about it ;o)

Posted: 04-Apr-2005

View: 6073

Permalink: here

Comments

Hey andy, do you have a tutorial or book you recomend for getting started with apache? Especially on windows? I've been wanting to use it for a while just for experience, but I just can't seem to find anything that really helps.

#1 Ryan Guill
04/Apr/05 8:24 AM

Hi Ryan, i hate it when people say this myself, but i actually got it from the manuals and searching the web. In a nutshell i got the binaries, then starting up your first site easy as you just need to find the httpd.conf file - basically you settings file. Setting up an alias to something like the CFIDE folder is as simple as adding the follwoing to this file
Alias /CFIDE "c:/cfmx7/wwwroot/CFIDE/".

If you need any help drop me a line. I'm in no way a guru in Apache on Windows, but i've got mine up and running - so thats gotta count for something :o)

#2 andy jarrett
07/Apr/05 1:31 AM

If you're running a website on port 81, your users will have to type an ugly :81 in the URL, ex. http://example.com:81/.

You can get around the blocked port 80 issue and hide the port in the URL if you use TZO's webrelay. TZO can redirect web traffic around blocked ports.

#3 Scott Prive
07/Jun/05 7:39 AM