This article describes how to configure Apache multi-port and multi-site. If you need it, we recommend that you take a look. If you have two domain names, which are pai.linuxdown.com and tool.linuxdown.com, You need to bind both domain names
The IP address is on the server 219.13.34.32.
1. First, you must specify the correspondence between the domain name and IP address on the domain name supplier management page.
2. Configure the LAMP environment on the WEB Server
3. Put the corresponding source code in the/usr/local/apache/htdocs directory and name them upload and upload2 respectively.
4. Configure apache
# Vi httpd. conf
Change
ServerName 219.13.34.32: 80
Add the following content to the file:
NameVirtualHost 219.13.34.32
ServerAdmin afd@dsf.com
DocumentRoot/usr/local/apache/htdocs
ServerName 219.13.34.32
ServerAdmin dsf@af.com
DocumentRoot/usr/local/apache/htdocs/upload
ServerName pai.linuxdown.com
ServerAdmin adf@fda.com
DocumentRoot/usr/local/apache/htdocs/upload2
ServerName tool.linuxdown.com
Among them: NameVirtualHost 219.13.34.32 is very important. Without this, the virtual host cannot be established successfully.
Here, two virtual hosts with the domain names of desk.linuxdown.com and tool.linuxdown.com are created.
The/usr/local/apache/htdocs directory is the page directory set when the IP address is entered directly. The other two are the input fields.
The directory to be accessed.
Restart the apache service and enter
Http://desk.linuxdown.com and http://tool.linuxdown.com
You can access different websites.