系列文章目录
前言
搭建过程
mount /dev/sr0 /mnt yum install httpd -y vim /etc/httpd/conf.d/vhost.conf
<VirtualHost 192.168.199.136> DocumentRoot /www/html Servername www.openlab.com Alias /data /www/html/data Alias /student /www/html/student #Alias /money /www/html/money #SSlEngine on #SSlCertificateFile /etc/pki/tls/certs/openlab.crt #SSlCertificatekeyFile /etc/pki/tls/certs/openlab.key
<Directory /www> AllowOverride none Require all granted
<Directory /www/html/student/> AllowOverride none AuthType Basic AuthName “输入学生账号” AuthUserfile /etc/httpd/users Require user song tian
<VirtualHost 192.168.199.136:443> DocumentRoot /www/html Alias /money /www/html/money Servername www.openlab.com SSlEngine on SSlCertificateFile /etc/pki/tls/certs/openlab.crt SSlCertificatekeyFile /etc/pki/tls/certs/openlab.key
<Directory /www/html/money> AllowOverride none Require all granted
systemctl restart httpd systemctl stop firewall
mkdir -p /www/html/{data,money,student} echo hello world > /www/html/index.html echo hello S > /www/html/data/index.html echo hello world > /www/html/student/index.html
htpasswd -c /etc/httpd/users song htpasswd /etc/httpd/users tian
yum install mod_ssl cd /etc/pki/tls/certs openssl req -newkey rsa:4096 -nodes -sha256 -keyout openlab.key -x509 -days 365 -out openlab.crt 86 vim /etc/host 192.168.199.136 www.openlab.com 在 win10 host文件 C:\Windows\System32\drivers\etc 的hosts文件后添加如下 192.168.199.136 www.openlab.com
|