Helpful Information
 
 
Category: Apache configuration
How would I configure Apache to act like two servers

I'm talking Apache 1.3.something on Win2K - it's all set up fine for c://docs/ as the document root, but what I'd like is a second folder at c://docs_new/ to also be accessible - like a secondary dev server.

I'm thinking bind the second folder to a different port ... but I don't know how to do that ..?

You can tell apache to 'listen' on ports other than 80.. - look in your httpd.conf for the Listen directive , eg

Listen 81


now you could add something like this... (NOTE - these are very slack permissions , just get it working first then tighten up a little :))

<VirtualHost 127.0.0.1:81>
ServerAdmin [email protected]
DocumentRoot c:/new_docs
ServerName localhost
<Directory "c:/new_docs/">
Options All
AllowOverride none
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


restart apache ! & nav to http://localhost:81

you can do name based virtual hosts as well but thats a pain on win32 (as everyones system seems to have its own take on where and how the hostnames are resolved IME!)

dude that's great :thumbsup: slack permission are not a problem because it's a private lan.

A quick question though (if you happen to know offhand) - when I'm surfing on that port and I click a link, does it stay on that port or do I need to take care of that myself?

Nevermind - seen.


But now - although port 81 works fine, port 80 to the default folder doesn't work at all anymore ??

Sorry mate me head a'int screwed on properly this week !

you need to listen to both ports , then both should work fine.

Listen 81
Listen 80

doh !


thanks :)










privacy (GDPR)