Linux怎么搭建Web服务器_第1页
Linux怎么搭建Web服务器_第2页
Linux怎么搭建Web服务器_第3页
Linux怎么搭建Web服务器_第4页
Linux怎么搭建Web服务器_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Linux怎么搭建Web服务器Web服务器一般指网站服务器,是指驻留于因特网上某种 类型计算机的程序,可以向浏览器等Web客户端提供文档,1也可以放置网站文件,让全世界浏览;可以放置数据文件,让全世界下 载。那么Linux怎么搭建 Web服务器?下面跟着 小编一起来了解一 下吧。Linux怎么搭建 Web服务器1,基于apache的web服务器基础搭建:(1) 实验环境:一台ip为0 的rhel5.9主机作 为web服务器,一台ip为5的win7主机作为测试机(2) 查看服务主机软件是否安装rootser1 # rpm -q httpdhttpd

2、-ma nualhttpd-develpackage httpd is not in stalledpackage httpd-ma nual is not in stalled package httpd-devel is not in stalled(3) 安装软件包rootser1 # yum in stall -y httpd httpd-ma nualhttpd-devel(4) 启动服务rootser1 # service httpd start启动httpd :确定rootser1 # chkc onfig httpd on(5) 在win7上测试,无网页缺省下显示红帽测试页&

3、lt;报 错 页 面 存 放 位/var/www/error/ noin dex.html>2:-192.1-LiD.lD电 理汉属站 岂 网This page 应 used to lest the proper Dperalion of lhe Apache HTTP server after il has been mslalled tf you can read this page, it means lhat the A property.If you aire the website sduiimistrYdu may now add c&nlent Io the dire m

4、rtmg your wedsite will see Shis page eing follow 齿色 irkstruction$ in IYom are free lo uw the imag below iIf you are a member of the general public:The fact ttiat you ane seeing this page indrcales thal the wetosile you jusl visited is either espenencing probiefiis. or is uncftergoing roullne malnEen

5、ance.it you would like lo let lhe adminislralors of Ihis we&site know ihat yowve 黑en (his page in$ieaa I the page you espected, you sfioukl send them e-mail In general, mail sent flo the riame bmasler* and directed to lhe we bites damaini stiould reach lhe appropriale personFor ejtampte ir you exper

6、ieficed pfDbtefns 留ne vtsrting wvA. you should send e- rnail Id -Wetinia5terexampfe.cQni,!Fw inrDnnatio-n on Red Hal Efilerpnse unu扎 please visit me 何& H別 iru webm巴 The 廿for Red Hat Entefprise Lintux is 别刊 irDIe ordhe: Reti H円 1. int wiebsi馆(6)打开配置文件rootser1 # vim /etc/httpd/c on f/httpd.c onf可获得以下重

7、要字段:目录设置:& lt;Directory目录 > . & lt;/Director y>访问位置设置:4& t;Locatio nURL> . & lt;/Locatio n>虚拟主机设置:& lt;VirtualHost监听地址 > . & lt;/VirtualHost>常用的全局设置参数:ServerName 本站点的FQDN名称DocumentRoot网页文档的根目录:缺省/var/www/html/DirectoryI ndex默认索引页/首页文件:一般设为in dex.html in dex.phpErrorLog错误日志文件的位置Cust

8、omLog 访问日志文件的位置Listen监听服务的IP地址、端口号ServerRoot 服务目录:/etc/httpd/Timeout网络连接超时,默认300秒KeepAlive是否保持连接,可选 On或OfMaxKeepAliveRequests每次连接最多处理的请求数KeepAliveTimeout保持连接的超时时限Include可包含其他子配置文件:/etc/httpd/conf.d/创建测试网页rootser1 # vim /var/www/html/i ndex.html& It;h1 >This is a test page !& It;/h1 >(8)win7下测试

9、,主页变为测试网页皂- Windows Internet Explorer於 http:/192.16a.iaio/治建汶网站邑网页快汛库P http:/192A681OAO/ JThis is a test page !2,基于apache的web服务器的访问控制:(1)web服务的地址限制I,rder配置项,定义控制顺序allow,deny 先允许后拒绝,缺省拒绝所有;冲突时,拒绝生效;allow不设置,拒绝所有deny,allow 先拒绝后允许,缺省允许所有;冲突时,允许生效;deny不设置,允许所有II, Allow/Deny from配置项,设置权限Allow from 地址 1 地

10、址 2 .Deny from 地址 1 地址 2 .配置如下:rootser1 # vim /etc/httpd/c on f/httpd.c onf331 #332 Orderallow,de ny333 Allowfrom /24334334 & lt;/Directory>rootser1 # service httpd restart……重启服务停止httpd :确定启动httpd :确定|曲 叵 建垃网姑 网页快讯库 ge for the Apach& HTTP Server on Re.在win7上测试,测试完成并还原配置文

11、件:用192.168丄0丄5访巨茂圭,只允tfl92,168.20.0/24网段访问Red Hat EnterpriseThis page ts used to test the proper operation of the Apache HTTP server after it has been installed If you propertyIf you are a member of the general public:The fact that you are seeing this page inctfcates mat the website you just visited is either experiencing problems, or

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论