The main configuration file of Apache is /etc/httpd/conf/httpd.conf; all the configuration information of the Apache server is stored in the main configuration file httpd.conf. The contents of this file There are a lot of them. According to the wc command, there are 1009 lines in total, most of which are comment lines starting with #.
[root@justin ~]# wc -l /etc/httpd/conf/httpd.conf 1009 /etc/httpd/conf/httpd.conf [root@justin ~]#
The configuration file consists of three parts:
[root@justin ~]# grep '\<Section\>' /etc/httpd/conf/httpd.conf -n 33:### Section 1: Global Environment 245:### Section 2: 'Main' server configuration 973:### Section 3: Virtual Hosts [root@justin ~]#
Analysis:
1), Global Environment---Global environment configuration, determines the global parameters of the Apache server
2), Main server configuration---main service configuration, which is equivalent to the default Web site in Apache. If there is only one site in our server, then we only need to configure it here.
3), Virtual Hosts---virtual host, the virtual host cannot coexist with the Main Server. When the virtual host is enabled, the Main Server cannot be used
The above is the detailed content of What is the main configuration file of apache. For more information, please follow other related articles on the PHP Chinese website!