The installation and configuration of linux website service Apache

  • 2020-05-10 23:24:17
  • OfStack

This article introduces the installation and configuration methods of linux website service apache, including mounting the CD, installing http service, managing httpd service and httpd configuration files. Details can be found below.

1. Mount the CD

I am used to mounting the CD in the /media/cdrom directory, which is the default directory 1 when doing the local yum source


[root@localhost /]# mount /dev/cdrom /media/cdrom/

2. Install httpd service (if the local yum source is already set up, do this step directly, if not, you need to set up, as mentioned in the previous article)


[root@localhost Packages]# yum install httpd -y

3. Manage httpd services


[root@localhost Packages]# systemctl start httpd.service  # Start the 
[root@localhost Packages]# systemctl stop httpd.service  # Shut down 
[root@localhost Packages]# systemctl restart httpd.service  # restart 
[root@localhost Packages]# systemctl status httpd.service  # View running status 
[root@localhost Packages]# systemctl enable httpd.service  # Set to boot from   (does not affect the current status) 
[root@localhost Packages]# systemctl disable httpd.service  # Set to startup (does not affect the current state) 

4.httpd configuration file /etc/httpd/conf httpd.conf file


Related articles: