Get the App
SLTechnology News&Howtos  ›  Development  › 

How to configure Apache2 easily

Shulou Source: shulou.com Published: 2022-06-03 06:21:08 11月16日 Update

In this issue, the editor will bring you about the simple configuration of Apache2. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

The ordinary apache distribution configuration file is: the main configuration file of the httpd.conf,Ubuntu distribution is the apache2.conf,conf.d directory, and the included configuration files will also affect the global situation. Other packages may add files and symbolic links to it if they need to use apache to serve it.

Apache2 installation instruction

After the sudoapt-getinstallapache2 installation is complete:

The resulting start and stop files are: / etc/init.d/apache2

Launch: sudoapache2start

Stop: sudoapache2stop

Restart: sudoapache2restart

The configuration file is saved in the / etc/apache2 directory

Envvars file, in which there is the setting httpd.conf file of apache's environment variables, which used to be used as the main configuration file of apache, named after the httpd service process, and can now be used to do some user-specific configuration.

The mods-avaliable directory, which contains configuration and load files for available modules, and statements such as LoadModule***_modulemodules/mod_***.so in the httpd.conf file under windows to load additional modules, but not all modules have their configuration files

The following files are referenced in apache2.conf:

# configuration including dynamic modules: Include/etc/apache2/mods-enabled/*.loadInclude/etc/apache2/mods-enabled/*.conf

# contains the user's own configuration: Include/etc/apache2/httpd.conf

# configuration including port listening: Include/etc/apache2/ports.conf

# contains a general configuration statement fragment: Include/etc/apache2/conf.d/

# contains configuration instructions for virtual hosts: Include/etc/apache2/sites-enabled/

Modify httpd.conf and add: ServerName127.0.0.1:80

The above is the simple configuration of Apache2 shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Configuration file module directory content instruction version user statement analysis release service general general professional small and medium host global rich in content dynamic Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MySQL Huawei Xiaomi Apple