项目简介:
1、 管理员根据公司设计部需要发布“项目考核信息平台”网站的要求,在服务器上部署该网站。首先要安装Web服务器,然后对服务器进行必要测试。
测试效果:在浏览器输入服务器的IP地址即可看测试页的内容。
2、 项目考核信息网站部署完成后,考虑到站点是内部网站,为了保证安全,将首页改为
exam.html,并使用8080端口访问。
项目分析:
管理员首先需要安装Apache软件,并将项目考核信息平台网站放在Apache默认网站根目录,并通过服务器IP地址进行访问;为了网站安全,通过修改主配置文件/etc/httpd/conf/httpd.conf中的主页与端口号实现网站的访问。
项目实施:
一、发布公司网站
1、安装Apache服务
[root@localhost ~]# yum install -y httpd
[root@localhost ~]#systemctl start httpd.service
理解:
/etc/httpd/conf:该目录存放Apache服务器的配置文件
/var/www/html:该目录是Apache服务器的默认站点根目录
/etc/httpd/logs:该目录是Apache服务器的日志文件目录
2、测试Apache是否安装成功
在浏览器的地址栏输入:localhost进行测试。
3、将公司网站exam复制到/var/www/html/目录下,并修改配置文件:
[root@localhost ~]vim /etc/httpd/conf/httpd.conf
修改:~~DocumentRoot “/var/www/html/”~~为DocumentRoot “/var/www/html/exam”
修改完配置文件后必须要重启服务:
[root@localhost ~]systemctl restart httpd
二、发布个性化网站
项目考核信息网站部署完成后,考虑到站点是内部网站,为了保证安全,将首页改为exam.html,并使用8080端口访问。
1、修改首页名字
[root@localhost ~]#mv /var/www/html/exam/index.html /var/www/html/exam/exam.html
2、修改配置文件
[root@localhost ~]#vim /etc/httpd/conf/httpd.conf
Listen 8080
DirectoryIndex exam.html index.html
3、重启服务:
[root@localhost ~]#systemctl restart httpd
4、访问测试
在浏览器的地址栏输入:服务器IP:8080进行测试。