考试网 >> IT认证 >> Linux >> Linux指导 >> 用实验快速掌握web服务器Apache

用实验快速掌握web服务器Apache

发布时间:2006-06-28 10:31     点击:
分页:上一页  1 [2] 3 4  下一页

   5) 创建新的目录和html文件。

   # mkdir -p /var/www/virtual/server1.example1.com/html

   # vi /var/www/virtual/server1.example1.com/html/index.html

   Server1.example1.com

   6) 编辑/etc/httpd/conf/httpd.conf,末尾追加下列文本。

   NameVirtualHost 192.168.0.254    

   ServerName server1.example1.com

   ServerAdmin root@server1.example1.com

   DocumentRoot /var/www/virtual/server1.example1.com/html

   ErrorLog logs/server1.example1.com-error_log

   CustomLog logs/server1.example1.com-access_log combined   

   Options Indexes Includes

   7) 确保DNS能够解析你的VirtualHost

   # host server1.example1.com

   8) 重新启动httpd

   # service httpd restart

   如果启动失败,看/var/log/httpd/下的相应日志,会告诉你具体哪里错误。

   9) 在浏览器里能够看到你自己写的网页了吗?

   http://server1.example1.com

   10) 在机器2上能看到http://server1.example1.com吗?   

   3.机器1,在Apache中应用CGI

   1) 编辑/etc/httpd/conf/httpd.conf,在块中添加下列一行:

   ScriptAlias /cgi-bin/ /var/www/virtual/server1.example1.com/cgi-bin/

   2) 创建目录,创建文件。

   # mkdir /var/www/virtual/server1.example1.com/cgi-bin

   #vi /var/www/virtual/server1.example1.com/cgi-bin/test.sh   

   #!/bin/bash
分页:上一页  1 [2] 3 4  下一页
版权申明:未经书面授权请勿转载本站信息!!作品版权归所属媒体与作者所有!!
发表评论: 匿名发表 用户名: 查看评论
您将承担一切因您的行为、言论而直接或间接导致的民事或刑事法律责任
留言板管理人员有权保留或删除其管辖留言中的任意内容
本站提醒:不要进行人身攻击。谢谢配合。
在本站搜索相关信息
2003-2005 Ksw123.com All Rights Reserved. - TOP
Copyright © 2006 Ksw123.com. All rights reserved.中国考题网 版权所有