Trích:
Nguyên văn bởi fcgoogle
theo mình thì chỉ có cách 1 web 1 port khác nhau ,10 tên miền vô 1 ip thì cũng như 1 tên miền 1ip thôi nhưng nhiều port 
|
Chỉnh sửa tí nha, mình có nghiên cứu thêm thì việc trỏ 10 tên miền vô 1 ip tĩnh cũng không gì khó nha thớt

Cách thức trỏ này cũng tùy vào thớt xài web server gì nữa , trên firewall thì chỉ nat port 80 thôi , còn bên trong server ví dụ xampp thì chỉnh file /XAMPP/apache/conf/extra/httpd-vhosts.conf
Web1
<VirtualHost *:80>
ServerAdmin
webmaster@website01.com
DocumentRoot
"/XAMPP/HTDOCS/website1"
ServerName
website01.com
ServerAlias
www.website_01.com
ErrorLog "logs/website01.com-error.log"
CustomLog "logs/website01.com-access.log" common
<Directory "/XAMPP/HTDOCS/website1">
Options FollowSymLinks
AllowOverride All
DirectoryIndex index.php
Require all granted
</Directory>
</VirtualHost>
Web 2
<VirtualHost *:80>
ServerAdmin
webmaster@website02.com
DocumentRoot
"/XAMPP/HTDOCS/website2"
ServerName
website02.com
ServerAlias
www.website02.com
ErrorLog "logs/website02.com-error.log"
CustomLog "logs/website02.com-access.log" common
<Directory "/XAMPP/HTDOCS/website2">
Options FollowSymLinks
AllowOverride All
DirectoryIndex index.php
Require all granted
</Directory>
</VirtualHost>
Thêm nữa là vào file host trong etc ấy chỉnh thêm
127.0.0.1 website01.com
127.0.0.1 website02.com
IIS thì làm cũng tương tự nhưng khi tạo website mới thì có phần khai báo domain ấy thì ghi website01.com or website02.com vào