LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-05-2004, 10:04 AM   #1
jimval7
Member
 
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.


Hello,

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:

www.website1.com --> x.x.x.1

www.website2.com --> x.x.x.2

Please let me know... Thanks, Jim
 
Old 02-05-2004, 10:21 AM   #2
fragglehorn
Member
 
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, 11:33 AM   #3
jazernorth
Member
 
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 www.apache.org 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.

Enjoy.

JN
 
Old 02-10-2004, 02:39 PM   #4
jimval7
Member
 
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>
ServerName www.domain1.com
ServerAdmin someone@domain1.com
DocumentRoot /DIR1/DIR1
ErrorLog /DIR1/DIR1/error_log
CustomLog /DIR1/DIR1/access_log common
</VirtualHost>

<VirtualHost X.X.X.2>
ServerName www.domain2.com
ServerAdmin someone@domain2.com
DocumentRoot /DIR2/DIR2
ErrorLog /DIR2/DIR2/error_log
CustomLog /DIR2/DIR2/access_log common
</VirtualHost>

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


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


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


All times are GMT -5. The time now is 11:24 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration