Options None
AllowOverride None
Require all granted
SetHandler server-status
AuthType basic
AuthName "For Adminstrator"
AuthUserFile "/etc/httpd/conf/.htpasswd"
Require user tom
6.2 提供账号和密码存储文件
[root@study conf]# htpasswd -c -m /etc/httpd/conf/.htpasswd tom
New password:
Re-type new password:
Adding password for user tom 6.3 测试:
1.3 使用openssl给CA服务器生成自签名证书
[root@CA CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
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]:magedu
Organizational Unit Name (eg, section) []:ops
Common Name (eg, your name or your server's hostname) []:ca.test.com
Email Address []:ca@test.com
1.4 创建CA相关目录和文件,指定序列号起始数字
[root@CA CA]# touch index.txt #新建索引文件
[root@CA CA]# touch serial #建立序列号文件
[root@CA CA]# echo 01 > serial #写入起始序列号 web服务器创建申请证书 2. 创建申请证书 2.1 在web服务器配置目录创建ssl目录
[root@study ~]# mkdir /etc/httpd/ssl 2.2 生成httpd 服务私钥
[root@study ~]# (umask 077;openssl genrsa -out /etc/httpd/ssl/httpd.key 1024)
Generating RSA private key, 1024 bit long modulus
..................++++++
..............................++++++
e is 65537 (0x10001)
[root@study ~]# ll /etc/httpd/ssl/httpd.key
-rw------- 1 root root 887 Jul 14 15:29 /etc/httpd/ssl/httpd.key 2.3 生成证书签署请求文件
[root@study ~]# openssl req -new -key /etc/httpd/ssl/httpd.key -out /etc/httpd/ssl/httpd.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
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]:magedu
Organizational Unit Name (eg, section) []:ops
Common Name (eg, your name or your server's hostname) []:www1.linux.com
Email Address []:ops@admin.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []: 2.4 把httpd申请证书发送到CA颁发机构上