larry718
asked on
virtual host - 1 static ip
Hi Experts,
I have apache 1.3.20, 1 static IP, 1 SMC Router, 5 servers (2-Redhat7.1, win98, winNT, win2k) and 10+ domain names (Domain1.com, Domain2.com & Domain3.com...)
Currently, I figure out how to set up a virtualhost to use apache to serve all the domains on 1 server. What I really want to do is set up 1 Redhat7.1 Linux server to take care of the virtualhosting and redirect the request for the domain to the proper server.
SMC Router points Static IP of Port 80 to the Main Redhat 7.1 Linux. So I would like my intranet architecture to be like this:
-Main RH7.1 Linux Server running Apache = domain1.com, domain2.com
-Rh7.1 Linux Server running Apache = domain3.com, domain4.com
-Win98 running Personal WebServer = domain5.com domain6.com
-WinNT running IIS4 = domain7.com, domain8.com
-Win2k running Apache Web Server = domain9.com, domain10.com
Thanks in advance for any assistance.
I have apache 1.3.20, 1 static IP, 1 SMC Router, 5 servers (2-Redhat7.1, win98, winNT, win2k) and 10+ domain names (Domain1.com, Domain2.com & Domain3.com...)
Currently, I figure out how to set up a virtualhost to use apache to serve all the domains on 1 server. What I really want to do is set up 1 Redhat7.1 Linux server to take care of the virtualhosting and redirect the request for the domain to the proper server.
SMC Router points Static IP of Port 80 to the Main Redhat 7.1 Linux. So I would like my intranet architecture to be like this:
-Main RH7.1 Linux Server running Apache = domain1.com, domain2.com
-Rh7.1 Linux Server running Apache = domain3.com, domain4.com
-Win98 running Personal WebServer = domain5.com domain6.com
-WinNT running IIS4 = domain7.com, domain8.com
-Win2k running Apache Web Server = domain9.com, domain10.com
Thanks in advance for any assistance.
ASKER
I am a newbie at apache. ahoffmann, I've tried this but can't get it to work. Can you elaborate?
ASKER
I am a newbie at apache. ahoffmann, I've tried this but can't get it to work. Can you elaborate?
larry718,
You have one static IP, and what happened to the rest of the machine - how do to connect to each other. I presume that they all are on the private IP range. Perhaps the 192.168.x.x subnets. And the machine that has apache running will be on both network public and private?
If this is the setup, what you could do it that, you need to get the DNS properly configured for the public internet - register the www.domain(1..9).com to point to your ONLY static IP. and on that machine, you need to run apache with virtual hosting enable. Configure the apache to virtual-host all the domain(1..9).com, and for each vhost, cache it from the internal server.
Look at the config below. I believe it should work.
----- excerpt from httpd.conf
#
#NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
# ServerAdmin webmaster@dummy-host.examp le.com
# DocumentRoot /www/docs/dummy-host.examp le.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.co m-error_lo g
# CustomLog logs/dummy-host.example.co m-access_l og common
#</VirtualHost>
NameVirtualHost 1.2.3.4
# This is for the server 1 which has internal Ip of 192.168.1.1
<VirtualHost 1.2.3.4>
ServerName www.domain1.com
ServerAdmin webmaster@domain1.com
DocumentRoot /usr/local/apache/htdocs-d omain1
ErrorLog logs/domain1-error_log
CustomLog logs/domain1_access_log common
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from 10.1.35.200
#
# Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://192.168.1.1
ProxyPassReverse / http://192.168.1.1
</IfModule>
</VirtualHost>
# This is for the server 2 which has internal Ip of 192.168.1.2
<VirtualHost 1.2.3.4>
ServerName www.domain2.com
ServerAdmin webmaster@domain2.com
DocumentRoot /usr/local/apache/htdocs-d omain2
ErrorLog logs/domain2-error_log
CustomLog logs/domain2_access_log common
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from 10.1.35.200
#
# Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://192.168.1.2
ProxyPassReverse / http://192.168.1.2
</IfModule>
</VirtualHost>
You have one static IP, and what happened to the rest of the machine - how do to connect to each other. I presume that they all are on the private IP range. Perhaps the 192.168.x.x subnets. And the machine that has apache running will be on both network public and private?
If this is the setup, what you could do it that, you need to get the DNS properly configured for the public internet - register the www.domain(1..9).com to point to your ONLY static IP. and on that machine, you need to run apache with virtual hosting enable. Configure the apache to virtual-host all the domain(1..9).com, and for each vhost, cache it from the internal server.
Look at the config below. I believe it should work.
----- excerpt from httpd.conf
#
#NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
# ServerAdmin webmaster@dummy-host.examp
# DocumentRoot /www/docs/dummy-host.examp
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.co
# CustomLog logs/dummy-host.example.co
#</VirtualHost>
NameVirtualHost 1.2.3.4
# This is for the server 1 which has internal Ip of 192.168.1.1
<VirtualHost 1.2.3.4>
ServerName www.domain1.com
ServerAdmin webmaster@domain1.com
DocumentRoot /usr/local/apache/htdocs-d
ErrorLog logs/domain1-error_log
CustomLog logs/domain1_access_log common
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from 10.1.35.200
#
# Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://192.168.1.1
ProxyPassReverse / http://192.168.1.1
</IfModule>
</VirtualHost>
# This is for the server 2 which has internal Ip of 192.168.1.2
<VirtualHost 1.2.3.4>
ServerName www.domain2.com
ServerAdmin webmaster@domain2.com
DocumentRoot /usr/local/apache/htdocs-d
ErrorLog logs/domain2-error_log
CustomLog logs/domain2_access_log common
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from 10.1.35.200
#
# Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://192.168.1.2
ProxyPassReverse / http://192.168.1.2
</IfModule>
</VirtualHost>
samri gave the example.
I'm just wondering about the
Allow from 10.1.35.200
Also the Cache* directives need to be adapted to your requirements.
I'm just wondering about the
Allow from 10.1.35.200
Also the Cache* directives need to be adapted to your requirements.
ASKER
Yes, I have 1 static IP that is set to hit my router which redirects it to my Main Redhat 7.1 Linux Server.
ALL of my machines reside on a private network using 192.168.xxx.xxx.
Here's the apache httpd.conf I have:
NameVirtualHost 192.168.bb.aa ===> internet static IP.
<VirtualHost 192.168.bb.aa> ===> Private network Static IP.
ServerName www.domain1.com
ServerAdmin webmaster@domain1.com
DocumentRoot /usr/local/apache/htdocs/w ww/domain1
ErrorLog /usr/local/apache/logs/www /domain1.c om-error_l og
CustomLog /usr/local/apache/logs/www /domain1.c om-access_ log common
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu
ProxyPass / http://192.168.bb.aa
ProxyPassReverse / http://192.168.bb.aa
</IfModule>
</VirtualHost>
========================== ========== ========== =======
> [root@localhost bin]# pwd
/usr/local/apache/bin
[root@localhost bin]# ./apachectl configtest
[Mon Sep 3 22:05:03 2001] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK
[root@localhost bin]# ./apachectl startssl
[Mon Sep 3 22:05:16 2001] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
./apachectl startssl: httpd could not be started
[root@localhost bin]#
========================== ========== ========== =======
Can't get this one to work so I didn't add more VirtualHosts to it.
Goosh, I am reading up on this proxy stuff. It sure is alot of material to understand.
ALL of my machines reside on a private network using 192.168.xxx.xxx.
Here's the apache httpd.conf I have:
NameVirtualHost 192.168.bb.aa ===> internet static IP.
<VirtualHost 192.168.bb.aa> ===> Private network Static IP.
ServerName www.domain1.com
ServerAdmin webmaster@domain1.com
DocumentRoot /usr/local/apache/htdocs/w
ErrorLog /usr/local/apache/logs/www
CustomLog /usr/local/apache/logs/www
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu
ProxyPass / http://192.168.bb.aa
ProxyPassReverse / http://192.168.bb.aa
</IfModule>
</VirtualHost>
==========================
> [root@localhost bin]# pwd
/usr/local/apache/bin
[root@localhost bin]# ./apachectl configtest
[Mon Sep 3 22:05:03 2001] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK
[root@localhost bin]# ./apachectl startssl
[Mon Sep 3 22:05:16 2001] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
./apachectl startssl: httpd could not be started
[root@localhost bin]#
==========================
Can't get this one to work so I didn't add more VirtualHosts to it.
Goosh, I am reading up on this proxy stuff. It sure is alot of material to understand.
ASKER
Also I am wonderring about
Ahoffman's comment, what's Allow from 10.1.35.200?
Ahoffman's comment, what's Allow from 10.1.35.200?
ASKER
Also I am wonderring about
Ahoffman's comment, what's Allow from 10.1.35.200?
Ahoffman's comment, what's Allow from 10.1.35.200?
Pretty sure the problem lies here
"VirtualHost 192.168.bb.aa"
That needs to be a name (i.e. www.blah.com), IIRC, if you want apache to use name-based virtual hosts.
Just add www.blah.com to /etc/hosts with the proper internal IP and you should be good to go.
-Jon
"VirtualHost 192.168.bb.aa"
That needs to be a name (i.e. www.blah.com), IIRC, if you want apache to use name-based virtual hosts.
Just add www.blah.com to /etc/hosts with the proper internal IP and you should be good to go.
-Jon
ASKER
Hi,
Jon: your suggestion, I have implemented, I've in httpd.conf:
NameVirtualHost 192.aaa.bbb.ccc
NameVirtualHost 192.aaa.bbb.ddd
<VirtualHost www.domain111.com>
ServerName www.domain111.com
ServerAdmin webmaster@domain111.com
DocumentRoot /usr/local/apache/htdocs/w ww/domain1 11
ErrorLog /usr/local/apache/htdocs/w ww/logs/do main111.co m-error_lo g
CustomLog /usr/local/apache/htdocs/w ww/logs/do main111.co m-access_l og common
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
NoCache a_domain.com another_domain.edu
ProxyPass / http://192.aaa.bbb.ccc
ProxyPassReverse / http://192.aaa.bbb.ccc
</IfModule>
</VirtualHost>
<VirtualHost www.domain222.com>
ServerName www.domain222.com
ServerAdmin webmaster@domain222.com
DocumentRoot /usr/local/apache/htdocs/w ww/domain2 22
ErrorLog /usr/local/apache/htdocs/w ww/logs/do main222.co m-error_lo g
CustomLog /usr/local/apache/htdocs/w ww/logs/do main222.co m-access_l og common
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
NoCache a_domain.com another_domain.edu
ProxyPass / http://192.aaa.bbb.ddd
ProxyPassReverse / http://192.aaa.bbb.ddd
</IfModule>
</VirtualHost>
/etc/hosts file:
========================== ========== ===
#IP FQDN aliases
127.0.0.1 localhost
192.aaa.bbb.ccc www.domain111.com domain111
192.aaa.bbb.ddd www.domain222.com domain222
Output of ./apachectl configtest
========================== ========
[root@www bin]# ./apachectl configtest
Warning: DocumentRoot [/usr/local/apache/htdocs/ www/domain 222] does not exist
Syntax OK
[root@www bin]#
PINGing domain222 and its IP is good. When browse the web all I get is the index.html page from /usr/local/apache/htdocs/w ww/domain1 11 as the default, what now?
Jon: your suggestion, I have implemented, I've in httpd.conf:
NameVirtualHost 192.aaa.bbb.ccc
NameVirtualHost 192.aaa.bbb.ddd
<VirtualHost www.domain111.com>
ServerName www.domain111.com
ServerAdmin webmaster@domain111.com
DocumentRoot /usr/local/apache/htdocs/w
ErrorLog /usr/local/apache/htdocs/w
CustomLog /usr/local/apache/htdocs/w
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
NoCache a_domain.com another_domain.edu
ProxyPass / http://192.aaa.bbb.ccc
ProxyPassReverse / http://192.aaa.bbb.ccc
</IfModule>
</VirtualHost>
<VirtualHost www.domain222.com>
ServerName www.domain222.com
ServerAdmin webmaster@domain222.com
DocumentRoot /usr/local/apache/htdocs/w
ErrorLog /usr/local/apache/htdocs/w
CustomLog /usr/local/apache/htdocs/w
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
ProxyVia On
CacheRoot "/usr/local/apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
NoCache a_domain.com another_domain.edu
ProxyPass / http://192.aaa.bbb.ddd
ProxyPassReverse / http://192.aaa.bbb.ddd
</IfModule>
</VirtualHost>
/etc/hosts file:
==========================
#IP FQDN aliases
127.0.0.1 localhost
192.aaa.bbb.ccc www.domain111.com domain111
192.aaa.bbb.ddd www.domain222.com domain222
Output of ./apachectl configtest
==========================
[root@www bin]# ./apachectl configtest
Warning: DocumentRoot [/usr/local/apache/htdocs/
Syntax OK
[root@www bin]#
PINGing domain222 and its IP is good. When browse the web all I get is the index.html page from /usr/local/apache/htdocs/w
sorry... kinda lost for a while.
>Also I am wonderring about
>
> Ahoffman's comment, what's Allow from 10.1.35.200?
to allow proxy connection only from my pc (test environment).
>Also I am wonderring about
>
> Ahoffman's comment, what's Allow from 10.1.35.200?
to allow proxy connection only from my pc (test environment).
ASKER
From my understanding, I have a couple of servers and I tried this virtualnamehosting under 1 static IP. I surf the web for the answer and apparantly it may seem like an apache problem. It doesn't work. If anyone has set this up please let me know how this is possible. Thanks!
larry 718,
my initial posting is taken straight from my test box (with some modification on IP address to protect the innocent - me). I might be able to resimulate.
I'm not sure how urgent you need this. I would say give me a few days to dig my hd for RH installation. :)
I'll look it up.
my initial posting is taken straight from my test box (with some modification on IP address to protect the innocent - me). I might be able to resimulate.
I'm not sure how urgent you need this. I would say give me a few days to dig my hd for RH installation. :)
I'll look it up.
well i don't work much with linux but i do with windows apache and i have mine set up as this
Note: i have had prob with this when i set any of these vhost #1 it seems like the first vhost is the default server i donno y but it does.
NameVirtualHost * <=== Any IP Address
# server 1 is main
<VirtualHost *>
ServerAdmin Web@server1.com
DocumentRoot c:/www/serv1/www
ServerName www.server1.com
ErrorLog c:/www/serv1/logs/error.lo g
# Code Red Virus Attacks for Windows IIS 4.x - 5.x
SetEnvIf Request_URI "^/default.ida(.*)$" code_red_attacks attacks
SetEnvIf Request_URI "root\.exe(.*)$" nimda_attacks attacks
SetEnvIf Request_URI "cmd\.exe(.*)$" nimda_attacks attacks
CustomLog c:/www/serv1/logs/codered. log common env=code_red_attacks
CustomLog c:/www/serv1/logs/nimda.lo g common env=nimda_attacks
CustomLog c:/www/serv1/logs/access_l og common env=!attacks
AddType text/html .ida
AddHandler server-parsed .ida
# End of Virus Handeler
ErrorDocument 404 /error/404.html
ScriptAlias /cgi-bin/ "c:/www/serv1/cgi-bin/"
</VirtualHost>
# no need for Virus Attack redirects on the rest. it all goes to the 1st vhost (default)
<VirtualHost *>
ServerAdmin web@server2.com
DocumentRoot c:/www/serv2/www
ServerName www.server2.com
ErrorLog c:/www/serv2/logs/docerror _log
CustomLog c:/www/serv2/logs/access_l og common
ErrorDocument 404 /error/404.html
ScriptAlias /cgi-bin/ "c:/www/serv2/cgi-bin/"
</VirtualHost>
<VirtualHost *>
ServerAdmin web@server2.com
DocumentRoot c:/www/serv2/sub/pc1/www
ServerName pc1.server2.com
ErrorLog c:/www/serv2/sub/pc1/logs/ error_log
CustomLog c:/www/serv2/sub/pc1/logs/ access_log common
ErrorDocument 404 /error/404.html
ScriptAlias /cgi-bin/ "c:/www/serv2/sub/pc1/cgi- bin/"
</VirtualHost>
# thats how mine is setup and it works fine even the error pages go where they should and so does the # cgi-bin but to tell the server what can be done with the cgi-bins you gotta define them first like this
<Directory "c:/www/serv1/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "c:/www/serv2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "c:/www/serv2/sub/pc1//cgi -bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
# it allworks fine with windows 2000 but you will need to change the paths with Linux hope this helps some
Note: i have had prob with this when i set any of these vhost #1 it seems like the first vhost is the default server i donno y but it does.
NameVirtualHost * <=== Any IP Address
# server 1 is main
<VirtualHost *>
ServerAdmin Web@server1.com
DocumentRoot c:/www/serv1/www
ServerName www.server1.com
ErrorLog c:/www/serv1/logs/error.lo
# Code Red Virus Attacks for Windows IIS 4.x - 5.x
SetEnvIf Request_URI "^/default.ida(.*)$" code_red_attacks attacks
SetEnvIf Request_URI "root\.exe(.*)$" nimda_attacks attacks
SetEnvIf Request_URI "cmd\.exe(.*)$" nimda_attacks attacks
CustomLog c:/www/serv1/logs/codered.
CustomLog c:/www/serv1/logs/nimda.lo
CustomLog c:/www/serv1/logs/access_l
AddType text/html .ida
AddHandler server-parsed .ida
# End of Virus Handeler
ErrorDocument 404 /error/404.html
ScriptAlias /cgi-bin/ "c:/www/serv1/cgi-bin/"
</VirtualHost>
# no need for Virus Attack redirects on the rest. it all goes to the 1st vhost (default)
<VirtualHost *>
ServerAdmin web@server2.com
DocumentRoot c:/www/serv2/www
ServerName www.server2.com
ErrorLog c:/www/serv2/logs/docerror
CustomLog c:/www/serv2/logs/access_l
ErrorDocument 404 /error/404.html
ScriptAlias /cgi-bin/ "c:/www/serv2/cgi-bin/"
</VirtualHost>
<VirtualHost *>
ServerAdmin web@server2.com
DocumentRoot c:/www/serv2/sub/pc1/www
ServerName pc1.server2.com
ErrorLog c:/www/serv2/sub/pc1/logs/
CustomLog c:/www/serv2/sub/pc1/logs/
ErrorDocument 404 /error/404.html
ScriptAlias /cgi-bin/ "c:/www/serv2/sub/pc1/cgi-
</VirtualHost>
# thats how mine is setup and it works fine even the error pages go where they should and so does the # cgi-bin but to tell the server what can be done with the cgi-bins you gotta define them first like this
<Directory "c:/www/serv1/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "c:/www/serv2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "c:/www/serv2/sub/pc1//cgi
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
# it allworks fine with windows 2000 but you will need to change the paths with Linux hope this helps some
larry718,
What you want (to recap);
-Main RH7.1 Linux Server running Apache = domain1.com, domain2.com
-Rh7.1 Linux Server running Apache = domain3.com, domain4.com
-Win98 running Personal WebServer = domain5.com domain6.com
-WinNT running IIS4 = domain7.com, domain8.com
-Win2k running Apache Web Server = domain9.com, domain10.com
I'm not sure whether this would be a repeat of the above solution. Apology if it is, but let me simplify from scratch.
One possible solution would be,
1. Get all the domain www.domain<x>.com to point to the Rh7.1.
2. Configure VirtualHosting on Apache on Rh7.1 for each of the Sites (www.domain1.com .. www.domain10.com), makesure mod_proxy is loaded.
3. For those domain that are hosted on a different machine, create a separate VirtualHost for each website
NameVirtualHost *
<VirtualHost *>
# Your default virtual host is configured here first
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@dummy-host.examp le.com
DocumentRoot "C:/Program Files/Apache Group/Apache/Websites/What ever"
ServerName www.domain1.com
ErrorLog logs/www.domain1-error.log
CustomLog logs/ww.domain1-access.log common
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
# ProxyVia On
#
# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)
#
CacheRoot "C:/Program Files/Apache Group/Apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://yourinternal-ip-for-domain1.com/
ProxyPassReverse / http://yourinternal-ip-for-domain1.com/
</IfModule>
</VirtualHost>
Create as many VirtualHost as you need.
I hope this helps.
good luck
4. Restart Apache.
What you want (to recap);
-Main RH7.1 Linux Server running Apache = domain1.com, domain2.com
-Rh7.1 Linux Server running Apache = domain3.com, domain4.com
-Win98 running Personal WebServer = domain5.com domain6.com
-WinNT running IIS4 = domain7.com, domain8.com
-Win2k running Apache Web Server = domain9.com, domain10.com
I'm not sure whether this would be a repeat of the above solution. Apology if it is, but let me simplify from scratch.
One possible solution would be,
1. Get all the domain www.domain<x>.com to point to the Rh7.1.
2. Configure VirtualHosting on Apache on Rh7.1 for each of the Sites (www.domain1.com .. www.domain10.com), makesure mod_proxy is loaded.
3. For those domain that are hosted on a different machine, create a separate VirtualHost for each website
NameVirtualHost *
<VirtualHost *>
# Your default virtual host is configured here first
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@dummy-host.examp
DocumentRoot "C:/Program Files/Apache Group/Apache/Websites/What
ServerName www.domain1.com
ErrorLog logs/www.domain1-error.log
CustomLog logs/ww.domain1-access.log
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
# ProxyVia On
#
# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)
#
CacheRoot "C:/Program Files/Apache Group/Apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://yourinternal-ip-for-domain1.com/
ProxyPassReverse / http://yourinternal-ip-for-domain1.com/
</IfModule>
</VirtualHost>
Create as many VirtualHost as you need.
I hope this helps.
good luck
4. Restart Apache.
larry718,
What you want (to recap);
-Main RH7.1 Linux Server running Apache = domain1.com, domain2.com
-Rh7.1 Linux Server running Apache = domain3.com, domain4.com
-Win98 running Personal WebServer = domain5.com domain6.com
-WinNT running IIS4 = domain7.com, domain8.com
-Win2k running Apache Web Server = domain9.com, domain10.com
I'm not sure whether this would be a repeat of the above solution. Apology if it is, but let me simplify from scratch.
One possible solution would be,
1. Get all the domain www.domain<x>.com to point to the Rh7.1.
2. Configure VirtualHosting on Apache on Rh7.1 for each of the Sites (www.domain1.com .. www.domain10.com), makesure mod_proxy is loaded.
3. For those domain that are hosted on a different machine, create a separate VirtualHost for each website
NameVirtualHost *
<VirtualHost *>
# Your default virtual host is configured here first
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@dummy-host.examp le.com
DocumentRoot "C:/Program Files/Apache Group/Apache/Websites/What ever"
ServerName www.domain1.com
ErrorLog logs/www.domain1-error.log
CustomLog logs/ww.domain1-access.log common
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
# ProxyVia On
#
# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)
#
CacheRoot "C:/Program Files/Apache Group/Apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://yourinternal-ip-for-domain1.com/
ProxyPassReverse / http://yourinternal-ip-for-domain1.com/
</IfModule>
</VirtualHost>
Create as many VirtualHost as you need.
I hope this helps.
good luck
4. Restart Apache.
What you want (to recap);
-Main RH7.1 Linux Server running Apache = domain1.com, domain2.com
-Rh7.1 Linux Server running Apache = domain3.com, domain4.com
-Win98 running Personal WebServer = domain5.com domain6.com
-WinNT running IIS4 = domain7.com, domain8.com
-Win2k running Apache Web Server = domain9.com, domain10.com
I'm not sure whether this would be a repeat of the above solution. Apology if it is, but let me simplify from scratch.
One possible solution would be,
1. Get all the domain www.domain<x>.com to point to the Rh7.1.
2. Configure VirtualHosting on Apache on Rh7.1 for each of the Sites (www.domain1.com .. www.domain10.com), makesure mod_proxy is loaded.
3. For those domain that are hosted on a different machine, create a separate VirtualHost for each website
NameVirtualHost *
<VirtualHost *>
# Your default virtual host is configured here first
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@dummy-host.examp
DocumentRoot "C:/Program Files/Apache Group/Apache/Websites/What
ServerName www.domain1.com
ErrorLog logs/www.domain1-error.log
CustomLog logs/ww.domain1-access.log
<IfModule mod_proxy.c>
ProxyRequests On
<Directory proxy:*>
Order deny,allow
Deny from all
Allow from all
</Directory>
#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
# ProxyVia On
#
# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)
#
CacheRoot "C:/Program Files/Apache Group/Apache/proxy"
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
ProxyPass / http://yourinternal-ip-for-domain1.com/
ProxyPassReverse / http://yourinternal-ip-for-domain1.com/
</IfModule>
</VirtualHost>
Create as many VirtualHost as you need.
I hope this helps.
good luck
4. Restart Apache.
ASKER
Dear Samri,
Sorry to get back so late, had a job change. I try this setting but it doesn't work.
my current setting is:
<VirtualHost *>
ServerAdmin root@website1.com
DocumentRoot /www/www.website1.com
ServerName www.website1.com
ErrorLog logs/www.website1.com-error_log
CustomLog logs/www.website1-access_log common
</VirtualHost>
... and so on.
this works well, but not except for 1 machine.
and i must type exactly "www.website2.com" to get to website2. If i type "website2.com" it defaults to website1.
any new insight into this problem, experts?
Sorry to get back so late, had a job change. I try this setting but it doesn't work.
my current setting is:
<VirtualHost *>
ServerAdmin root@website1.com
DocumentRoot /www/www.website1.com
ServerName www.website1.com
ErrorLog logs/www.website1.com-error_log
CustomLog logs/www.website1-access_log common
</VirtualHost>
... and so on.
this works well, but not except for 1 machine.
and i must type exactly "www.website2.com" to get to website2. If i type "website2.com" it defaults to website1.
any new insight into this problem, experts?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
PorxyPass /someDir http://host.domain1.com/someOtherDir
PorxyPassReverse /someDir http://host.domain1.com/someOtherDir
# never tested this, but should work ;-)