Nhờ tư vấn - Hỏi về lỗi khi trỏ tên miền về VPS window | VN-Zoom | Cộng đồng Chia Sẻ Kiến Thức Công Nghệ và Phần Mềm Máy Tính

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We need money to operate the site, and almost all of it comes from our online advertising.

If possible, please support us by clicking on the advertisements.

Please add vn-z.vn to your ad blocking whitelist or disable your adblocking software.

×

Nhờ tư vấn Hỏi về lỗi khi trỏ tên miền về VPS window

sport9x

Búa Gỗ
Mình muốn chạy nhiều website trên 1 vps window Azure, các website có nội dung khác nhau
web1.com
web2.com
web3.com
Mình dùng IIS có sẵn của window để chạy, đã trỏ các domain về ip VPS
Vấn đề mình gặp phải là website chỉ chạy khi mình lưu source code ở thư mục C:\inetpub\wwwroot
Khi mình lưu ở các chỗ khác như ổ D:\web1, D:\web2, D:\web3 thì không nhận mà chỉ nhận source code ở thư mục C:\inetpub\wwwroot
Vậy nên cả 3 web đều bị nội dung giống nhau
Mình mày mò mấy ngày nay mà không được. Cảm ơn mọi người nhé
 

anhtuanpham87

Rìu Bạc
Trong IIS, bạn chọn mục Website, chọn New rồi chọn Virtual Directory. Nó sẽ hỏi bạn nhập Alias, đấy là tên truy cập cho website mới của bạn, rồi tiếp theo sẽ hỏi thư mục chứa website đó. Thế là bạn đã tạo được một website mới trên một server. GIả sử bạn cấu hình Alias là MyWebsite1, khi đó để truy nhập đến website: http://servername/MyWebsite1 (Trong đó servername có thể là tên miền của server, hoặc địa chỉ của server, hoặc là localhost)
 

anhtuanpham87

Rìu Bạc
Search tiếp ra cách này
1. Mỗi website trên Server sử dụng 1 địa chỉ IP khác nhau (nhiều NIC)
2. Các website sử dụng Port khác nhau
3. Nếu sử dụng cùng 1 địa chỉ IP thì phải add các Host hearder value khác nhau.

IIS 6 using host header with one IP (nhiều website, nhiều domain cho một IP)

On the left side, expand your computer name, then click "Web Sites", right click in the right side, put your mouse over "New" and select "Web Site..."

new-web-site.png


Click Next in the dialog, then put in a description of the new web site you are creating (can be anything)

web-description.png


Now here's the important part. Go to the last text box and put in what you want the new Host Header to be

setup-header.png


Now put in the path to your new site and make sure you keep "Allow anonymous access" checked

web-home.png


For added security, if you don't plan on using ASP or anything similar, then uncheck "Run scripts". You can always enable it at another time


Trên đây là cách config IIS sử dụng Host header để ghép nhiều site, nhiều domain vào một IP.

Nếu bạn muốn Setup nhiều site và mỗi site tương ứng với một IP, hay nhiều site trên một domain nhưng mỗi site tương ứng với một port thì bạn quay trở lại hình 4 từ trên xuống. Bạn lưu ý phần: Enter the IP address to use for this website và phần TCP port this website should use.

Chúc bạn thành công
 


Top