Indexes:目录下的文件都可以访问(除非你建的是下载站,否则这项关闭)
FollowSymLinks:允许跟踪符号链接
AllowOverride:httpd允许在网页文档的各目录下使用隐藏文件.htaccess来各自的访问控制;此指令定义哪此指令可以在.htaccess中定义
Require:
Require all granted
Require all denied
<RequireAll>
Require ip 10.1.0.0/16
Require all denied
</RequireAll> 拒绝所有,读取时从上到下的顺序
Require ip IP|NETWORK
Require not ip IP|NETWORK
Require host HOSTNAME
Require not host HOSTNAME
四、虚拟主机(IP、端口、主机名不同)
1、修改主配置文件,添加端口
2、添加网卡或配置临时IP
3、创建网站文件目录与主页面
4、创建虚拟主机的配置文件
主配置文件:
]# vi /etc/httpd/conf/httpd.conf
[iyunv@s2 CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem
Country Name (2 letter code) [XX]:CN #国家(俩个字符的代码)
State or Province Name (full name) []:Beijing #省
Locality Name (eg, city) [Default City]:Beijing #地区
Organization Name (eg, company) [Default Company Ltd]:latiao #公司名
Organizational Unit Name (eg, section) []:Ops #部门
Common Name (eg, your name or your server's hostname) []:ca.latiao.com #CA服务器名
Email Address []:admin.latiao.com #邮箱地址
1
2
[iyunv@s2 CA]# echo 01 > serial
[iyunv@s2 CA]# touch index.txt
[iyunv@s2 certs]# openssl req -new -key httpd.key -out httpd.csr
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:Beijing
Locality Name (eg, city) [Default City]:Beijing
Organization Name (eg, company) [Default Company Ltd]:latiao
Organizational Unit Name (eg, section) []:development
Common Name (eg, your name or your server's hostname) []:www.latiao.com
Email Address []:webadmin.latiao.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Common Name #推广给客户端,客户端在浏览器中输入的网址,证书持有者的名称和客户访问的网址的名称要一致
⑤将申请证书发送给CA服务商,这里本机是CA服务商,所以自己签署就行
1
[iyunv@s2 certs]# openssl ca -in httpd.csr -out httpd.crt #后面都是Y同意即可
修改ssl配置文件
[iyunv@s2 conf.d]# vi ssl.conf
1
2
3
4
5
SSLEngine on
SSLCertificateFile /etc/httpd/certs/httpd.crt
SSLCertificateKeyFile /etc/httpd/certs/httpd.key
DocumentRoot "/var/www/html"
ServerName www.latiao.com