zoukankan      html  css  js  c++  java
  • Apache系列:Centos7.2下安装与配置apache

    Centos7.2下安装与配置apache(一)

    配置机:腾讯云服务器,centos7.2

    一、安装Apache服务(Apache软件安装包叫httpd)

    yum install httpd -y
    

    二、开启Apache服务

    systemctl start httpd

      

    三、设置开机自启Apache服务

    systemctl enable httpd

    四、cd var/www/html(apache网页的存放路径,默认下面是没有网页的)

    五、vi index.html

     六、访问网页(访问服务器的话,访问公有ip)

     

     

     

    相关配置

    配置目录及相关配置文件:

    服务目录	/etc/httpd
    主配置文件	/etc/httpd/conf/httpd.conf
    网站数据目录	/var/www/html
    访问日志	/var/log/httpd/access_log
    错误日志	/var/log/httpd/error_log
    

      

    【httpd安装后各文件的内容及存放位置】
    
    服务脚本:/etc/rc.d/init.d/httpd
    
    运行目录:/etc/httpd
    
    配置文件:/etc/httpd/conf/
    
                主配置文件:httpd.conf
    
                扩展配置文件:/etc/httpd/conf.d/*.conf
    
    socket:
    
            http: 80/tcp,
    
            https: 443/tcp
    
    网页文件目录(DocumentRoot):
    
    静态页面:/var/www/html
    
    动态页面(CGI): /var/www/cgi-bin/
    
    默认主页面:index.html  index.php
    

      

    常见主配置文件(/etc/httpd/conf/httpd.conf)配置参数:

    ServerRoot	服务目录
    ServerAdmin	管理员邮箱
    User	运行服务的用户
    Group	运行服务的用户组
    ServerName	网站服务器的域名
    DocumentRoot	网站数据目录
    Listen	监听的IP地址与端口号
    DirectoryIndex	默认的索引页页面
    ErrorLog	错误日志文件
    CustomLog	访问日志文件
    Timeout	网页超时时间,默认为300秒.
    Include	需要加载的其他文件
    

      

  • 相关阅读:
    软件工程
    python 浮点数四舍六入五成双
    python 比较内嵌字典的值
    python 之多继承顺序及supper()方法执行顺序
    python之装饰器进化
    Centos7 安装Postgres10
    hive常用操作
    MySQL中case when else end 用法
    python写入日志文件时日志内容重复写入
    python向config、ini文件读取写入
  • 原文地址:https://www.cnblogs.com/-wenli/p/10480479.html
Copyright © 2011-2022 走看看