linux红帽子服务器安装教程

发布网友 发布时间:2022-03-01 17:38

我来回答

1个回答

热心网友 时间:2022-03-01 19:07

在网络服务中,web服务在人们生活中是必不可少的;人们每天在网站上浏览网页,获取最新的讯息,作为一个交互平台web服务是如何实现的呢?当然离不了我们的网站服务器,学了两天,有一些心得分享给大家!

1,基于apache的web服务器基础搭建:
(1)实验环境:一台ip为192.168.10.10的rhel5.9主机作为web服务器,一台ip为192.168.10.15的win7主机作为测试机
(2)查看服务主机软件是否安装
[root@ser1 ~]# rpm -q httpd httpd-manual httpd-devel
package httpd is not installed
package httpd-manual is not installed
package httpd-devel is not installed
(3)安装软件包
[root@ser1 ~]# yum install -y httpd httpd-manual httpd-devel
(4)启动服务
[root@ser1 ~]# service httpd start
启动httpd: [确定]
[root@ser1 ~]# chkconfig httpd on
(5)在win7上测试,无网页缺省下显示红帽测试页
<报错页面存放位置/var/www/error/noindex.html>

(6)打开配置文件
[root@ser1 ~]# vim /etc/httpd/conf/httpd.conf
可获得以下重要字段:
目录设置:
<Directory 目录> .. .. </Directory>
访问位置设置:
<LocationURL> .. .. </Location>
虚拟主机设置:
<VirtualHost 监听地址> .. .. </VirtualHost>
常用的全局设置参数:
ServerName本站点的FQDN名称
DocumentRoot网页文档的根目录:缺省/var/www/html/
DirectoryIndex默认索引页/首页文件:一般设为index.html index.php
ErrorLog错误日志文件的位置
CustomLog 访问日志文件的位置
Listen 监听服务的IP地址、端口号
ServerRoot 服务目录:/etc/httpd/
Timeout网络连接超时,默认 300 秒
KeepAlive是否保持连接,可选On或Off
MaxKeepAliveRequests每次连接最多处理的请求数
KeepAliveTimeout保持连接的超时时限
Include 可包含其他子配置文件: /etc/httpd/conf.d/
(7)创建测试网页
[root@ser1 ~]# vim /var/www/html/index.html
<h1>
This is a test page !!!
</h1>
~
(8)win7下测试,主页变为测试网页

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com