How to install and configure Apache for linux website service
1. Attach a cd
I am used to attaching the disc to the/media/cdrom directory. This directory is one of the default directories when the local yum source is used.
[Root @ localhost/] # mount/dev/cdrom/media/cdrom/
2. Install the httpd service (if the local yum source has been set up, you can directly perform this step. If not, you need to set up the yum source. The previous article mentioned how to set up the yum source)
[Root @ localhost Packages] # yum install httpd-y
3. Manage httpd services
[Root @ localhost Packages] # systemctl start httpd. service # start
[Root @ localhost Packages] # systemctl stop httpd. service # Close
[Root @ localhost Packages] # systemctl restart httpd. service # restart
[Root @ localhost Packages] # systemctl status httpd. service # view the running status
[Root @ localhost Packages] # systemctl enable httpd. service # Set it to auto-start upon startup (it does not affect the current status)
[Root @ localhost Packages] # systemctl disable httpd. service # Set it to disabled upon startup (it does not affect the current status)
4. httpd. conf file in the configuration file/etc/httpd/conf of httpd