網站需求:
?????????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 測試