Tag Archives: httpd.conf

About the Ubuntu configuration file apache2 httpd.conf position

About the Ubuntu configuration file, strictly speaking, Apache in Ubuntu (or Apache under Linux?I don’t know what the configuration file is for other distributions of Apache

/Etc/apache2/apache2. Conf, Apache will automatically read the configuration information of this file at startup. Other configuration files, such as httpd.conf And so on are included through the include instruction. These include lines can be found in apache2.conf

Citation

# Include module configuration:

Include /etc/apache2/mods-enabled/*.load

Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:

Include /etc/apache2/ httpd.conf

# Include ports listing

Include /etc/apache2/ ports.conf

……

# Include generic snippets of statements

Include /etc/apache2/conf.d/

# Include the virtual host configurations:

Include /etc/apache2/sites-enabled/

Combined with the comments, you can clearly see the general function of each configuration file. Of course, you can put all the settings in apache2. Conf or httpd.conf Or any configuration file. Apache 2’s division is just a good habit.

The most important thing after installing Apache is to know where the root directory of Web documents is. For Ubuntu, the default is/var/www. How do you know?There is no DocumentRoot item in apache2. Conf, httpd.conf It’s empty again, so it must be in other files. After searching, we found that

/Etc/apache2/sites enabled/000 default

Citation

NameVirtualHost *

<VirtualHost *&>

ServerAdmin webmaster

@localhost

DocumentRoot /var/www/