• Apache


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

    ps -ef | grep httpd

    sudo netstat -anpl | grep 'http'

    sudo firewall-cmd --zone=public --add-port=80/tcp --permanent

    虚拟主机配置:
    cd /etc/httpd

    sudo vim /etc/httpd/conf/httpd.conf

    <VirtualHost *:80>
    ServerName www.test.com
    DocumentRoot /wwwroot/demo
    <Directory "/wwwroot/demo">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    </Directory>
    </VirtualHost>

    mkdir -p /wwwroot/demo
    index.html内容:
    <html>
    <head>
    <meta charset="UTF-8">
    <title>这是一个测试页面</title>
    </head>
    <body>
    <h1>测试页面</h1>
    </body>
    </html>

    hosts 文件
    windows位置:C:WindowsSystem32driversetchosts
    192.168.3.89 www.test.com
    刷新 dns:ipconfig /flushdns

    linux位置 /etc/hosts

    tail -f access_log/error_log


    chkconfig --list 显示开机可以自动启动的服务
    chkconfig --add *** 添加开机自动启动***服务
    chkconfig --del *** 删除开机自动启动***服务

    chkconfig --list | grep httpd
    httpd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
    chkconfig --add httpd

    //访问站点403错误原因:SELinux设置为开启状态(enabled)的原因
    将SELINUX=enforcing 修改为 SELINUX=disabled 状态
    vim /etc/selinux/config
    #SELINUX=enforcing
    SELINUX=disabled
    重启生效:reboot

    sudo setenforce 0

    sudo setenforce 0 //临时

  • 相关阅读:
    MySQL创建数据库与创建用户以及授权
    java关于map用来筛选的用法
    C#实体类的关联运用
    PHP 数据库基础操作
    PHP 文件操作
    PHP 加密和解密
    PHP 图形处理
    PHP Cookie和Session
    SQL基本操作
    JAVA基本术语
  • 原文地址:https://www.cnblogs.com/marshhu/p/9728949.html
Copyright © 2020-2023  润新知