I registered a number of domain names, the server is deployed in Apache running multiple PHP projects, you can use multiple domain names are bound? How to bind?
Reply content:
I registered a number of domain names, the server is deployed in Apache running multiple PHP projects, you can use multiple domain names are bound? How to bind?
OK. You can use VirtualHost.
Your domain first uses a record to resolve all the IP of the server
Edit http-vhost.conf Configuration
DocumentRoot "D:/UPUPW_AP5.5/vhosts/hospital.com/web" ServerName hospital.com:80 ServerAlias ServerAdmin webmaster@hospital.com DirectoryIndex index.html index.htm index.php default.php app.php u.php ErrorLog logs/hospital.com-error.log CustomLog logs/hospital.com-access_%Y%m%d.log comonvhost
Options FollowSymLinks AllowOverride All Require all granted
Require all denied
Require all denied
//D:/UPUPW_AP5.5/vhosts/hospital.com/web WEB目录//ServerName hospital.com:80 绑定的域名
Configured apache
VirtualHost
, take my project as an example:
Locate the server httpd.conf
, and then configure the following:
ServerName admin.example.com ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ErrorLog logs/admin.example.com-error_log CustomLog logs/admin.example.com-access_log common
ServerName www.demo.com ProxyPass / http://localhost:8081/ ProxyPassReverse / http://localhost:8081/ ErrorLog logs/demo.com-error_log CustomLog logs/demo.com-access_log common
The above configuration is to let the apache
listening 80 port, also is the default port, and then when admin.example.com
the user accesses, the request is distributed to the 8080
port application. When the user accesses www.demo.com
, the request is distributed to the 8081
port. Of course, how many programs you need to configure VirtualHost
. If you do not understand, you can search apache端口转发
, many tutorials oh.