Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Apache2 easily

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report