1.安装和启动apache:
[root@gaosh-64 ~]# yum install httpd
[root@gaosh-64 ~]# systemctl restart httpd
[root@gaosh-64 ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
2.常见配置参数:
vim /etc/httpd/conf/httpd.conf
ServerRoot "/etc/httpd" #用于指定Apache运行的根目录
Listen 80 #监听80端口
MaxClients 256 #指定同时能访问服务器的客户机数量为256
DocumentRoot "/var/www/html" #网页文件存放的目录
DirectoryIndex index.html index.html.var #默认网站主页
Include conf.d/*.conf #读取/etc/httpd/conf/conf.d/目录中所有以.conf结尾的文件
ServerName www.wg.com #域名
ServerAdmin #设置管理员的邮箱
Include conf.d/*.conf #包含的子配置文件
User apache #用户是apache
Group apache