配置机:腾讯云服务器,centos7.2php
yum install httpd -y
systemctl start httpd
systemctl enable httpd
配置目录及相关配置文件:html
服务目录 /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)配置参数:python
ServerRoot 服务目录 ServerAdmin 管理员邮箱 User 运行服务的用户 Group 运行服务的用户组 ServerName 网站服务器的域名 DocumentRoot 网站数据目录 Listen 监听的IP地址与端口号 DirectoryIndex 默认的索引页页面 ErrorLog 错误日志文件 CustomLog 访问日志文件 Timeout 网页超时时间,默认为300秒. Include 须要加载的其余文件