Apache (based on IP address)

1.Apache installation

  (1) first with the command "cat / etc / passwd | grep apache", there is to see there is no Apache

    ① If you have Apache, we will not need to install

      

    ② If not, we will install about

  (2) using the command "yum install httpd", install Apache

    

 

     

    

 

 2. Use the command nmtui add multiple addresses for the network card

  (1) nmtui open the card with the command

    

 

     

 

   (2) Add 3 URL: 192.168.8.1/24,192.168.8.2/24,192.168.8.3.24

     

 

     Click "OK"

    

 

   (3) After get that done, we restart the network card (disabled reactivation look

        

 

   (4) Use the ping command to check the correct

    

 

 3. Create a site data directory, respectively,

  (1) website data to create three directories under / home / wwwroot directory, respectively

    

 

   (2) Home files are written in three sites data directory content to IP addresses

    

 

   (3) using the cat command to check whether correct

    

 

 4. In the configuration described in the document based on the virtual host IP address

  (1) Enter the command "vi /etc/httpd/conf/httpd.conf", open the configuration file

   

 

 5. Restart http service, open a browser to access each page three

  (1) access 192.168.8.1

    

  (2) access 192.168.8.2

    

  (3) access 192.168.8.3

     

 

 

 

    

 

 

Guess you like

Origin www.cnblogs.com/meng-yu37/p/11921680.html