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 |
The topic you want to study up on is called "virtual hosting." You'll find docs on this on apache's web site.
|
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 |
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. |
All times are GMT -5. The time now is 06:26 AM. |