好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

ORACLE之APACHE虚拟服务器设置|路径-Apache教程

1.查看当前UNIX环境下有无运行 apache Web Server
在终端控制台上运行# photoshop / target=_blank class=infotextkey>ps -ef|grep httpd
如果运行了,会列出一些包含路径信息的进程;去这个路径下找httpd.conf即可知 服务器 的配置。
2.启动和关闭Apache Web Server
在运行Apache/bin路径下找到apachectl命令
#apachectl start
#apachectl stop
3.httpd.conf参数介绍:
a.知道WEB的管理目录位置
找到: ServerRoot "/..."
b.知道WEB的根目录位置
找到: DocumentRoot "/..."
c.知道WEB各虚拟路径的映射
Alias /icons/ "/opt/www/icons"
..........
ScriptAlias /cgi-bin/ "opt/www/cgi-bin"
..........
d.支持SSI

增加Option +Includes +ExecCGI
(其它参数说明:Indexes 容许路径下的目录浏览 FollowSymlinks 容许使用符号 连接 ,连到别处
MultiViews 找相似的文件名)
去掉加注释的以下语句:
AddType text/html .shtml
AddHander server-parsed .shtml
(如果想使htm文件支持SSI,增加以下语句
AddType text/html .htm
AddHander server-parsed .htm
)

5.支持CGI
去掉加注释的以下语句:
AddHandler cgi-script .pl
AddHander cgi-script .cgi

6.初始的文件名
DirectoryIndex  index.html
(如果想增加别的类别文件,只需在这后面增加index.htm或index. PHP 即可)
7.性能 优化
MaxKeepAliveRequests 1024
MaxClient 256
8.给WEB路径加密
  创建#htpassws -c 加密用户库.db 用户名
  new pass word :****
  Re-type new passwd:****

改<Directory " DocumentRoot's directory">
    AllowOverride All
   (作用:使每个路径下的.htaccess稳健有效)
   </Directory>

在欲加密的路径下建一个隐含文件.htaccess,内容如下:
   AuthType Basic
   AuthName Ingormation
   AuthUserFile    /directory/加密用户库.db  //记录用户密码的隐含文件路径和名称
   <Limit GET POST PUT>
   require valid-user   //容许所有合法用户
   require user    //容许曾创建的用户名
   </Limit>

9.使apache的 日志 文件里不记录 图片 文件
  找到: LogFormat "%h %1 %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
        LogFormat "%h %1 %u %t "%r" %>s %b" cpmmon
        LogFormat "%{Referer}i -> %U" referer
        LogFormat "%{User-agent}i" agent
  再加上图片文件的类型
        SetEnvIf Rrquest_URI .gif$ gif-image
        SetEnvIf Rrquest_URI .GIF$ gif-image
        SetEnvIf Rrquest_URI .jpg$ gif-image
        SetEnvIf Rrquest_URI .JPG$ gif-image
        SetEnvIf Rrquest_URI .png$ gif-image
        SetEnvIf Rrquest_URI .js$ gif-image

  记日志时
        CustomLog /user/local/apache/logs/access.log combined env=!gif-image


《 ORACLE之APACHE虚拟服务器设置 》由 第二电脑网 原创提供,转载请注明: http://www.002pc.com/master/College/Server/Apache/17858.html

查看更多关于ORACLE之APACHE虚拟服务器设置|路径-Apache教程的详细内容...

  阅读:70次