--作业要求--
综合练习:请给openlab搭建web网站
网站需求:
1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!!
2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于[www.openlab.com/student](http://www.openlab.com/student) 网站访问学生信息,[www.openlab.com/data](http://www.openlab.com/data)网站访问教学资料
[www.openlab.com/money网站访问缴费网站](http://www.openlab.com/money网站访问缴费网站)。
3.要求
(1)学生信息网站只有song和tian两人可以访问,其他用户不能访问。
(2)访问缴费网站实现数据加密基于https访问。
vim /etc/httpd/conf.d/vhosts.conf
[root@localhost ~]# vim /etc/hosts
[root@localhost ~]# mkdir -p /www/openlab
192.168.42.128 www.openlab.com
[root@localhost ~]# echo 'welcome to openlab!!!' > /www/openlab/index.html
/etc/httpd/conf.d/vshots.conf改这里文件
[root@localhost ~]# systemctl restart httpd
#创建/data网页根目录
[root@localhost ~]# mkdir /www/openlab/data
#编辑网页内容
[root@localhost ~]# echo 'this is openlab data' > /www/openlab/data/index.html
curl www.openlab.com/data/
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@localhost ~]# yum install mod_ssl -y
openssl req -newkey rsa:4096 -nodes -sha256 -keyout /etc/pki/tls/private/openlab.key -x509 -days 365 -out /etc/pki/tls/certs/openlab.crt
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) []:kaituozhi
Locality Name (eg, city) [Default City]:ningixia^H^H^H
Organization Name (eg, company) [Default Company Ltd]:openlab
Organizational Unit Name (eg, section) []:ce
Common Name (eg, your name or your server's hostname) []:localhost
Email Address []:admin
[root@localhost ~]# ^C
[root@localhost ~]# vim /etc/httpd/conf.d/vshots.conf
[root@localhost ~]# mkdir /www/openlab/money
[root@localhost ~]# echo 'this is openlab money' > /www/openlab/money/index.html
[root@localhost ~]# systemctl restart httpd
[root@server ~]# vim /etc/httpd/conf.d/vshots.conf
<VirtualHost 192.168.101.200:80>
DocumentRoot /www/openlab
Alias /student /www/openlab/student
ServerName www.openlab.com
</VirtualHost>
<Directory /www/openlab/student>
AuthType Basic
AuthName "Please login:..."
AuthuserFile /etc/httpd/usrfile
Require user song tian
</Directory>
[root@localhost ~]# systemctl restart httpd
访问子页面