This article is used as a working record and needs to be referenced by a friend.
CENTOS7 Installation lamp Environment Tutorial Http://www.osyunwei.com/archives/7882.html
After the installation is complete, you need to configure multiple project deployments for multiple virtual host users.
Vi/etc/httpd/conf/httpd.conf
Edit the DocumentRoot directory address can be used to specify their own convenience, where I specify the habits of their own. Do not define to the user directory (root), otherwise there may be insufficient access rights.
Web site Virtual Home directory/var/web/
DocumentRoot "/var/web/"
Append at the end of the current configuration file
#include vhostnamevirtualhost *:80include "vhost/*.conf"
To explain, namevirtualhost *:80 means that all the domains configured by the virtual host are turned on for listening on 80 ports
Include "vhost/*.conf" means to introduce the current Apache directory under the vhost of all the suffixes named conf (where we later add their own multiple project sites, a project a file easy to manage)
mkdir/etc/httpd/vhost/
Create a virtual host configuration directory. Write a copy of the virtual host configuration file
Vi/etc/httpd/vhost/ceshi.conf
The following content is written in the configuration file, and the direct assignment replaces the primary name with the added item.
<virtualhost *:80> ServerName ceshi documentroot "/var/web/ceshi/wwwroot" Serveralias www.ceshi88.com Er Rorlog "/var/web/ceshi/log/error.log" Customlog "/var/web/ceshi/log/access.log" common</virtualhost>
Serveralias can be followed by multiple domain names for binding.
The bottom one is the error log, and one is the run log.
Make sure that all occurrences of the directory in this article are present and case-sensitive, otherwise 403 error, 404 error will occur. Apache welcome is also normal but unable to point to the site directory situation.
CentOS solves Apache configuration virtual host problem. The Apache Welcome page can be opened, but the site directory is not located