标签:www conf zuoye RHCE 作业 https root localhost
RHCE实验:
搭建一个基于https://www.zuoye.com:4443访问的web网站,网站首页在/www/https/,内容为zuoye
版本:rhet8
首先建立新的IP地址192.168.18.12/24
第一步:安装https
[root@localhost ~]# yum -y install mod_ssl
第二步:创建文件,编辑网页内容
[root@localhost ~]# mkdir -pv /www/https
mkdir: 已创建目录 '/www/https'
[root@localhost ~]# echo zuoye > /www/https/index.html
第三步:配置文件
/etc/httpd/conf.d/https.conf
[root@localhost ~]# vim /etc/httpd/conf.d/https.conf
listen 4443
<VirtualHost 192.168.18.12:4443>
DocumentRoot /www/https
ServerName www.zuoye.com
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/https.crt
SSLCertificateKeyFile /etc/pki/tls/certs/https.key
</VirtualHost>
<Directory /www/https>
AllowOverride None
Require all granted
</Directory>
第四步:生成密钥和证书
[root@localhost ~]# cd /etc/pki/tls/certs/
[root@localhost certs]# openssl genrsa -aes128 2048 > https.keys
[root@localhost certs]# openssl req -utf8 -new -key https.key -x509 -days 365 -out localhost.crt
[root@localhost conf.d]# openssl req -utf8 -new -key https.key -x509 -days 365 -out localhost.crt
Enter pass phrase for https.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]:12
State or Province Name (full name) []:34
Locality Name (eg, city) [Default City]:56
Organization Name (eg, company) [Default Company Ltd]:wq
Organizational Unit Name (eg, section) []:ww
Common Name (eg, your name or your server's hostname) []:www.zuoye.com
Email Address []:qq@qq
第五步:关闭防火墙 重启httpd,访问www.zuoye.com
[root@localhost conf.d]# setenforce 0
[root@localhost conf.d]# systemctl stop firewalld
[root@localhost conf.d]# systemctl start httpd
[root@localhost conf.d]# curl https://www.zuoye.com:4443 -k
标签:www,conf,zuoye,RHCE,作业,https,root,localhost 来源: https://blog.csdn.net/weixin_53176674/article/details/120573682
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。