LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-08-2002, 08:28 AM   #1
BaerRS
Member
 
Registered: Oct 2001
Location: Columbus, Ohio
Distribution: all.. but mainly SuSe--- looks like it changing to Red Hat
Posts: 119

Rep: Reputation: 15
Apache and Virtual Servers...


I have never set up a apache virtual server yet... hopefully in a week I can say different..

Here's my question..

Can you set up multiple web sites on the same IP address.. and have them be distinguished by the name ?? This does sound funny to me... but I was told you can do this ?? is this really possible ??

( It was some ISS guys that told me this was possible.. and they think Apache can do it to... but I don't know how... .....)

Anybody out their with this kind of experience ??

Scott
 
Old 03-08-2002, 09:03 AM   #2
te_conway
Member
 
Registered: Apr 2001
Location: MA
Distribution: redhat 7.2
Posts: 182

Rep: Reputation: 30
Yes you can.
If your domain is mydomain.com then you need to setup domain alias's and have your virtual servers default to them

You could have sales.mydomain.com and info.mydomain.com, then setup different document directories. checkout apache.org for all the directives. The virtual servers inherit from the default so be careful when setting up you directives.

# default
DocumentRoot /www
ServerName mydomain.com

# Sales
<VirtualHost>
DocumentRoot /www/sales
ServerName sales.mydomain.com
</VirtualHost>

# Info
<VirtualHost>
DocumentRoot /www/info
ServerName info.mydomain.com
</VirtualHost>
 
Old 03-08-2002, 09:58 AM   #3
kill-hup
Member
 
Registered: Aug 2000
Location: NY - USA
Distribution: Slackware
Posts: 109

Rep: Reputation: 15
Apache lets you handle multiple hostnames on a single IP via the "NameVirtualHost" directive.
You can specify either an address alone or an address followed by ":port", usually ports 80 or 443 (SSL). If no port is specified, the value of
"Port" defined earlier in the config is assumed.

NameVirtualHost 192.0.0.10:80
NameVirtualHost 192.0.10.3

<VirtualHost 192.0.0.10:80>
ServerName foo.bar.org
ServerAlias www.foo.bar.org
DocumentRoot /wherever/foo.bar.org
...
</VirtualHost>

<VirtualHost 192.0.0.10:80>
ServerName clark.bar.org
DocumentRoot /blah/clark.bar.org
...
</VirtualHost>

<VirtualHost 192.0.10.3>
ServerName mili.bar.org
...
</VirtualHost>

..and so on. Note that SSL VHosts cannot have their own individual certificates due to the nature of the HTTPS protocol. What normally happens is the certificate for the first VHost is used for all subsequent ones.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache + virtual servers yussef Debian 1 01-31-2005 09:48 PM
Apache + virtual servers yussef Linux - Software 0 01-08-2005 01:05 PM
apache virtual servers granny Linux - Networking 3 09-10-2003 11:42 PM
apache virtual servers knueven7 Linux - Software 2 03-31-2003 12:14 PM
Mandrake / Apache Virtual Servers mortalfrog Linux - Newbie 1 03-18-2002 09:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration