Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-05-2004, 11:04 AM   #1
Registered: Jan 2002
Location: Dallas, TX
Distribution: RedHat 7.0 - Kernel 2.4.17
Posts: 95

Rep: Reputation: 16
Question Different webpages on same server.


I host 2 different websites on 2 different red hat linux servers. One is on the brink of being dead. One of my linux servers has different IP addresses and that is no biggie, but my question is, can I have 2 main www websites on the same machine, for example: --> x.x.x.1 --> x.x.x.2

Please let me know... Thanks, Jim
Old 02-05-2004, 11:21 AM   #2
Registered: Oct 2002
Location: I-Town, NY
Distribution: Debian, Slackware
Posts: 130

Rep: Reputation: 15
The topic you want to study up on is called "virtual hosting." You'll find docs on this on apache's web site.
Old 02-05-2004, 12:33 PM   #3
Registered: Jan 2004
Location: Green Bay
Distribution: RedHat 8.0, LFS-5.0
Posts: 100

Rep: Reputation: 15
There are two different types of virtual servers in apache, name based and ip based.

When you are changing your apache config file, make sure you use one of the other. You can use both, but it does get tricky. Use the documentation from the website, as it has great detail on the different modules.

If you do want two IP addresses, make sure you use the IP virtual servers setup.


Old 02-10-2004, 03:39 PM   #4
Registered: Jan 2002
Location: Dallas, TX
Distribution: RedHat 7.0 - Kernel 2.4.17
Posts: 95

Original Poster
Rep: Reputation: 16
Thumbs up This worked like a charm!

my httpd.conf looks something like this:

NameVirtualHost X.X.X.1
NameVirtualHost X.X.X.2

<VirtualHost X.X.X.1>
DocumentRoot /DIR1/DIR1
ErrorLog /DIR1/DIR1/error_log
CustomLog /DIR1/DIR1/access_log common

<VirtualHost X.X.X.2>
DocumentRoot /DIR2/DIR2
ErrorLog /DIR2/DIR2/error_log
CustomLog /DIR2/DIR2/access_log common

Remember this is IP based, not named base. Works fast and good...... hope this helps others.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
making webpages ZaphyR Linux - Software 2 08-24-2004 10:18 AM
webpages like e107 linuxtesting2 Linux - Software 2 06-09-2004 12:57 PM
no midi on webpages bobterri Linux - Software 5 10-22-2003 11:44 PM
no webpages SMACK Linux - General 5 09-30-2003 12:07 AM
Cannot view webpages CragStar Linux From Scratch 2 04-28-2002 04:51 PM

All times are GMT -5. The time now is 09:57 PM.

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