Uiy
Uiy

Reputation: 165

Multiple urls to single host with port mapping?

When one registers a url with a dns registrar can they include port mapping to the host computer?

www.myurl1.com myip:80 www.myurl2.com myip:81

Basically can one map several urls to the same host computer using port 80 as seen from the outside(so one doesn't have to do www.myurl2.com:81)?

Upvotes: 0

Views: 1445

Answers (1)

Matt Burgess
Matt Burgess

Reputation: 21

You can add Virtual Hosts to your webs-servers conf file. Just have your dns registrar point all your domains to the same IP# port :80 and the web-server will do the rest.

See http://httpd.apache.org/docs/2.0/vhosts/

Apache httpd.conf example:

NameVirtualHost *:80

<VirtualHost *:80>
   DocumentRoot "/var/www/myurl1.com/"
   ServerName myurl1.com
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot "/var/www/myurl1.com/"
   ServerName myurl2.com
</VirtualHost>

Nginx - See http://wiki.nginx.org/ServerBlockExample

Upvotes: 2

Related Questions