Home >Operation and Maintenance >Apache >How to install apache under centos

How to install apache under centos

王林
王林forward
2020-06-24 17:45:125789browse

The method to install apache under centos is: 1. Execute the [yum install httpd] command to install httpd; 2. Open the configuration file and change [AllowOverride None] to [AllowOverride All]; 3. Restart the server.

How to install apache under centos

(Recommended tutorial: apache from beginner to master)

The specific method is as follows:

1. Install httpd

yum install httpd

When installing httpd, the following dependency packages will be automatically installed:

How to install apache under centos

Select y and install the downloaded installation package.

2. Configuration

Open the configuration file and change all AllowOverride None inside to AllowOverride All

vi httpd.conf

By the way, add index.htm index after DirectoryIndex index.html. php index.shtml

:wq Save and exit

3. Restart the server

service httpd restart
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动

4Test

Enter the corresponding URL in the browser, and the following interface will appear It means the configuration is successful.

How to install apache under centos

The above is the detailed content of How to install apache under centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete