Apache

作者: greenteaObject | 来源:发表于2018-05-27 21:04 被阅读0次

基本操作

// 安装
yum install httpd
// 启动
service httpd start
// 停止
service httpd stop

查询进程是否存在

ps -ef | gref httpd

查询端口是否监听

sudo netstat -anpl | grep 'http'

配置虚拟主机

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>

重启服务器

service httpd restart

建立根目录

sudo mkdir -p /data/www

新建index.html并提权

sudo chown -R user1:user1 /data
vim index.html

设置为宽松模式

// 在配置中设置
sudo vim /etc/selinux/config
sudo setenforce 0

相关文章

网友评论

    本文标题:Apache

    本文链接:https://www.haomeiwen.com/subject/yodijftx.html