an'z
[root@localhost ~]# yum install httpd -y
更改配置文件
[root@localhost /]# vim /etc/hosts
创建根目录
[root@localhost ~]# mkdir -p /www/openlab
编辑网页内容
[root@localhost ~]# echo 'welcome to openlab' > /www/openlab/index.html
重启服务
[root@localhost ~]# systemctl restart httpd
测试
[root@localhost ~]# curl www.openlab.com
welcome to openlab
更改配置文件
[root@localhost /]# vim /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
[root@localhost ~]# curl www.openlab.com/data/
money页面
[root@localhost ~]# mount /dev/sr0 /mnt
[root@localhost /]# yum install mod_ssl -y
[root@localhost /]# 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) []:shannxi
Locality Name (eg, city) [Default City]:nanjing
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 /]# 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
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xeu httpd.service" for details.
[root@localhost /]# curl --insecure https://www.openlab.com/money/
创建用户及密码
[root@localhost /]# htpasswd -c /etc/httpd/userfile song
New password:
Re-type new password:
Adding password for user song
[root@localhost /]# htpasswd /etc/httpd/userfile tian
New password:
Re-type new password:
Adding password for user tian
创建目录
[root@localhost /]# mkdir /www/openlab/student
重启服务
[root@localhost /]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xeu httpd.service" for details.