基础环境:
1)虚拟机需要联网
2)关闭防火墙和内核安全机制
[root@centos7 ~]# systemctl stop firewalld
[root@centos7 ~]# setenforce 0
一、安装http服务
1.1 安装apache 软件包
[root@centos7 ~]# yum install httpd httpd-devel -y
/var/www/html ###网站发布目录
/etc/httpd ###httpd服务的根目录
/var/log/httpd/access_log ###存放访问日志
/var/log/httpd/error_log ###存放错误日志
/etc/httpd/conf/httpd.conf ###主配置文件
[root@centos7 ~]# egrep -v "#|^$" /etc/httpd/conf/httpd.conf
ServerRoot "/etc/httpd" ###服务目录
Listen 80 ###在所有IP地址上监听端口
User apache ###运行服务的用户
Group apache ###运行服务的用户组
ServerAdmin root@localhost ###管理员邮箱
ServerName www.example.com:80 ###设置网站域名
DocumentRoot "/var/www/html" ###网站发布目录
ErrorLog "logs/error_log" ###错误日志文件
LogLevel warn ###日志级别
CustomLog "logs/access_log" combined ###正常访问日志
AddDefaultCharset UTF-8 ###网页默认字符集