Mayuyu today to install Apache and learn how to use it. Well, don't talk much, next install Apache.
(1) Apache installation and start-up
In the CentOS environment, use the following command to install Apache directly
After the installation is complete, you can use the following command to turn on Apache and turn off Apache services
(2) Apache server configuration
Next look at the Apache configuration file, under directory /etc/httpd/conf , configure the main content to have
1. Global variables
2. Configure the primary server
3. Configure the Virtual host
Because there are too many configuration items, just say a few important ones.
serverroot "/etc/httpd" sets the root directory of the server, which specifies the root directory where Apache's configuration files and log files are stored.
Timeout time-out setting.
Listen 12.34.56.78:80 sets the address binding.
In short, there are two important directories in Apache
(1) configuration directory/ETC/HTTPD
Configure the path to the project in the file welcome.conf of the directory/ETC/HTTPD/CONF.D, as
(2) Document catalogue/var/www
This directory is used to store the project by loading it in the welcome.conf above.
Linux Environment Apache Installation