配置
1.挂载
2.本地源配置文件
3.安装httpd软件
4.查看HTTP状态
[root@localhost conf.d]# systemctl status httpd -l
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2019-01-19 08:13:09 EST; 3s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 10777 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Main PID: 10830 (httpd)
Status: "Processing requests..."
CGroup: /system.slice/httpd.service
├─10830 /usr/sbin/httpd -DFOREGROUND
├─10835 /usr/sbin/httpd -DFOREGROUND
├─10836 /usr/sbin/httpd -DFOREGROUND
├─10837 /usr/sbin/httpd -DFOREGROUND
├─10838 /usr/sbin/httpd -DFOREGROUND
└─10839 /usr/sbin/httpd -DFOREGROUND
Jan 19 08:13:09 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Jan 19 08:13:09 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
5.重启程序
6.关闭防火墙
7.关闭selinux
特殊目录
/etc/httpd 配置目录
/etc/httpd/conf 主配置目录
/etc/httpd/conf.d 辅助配置目录
/var/www/html 文档根目录
/var/log/httpd 日志目录
HTTP主配置文件参数
ServerRoot /etc/httpd 服务器的根目录
Listen 80 监听端口
<Directory /> 目录标签
AllowOverride none 允许覆盖所有
Require all denied/granted 禁止访问/授权
</Directory>
DocumentRoot “/var/www/html” 文档根目录
<IfModule dir_module>
DirectoryIndex index.html 索引目录为index.html
</IfModule>
IncludeOptional /etc/httpconf.d/*.conf 包括子配置文件下所有以.conf结尾的文件
1.基于ip地址对web服务器的访问
2.基于端口对web服务器的访问
1.一个端口
2.多端口访问
3.基于域名对web服务器的访问
Windows
C:/Windows/System32/drivers/etc/hosts文件
关注我的微信公众号:hello521day ,大量网络,渗透、编程资料以及ppt等模板等你来取!