We know that many webmasters put N sites on one server, so we must bind one server to multiple domain names. Let me introduce them below.
Open http. conf
1. Change ServerName 127.0.0.1 to ServerName 72.167.11.30.
2, # modify NameVirtualHost * to "NameVirtualHost 72.167.11.30"
3. There is a VM format at the end of the file,
| The Code is as follows: |
Copy code |
# <VirtualHost *>
# ServerAdmin [email] admin@minidx.com [/email]
# DocumentRoot/www/httpd/html/minidx.com
# ServerName minidx.com
# ErrorLog logs/minidx.com-error_log
# CustomLog logs/minidx.com-access_log common
# </VirtualHost> |
Simple addition:
| The Code is as follows: |
Copy code |
|
<VirtualHost *. 80>
DocumentRoot usr/local/www/
ServerName Domain Name
</VirtualHost>
<VirtualHost *. 80>
DocumentRoot usr/local/www/minidx.com/
ServerName Domain Name
</VirtualHost> |
I found that something called "ServerAlias" can be used.
| The Code is as follows: |
Copy code |
<VirtualHost *. 80>
ServerName Domain Name
ServerAlias domain name 1 domain name 2
DocumentRoot "/www/o135 /"
</VirtualHost> |
If you want to bind multiple domain names to a website, we can use a space in the middle of "ServerAlias domain name 1 domain name 2.