Apache web server setup
Thread Starter
Join Date: Mar 2004
Location: Bournemouth, UK
Age: 54
Posts: 133
Likes: 0
Received 0 Likes
on
0 Posts
Apache web server setup
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
Join Date: Sep 2002
Location: Raynes Park
Age: 58
Posts: 1,025
Likes: 0
Received 0 Likes
on
0 Posts
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
Join Date: Sep 2002
Location: London, UK
Posts: 778
Likes: 0
Received 0 Likes
on
0 Posts
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
Join Date: Mar 2004
Location: Bournemouth, UK
Age: 54
Posts: 133
Likes: 0
Received 0 Likes
on
0 Posts
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