基本操作
// 安裝
yum install httpd
// 啟動
service httpd start
// 停止
service httpd stop
查詢進(jìn)程是否存在
ps -ef | gref httpd
查詢端口是否監(jiān)聽
sudo netstat -anpl | grep 'http'
配置虛擬主機(jī)
cd /etc/httpd/conf
vim httpd.conf
<VirtualHost *:80>
ServerName www.hello.test
DocumentRoot /data/www
<Directory "/data/www">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
重啟服務(wù)器
service httpd restart
建立根目錄
sudo mkdir -p /data/www
新建index.html并提權(quán)
sudo chown -R user1:user1 /data
vim index.html
設(shè)置為寬松模式
// 在配置中設(shè)置
sudo vim /etc/selinux/config
sudo setenforce 0