Install apache in the source code, skip this step: first enable the VM function [root @ localhost ~] # Vim/usr/local/apache2/conf/httpd. conf find this line, remove the # comment above (different versions may not be in this line) 460 # Includeconf/extra/httpd-vhosts.conf 2: modify the web page path of the VM configuration file in/usr/local/apache2/co
Install apache using the source code. skip this step.
I. first, enable the VM function.
[Root @ localhost ~] # Vim/usr/local/apache2/conf/httpd. conf
Locate this line and remove the # Comment (different versions may not be in this line)
460 # Include conf/extra/httpd-vhosts.conf
II. modify the VM configuration file
The webpage path is under/usr/local/apache2/conf/htdocs.
Create 2 websites
Create the root directory of the two websites
Mkdir/usr/local/apache2/htdocs/1 2
Echo "woshi 1">/usr/local/apache2/htdocs/1/index.html
Echo "woshi 2">/usr/local/apache2/htdocs/2/index.html
Modify the VM configuration file
[Root @ localhost ~] # Vim/usr/local/apache2/conf/extra/httpd-vhosts.conf