网站需求:
1、基于域名 www.openlab.com 可以访问网站内容为 welcome to openlab!!!
增加映射
[root@localhost ~]# vim /etc/hosts
创建网页
[root@localhost ~]# mkdir -p /www/openlab
[root@localhost ~]# echo 'welcome to openlab' > /www/openlab/index.html
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
重启服务
[root@localhost ~]# systemctl restart httpd
浏览器测试
浏览器 www.openlab.com/data
2、给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站
添加学生信息以及设置密码
[root@localhost ~]# useradd song
[root@localhost ~]# passwd song
[root@localhost ~]# useradd tian
[root@localhost ~]# passwd tian
创建存储登录网站的密码
[root@localhost ~]# htpasswd -c /etc/httpd/passwd song
New password:
Re-type new password:
Adding password for user song
[root@localhost ~]# htpasswd /etc/httpd/passwd tian
New password:
Re-type new password:
Adding password for user tian
创建网页以及网页目录
[root@localhost ~]# mkdir -p /www/openlab/student
[root@localhost ~]# echo 'student' > /www/openlab/student/index.html
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
重启服务
[root@localhost ~]# systemctl restart httpd
浏览器测试
浏览器输入 www.openlab.com/student 测试
创建验证证书真实性的私钥文件
[root@localhost ~]# openssl genrsa -ase128 2048 > /etc/pki/tls/private/money.key
验证数字证书
[root@localhost ~]# openssl req -utf8 -new -key /etc/pki/tls/private/money.key -x509 -days 365 -out /etc/pki/tls/certs/money.crt
创建网页和网页目录
[root@localhost ~]# mkdir -p /www/openlab/money
[root@localhost ~]# echo 'money' > /www/openlab/money/index.html
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
重启服务
[root@localhost ~]# systemctl restart httpd
浏览器测试
浏览器输入 https://www.openlab.com/money 测试