Apache web server setup
Thread Starter
Joined: Mar 2004
Posts: 133
Likes: 0
From: Bournemouth, UK
I've got a question for anybody that is familiar with running Apache on Linux. I want to setup multiple web servers to run on a single machine. I only have a single IP address and a single network connection on the box. I currently have a web site up and running, but when I tried to add a second, using VirtualHost, I got into a bit of a knot. If using virtual hosts is the way to go then I'm sure I'll work it out, but if anybody has any advice I would appreciate it.
Regards
Stoney
Regards
Stoney
'nough said
Joined: Sep 2002
Posts: 1,025
Likes: 0
From: Raynes Park
Are you editing httpd.conf directly?
My setup uses cPanel which modifies the file directly but once it a while I find it easier to edit it myself.
Hence to add a new virtual host you would copy and paste and existing entry and edit the url/local path etc.
Info on Apache site
here
hth
Charles
My setup uses cPanel which modifies the file directly but once it a while I find it easier to edit it myself.
Hence to add a new virtual host you would copy and paste and existing entry and edit the url/local path etc.
Info on Apache site
here
hth
Charles
Joined: Sep 2002
Posts: 778
Likes: 0
From: London, UK
Using Virtual Hosts will definitely do want you want. You want 'Name-based' Virtual Hosts, because you've only a single IP address. It's very straightforward. All you do is:
NameVirtualHost *
<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
This example is from the documentation on the subject which is here.
NameVirtualHost *
<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
This example is from the documentation on the subject which is here.
Thread Starter
Joined: Mar 2004
Posts: 133
Likes: 0
From: Bournemouth, UK
Thanks amanoffewwords and drauk. Nice to know I'm on the right track. What you say is pretty much what I had gleamed off the net last night. I suspect finger trouble was causing the probs. I'll give it another go tonight.
Regards
Stoney
Regards
Stoney




