淘客商品网站怎么做的,自考本科需要什么条件,织梦网站响应式模板免费下载,211工程建设网站1.作业的要求 2.访问www.openlab.com网站
2.1先准备好相关的包和关闭防火墙等操作
mount /dev/sr0 /mnt/ //先挂载
yum install httpd -y //下载htppd
systemctl stop firewalld //关闭防火墙
setenforce 02.2然后开始配置文件和仓库
这一步比较关键,之前改了接口…1.作业的要求 2.访问www.openlab.com网站
2.1先准备好相关的包和关闭防火墙等操作
mount /dev/sr0 /mnt/ //先挂载
yum install httpd -y //下载htppd
systemctl stop firewalld //关闭防火墙
setenforce 0
2.2然后开始配置文件和仓库
这一步比较关键,之前改了接口什么的的建议改回来不然会一直404找不到服务
[rootlocalhost ~]# vim /etc/httpd/conf.d/vhost.conf
[rootlocalhost ~]# cat /etc/httpd/conf.d/vhost.conf
VirtualHost 192.168.229.129:80Servername www.openlab.comDocumentRoot /var/www/openlab
/VirtualHost
Directory /wwwAllowOverride noneRequire all granted
/Directory
[rootlocalhost ~]# mkdir /var/www/openlab
[rootlocalhost ~]# echo 1111 /var/www/openlab/index.html
[rootlocalhost conf.d]# vim /etc/hosts
[rootlocalhost conf.d]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.171.129 www.openlab.com
[rootlocalhost ~]# systemctl restart httpd
[rootlocalhost ~]# curl www.openlab.com
1111 //这里是结果
[rootlocalhost ~]#
3.openlab下面的三个子页面创建及其配置文件的配置和加密
3.1在刚刚的文件底下创建三个文件并且写入内容
[rootlocalhost ~]# mkdir /var/www/openlab/student
[rootlocalhost ~]# mkdir /var/www/openlab/data
[rootlocalhost ~]# mkdir /var/www/openlab/money
[rootlocalhost ~]# echo 1 /var/www/openlab/student/index.html
[rootlocalhost ~]# echo 2 /var/www/openlab/data/index.html
[rootlocalhost ~]# echo 3 /var/www/openlab/money/index.html
3.2创建两个用户并且在配置文件中加入用户内容
创建song和tian用户密码都设置成redhat
[rootlocalhost ~]# htpasswd -c /etc/httpd/yonghu song
New password:
Re-type new password:
Adding password for user song
[rootlocalhost ~]# htpasswd -c /etc/httpd/yonghu tian
New password:
Re-type new password:
Adding password for user tian
[rootlocalhost ~]# vim /etc/httpd/conf.d/vhost.conf
[rootlocalhost ~]# cat /etc/httpd/conf.d/vhost.conf
VirtualHost 192.168.171.129:80Servername www.openlab.comDocumentRoot /var/www/openlab
/VirtualHost
Directory /var/www/openlabAllowOverride noneRequire all granted
/Directory
directory /var/www/openlab/studentallowoverride noneauthtype basicauthname please loginauthuserfile /etc/httpd/yonghurequire user song tian
/directory
[rootlocalhost ~]# curl www.openlab.com/student/ -u tian
Enter host password for user tian:
1 //这里的运行结果
[rootlocalhost ~]# 3.3 加密
[rootlocalhost ~]# yum install mod_ssl //这里需要下载一个mod_ssl
[rootserver ~]# cd /etc/pki/tls/private/
[rootserver private]# openssl genrsa -aes128 2048 jiami.key
[rootlocalhost certs]# cd /etc/pki/tls/certs/
[rootlocalhost certs]# openssl req -utf8 -new -key /etc/pki/tls/private/jiami.key -x509 -days 365 -out jiami.crt