bz 发帖数: 1770 | 1 if there is a server at 1.2.3.4 listening on port 80, is it possible to
redirect user to different directories based on the user's inputs? e.g. if
user types http://www.xyz.com, then pages under /var/www/html/xyz get loaded. if user types http://www.123.com, then pages under /var/www/html/123 get loaded?
Thanks |
g********g 发帖数: 2172 | 2 Yes, you can host many sites/domains on one IP address.
【在 bz 的大作中提到】 : if there is a server at 1.2.3.4 listening on port 80, is it possible to : redirect user to different directories based on the user's inputs? e.g. if : user types http://www.xyz.com, then pages under /var/www/html/xyz get loaded. if user types http://www.123.com, then pages under /var/www/html/123 get loaded? : Thanks
|
bz 发帖数: 1770 | 3 but need to be on different ports? I dont want to see
http://1.2.3.4:8888 for www.xyz.com and http://1.2.3.4:7777 for www.123.com.
web forwarding seems not working well with china. ok in usa though.
if
【在 g********g 的大作中提到】 : Yes, you can host many sites/domains on one IP address.
|
D******y 发帖数: 3780 | 4 they can be on port 80 at same time as long as they have different host/
domain entry.
google apache virtual server
【在 bz 的大作中提到】 : but need to be on different ports? I dont want to see : http://1.2.3.4:8888 for www.xyz.com and http://1.2.3.4:7777 for www.123.com. : web forwarding seems not working well with china. ok in usa though. : : if
|
I*****y 发帖数: 6402 | 5 this can be done by setting up virtual host in your httpd.conf file.
【在 bz 的大作中提到】 : if there is a server at 1.2.3.4 listening on port 80, is it possible to : redirect user to different directories based on the user's inputs? e.g. if : user types http://www.xyz.com, then pages under /var/www/html/xyz get loaded. if user types http://www.123.com, then pages under /var/www/html/123 get loaded? : Thanks
|
bz 发帖数: 1770 | 6 could you give samples for http://www.xyz.com and http://www.123.com
my httpd.conf looks like
Listen 80
NameVirtualHost *:80
ServerAdmin w*******[email protected]
DocumentRoot /var/www/html/xyz
ServerName http://www.xyz.com
ErrorLog logs/xyz.com-error_log
CustomLog logs/xyz.com-access_log common
ServerAdmin w*******[email protected]
DocumentRoot /var/www/html/123
ServerName http://www.123.com
ErrorLog logs/123.com-error_log
【在 I*****y 的大作中提到】 : this can be done by setting up virtual host in your httpd.conf file.
|
D******y 发帖数: 3780 | 7 try remove http:// from ServerName value
【在 bz 的大作中提到】 : could you give samples for http://www.xyz.com and http://www.123.com : my httpd.conf looks like : Listen 80 : NameVirtualHost *:80 : : ServerAdmin w*******[email protected] : DocumentRoot /var/www/html/xyz : ServerName http://www.xyz.com : ErrorLog logs/xyz.com-error_log : CustomLog logs/xyz.com-access_log common
|
L*1 发帖数: 11537 | 8 1. take out the http:// as suggested above
2. If you just host two domains, one is already configured as main server,
then you do not need to repeat in virtual host.
3. Make sure the domains resolve to the IP of your server.
【在 bz 的大作中提到】 : could you give samples for http://www.xyz.com and http://www.123.com : my httpd.conf looks like : Listen 80 : NameVirtualHost *:80 : : ServerAdmin w*******[email protected] : DocumentRoot /var/www/html/xyz : ServerName http://www.xyz.com : ErrorLog logs/xyz.com-error_log : CustomLog logs/xyz.com-access_log common
|