[root@localhost certs]# htpasswd -c /etc/httpd/user tian
New password:
Re-type new password:
Adding password for user tian
[root@localhost certs]# htpasswd -c /etc/httpd/user song
New password:
Re-type new password:
Adding password for user song
[root@localhost certs]# vim /etc/httpd/conf.d/userdir.conf
4.测试
三、访问缴费网站实现数据加密基于https访问
1、再/etc/pki/tls/private下生成私钥文件
[root@localhost certs]# cd /etc/pki/tls/private #进入存储私钥文件目录
[root@localhost private]# openssl genrsa -aes128 2048 > money.key #建立私钥
Enter PEM pass phrase: #输入密码
Verifying - Enter PEM pass phrase: #再次输入密码
2、在/etc/pki/tls/certs下建立新证书
[root@localhost private]# cd /etc/pki/tls/certs/
[root@localhost certs]# openssl req -utf8 -new -key /etc/pki/tls/private/money.key -x509 -days 365 -out money.crt
Enter pass phrase for /etc/pki/tls/private/money.key:
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]:86
State or Province Name (full name) []:shanxi
Locality Name (eg, city) [Default City]:xi'an
Organization Name (eg, company) [Default Company Ltd]:openlab
Organizational Unit Name (eg, section) []:rhce
Common Name (eg, your name or your server's hostname) []:localhost
Email Address []:money@qq.com