Home >Operation and Maintenance >Apache >How to install apache under centos
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.
(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:
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.
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!