给openlab搭建web网站

网站需求:
1.基于域名www.openlab.com可以访问网站内容为 welcome to openlab.
2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于www.openlab.com/student 网站访问学生信息,www.openlab.com/data网站访问教学资料
www.openlab.com/money网站访问缴费网站。
要求:(1)学生信息网站只有song和tian两人可以访问,其他用户不能访问。
(2)访问缴费网站实现数据加密基于https访问。

[root@localhost ~]# yum install httpd -y    #下载http软件包
[root@localhost ~]# vim /etc/httpd/conf.d/vhost.conf    #修改配置文件

在这里插入图片描述

[root@localhost ~]# vim /etc/hosts     #手动修改文件,添加域名关联信息

在这里插入图片描述
客户端测试手动添加域名关联信息 window C:\Windows\System32\drivers\etc\hosts
在这里插入图片描述

[root@localhost ~]# mkdir /openlab   #创建目录
[root@localhost ~]# echo welcome to openlab > /openlab/index.html   
[root@localhost ~]# systemctl stop firewalld.service 
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# cat /openlab/index.html
welcome to openlab
[root@localhost ~]# curl http://www.openlab.com
welcome to openlab

在这里插入图片描述

[root@localhost ~]# vim /etc/httpd/conf.d/vhost.conf    #修改配置文件

在这里插入图片描述

[root@localhost ~]# mkdir /openlab/{student,data,money} -pv
[root@localhost ~]# echo I am a student > /openlab/student/index.html
[root@localhost ~]# echo You are a data > /openlab/data/index.html
[root@localhost ~]# echo It is a money > /openlab/money/index.html
[root@localhost ~]# htpasswd -c /etc/httpd/user song

在这里插入图片描述
[root@localhost ~]# htpasswd /etc/httpd/user tian
在这里插入图片描述

[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# cat /openlab/student/index.html
I am a student
[root@localhost ~]# cat /openlab/data/index.html
You are a data
[root@localhost ~]# curl http://www.openlab.com/student/ -u song

在这里插入图片描述

[root@localhost ~]# curl http://www.openlab.com/student/ -u tian

在这里插入图片描述
在Linux主机上访问http://www.openlab.com 输入用户名和密码进去访问(song和tianjunke)
在这里插入图片描述
在这里插入图片描述

[root@localhost ~]# yum install mod_ssl.x86_64 -y
[root@localhost certs]# vim /etc/httpd/conf.d/vhost.conf 

在这里插入图片描述

[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# cat /openlab/money/index.html
It is a money
[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 -xe" for details.  

因为我没有openlab加密证书,所以我重启服务失败,接下来搭建openlab加密证书文件

[root@localhost private]# cd /etc/pki/tls/certs/
[root@localhost certs]# cd ../private/
[root@localhost private]# openssl genrsa -aes128 2048 > openlab.key
[root@localhost private]# cd ../certs/
[root@localhost certs]# openssl req -utf8 -key /etc/pki/tls/private/openlab.key -x509 -days 365 -out openlab.crt

详细步骤在我<https(web)搭建加密文件>这篇博客里

[root@localhost certs]# systemctl restart httpd
Enter TLS private key passphrase for www.openlab.com:443 (RSA) : ******
[root@localhost certs]# curl http://www.openlab.com/money/
It is a money
[root@localhost certs]# curl http://www.openlab.com/data/
You are a data

在Linux主机上访问http://www.openlab.com/data/
在这里插入图片描述
在Linux主机上访问http://www.openlab.com/money/
在这里插入图片描述

再把学生信息写入www.openlab.com/student 网站,把教学资料写入www.openlab.com/data网站,把缴费写入www.openlab.com/money网站。

这样就成功啦!

为达到最佳效果,推荐使用九网互联的ASP.net空间,支持ASP.net版本1.1和2.0在线切换、在线脚本映射、ASP.net具体错误信息在线查看。Openlab开源综合社区系统Openlab系统基于Asp.Net 2.0开发,是一套开源的综合性社区系统。初次使用,可以打开http://域名/Installer进行安装。Openlab框架做了什么?用户管理 权限管理 配置管理 存储管理 内容管理 插件机制 Url管理 皮肤方案 多语言 计划任务 缓存管理 分页方案用户管理:和其他应用用户系统整合 SSI AD 每个应用可以扩展自己独立的用户属性ForumUsers用户、角色管理头像私人留言心情短语历史在线列表维护基于队列权限管理:基于角色的权限分配各应用独立权限枚举方式集中存储配置管理:各应用独立配置独立配置节点配置基类,方便加载配置URL管理:通过配置文件实现URL的管理支持灵活的Url重写每个应用有每个页面可兼容多个Url自己独立的Url配置可兼容多种后缀名(.htm;.aspx;…)内容管理:分类管理Tag管理数据管理和用户关联和存储关联基于Openlab的应用开发:实体、枚举类定义EntitiesEnumerations配置配置文件——Configuration数据库——ForumSettingsUrlForumUrlsforums/url.config存储配置——ForumAttachmentSettings实现——DiskForumAttachmentsDataProvider数据访问ProvidersDataProvider缓存ForumCacheManagerForumsCacheEntitiesClean控件Controls计划任务ScheduledTasks插件ForumModules该版本为免安装版,直接配置站点然后附加数据库即可,省去了繁琐的安装配置步骤data下为Sql数据库文件站点文件夹为WebSites\Openlabdocs下有Openlab系统架构.ppt后台管理地址:admin默认帐号/密码:admin/51aspx作者:宝玉
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值