Build a simple website

1, check the environment

getenforce # View selinux running state 
 setenforce 0 # temporary closure selinux

  

Vim / etc / selinux / config     # Edit profile selinux 
 to = the SELINUX enforcing to 
 the SELINUX = Disabled            # permanently closed

 

2, source disposed yum

     mkdir / iso # create the mount point
     mount / dev / cdrom / iso # mount the CD to the mount point
     ls / iso # to see mount successful
     cd /etc/yum.repos.d/ # yum into the source directory
     rm -fr * .repo # delete official source
     vim iso.repo # edit your source files

 [iso]                  
 name=iso        
 baseurl=file:///iso   
 enabled=1 
 gpgcheck=0 

      yum yum clean all # Clear cache source
3, installation services

   yum -y install httpd # install httpd service
   rm -rf /etc/httpd/conf.d/welcome.conf # delete the welcome page
4, start the service

   systemctl start httpd # start httpd
   systemctl enable httpd httpd # Set boot

5, add firewall ports

--add-Port-cmd Firewall = 80 / TCP        # temporarily add 

 Firewall -cmd --add-Port = 80 / TCP --permanent    # permanently added

       ip a view native ip

6, edit home

echo " success " > /var/www/html/index.html

7. Verify

      Browser access ip

Guess you like

Origin www.cnblogs.com/t-ym/p/11617335.html