The Apache virtual host configuration process has three kinds: ip-based, port based, domain based
This is done on the Red Hat 5.8 system, first mount the CD, configure the Yum library, install the development environment
Mkdir/mnt/cdrom
Mount/dev/cdrom/mnt/cdrom
Vim/etc/yum.reps.d/server.repo
[Base]
Name=server
Baseurl=file:///mnt/cdrom/server
Enabled=1
Gpgcheck=0
Yum Groupinstall "Development Libraries" –y (generally to install two, but Development tools are installed by default, so here only need to install one on it)
Install HTTPD Package
Yum List all | grep httpd
Prepare for work: To determine if SELinux is turned off before starting, to cancel the central host
1. Close SELinux
Setenforce 0
See if closing
Getenforce
2, cancel the center host
Vim/etc/httpd/conf/httpd.conf
3, edit a new configuration file, management is also more convenient, we first do an ip-based virtual host
Vim/etc/httpd/conf.d/virtual.conf
4, new two directories, and in their respective directories to create a new document, and edit