免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3552 | 回复: 8

Perl文件作首页? [复制链接]

论坛徽章:
0
发表于 2003-03-04 12:50 |显示全部楼层
各位大侠帮忙:

  如何将.pl的文件作首页?

论坛徽章:
0
发表于 2003-03-04 13:42 |显示全部楼层

Perl文件作首页?

使用ssi功能即可。

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
发表于 2003-03-04 16:23 |显示全部楼层

Perl文件作首页?

httpd.conf
在首頁的目錄中加上
Options +ExecCGI
就好了...

论坛徽章:
0
发表于 2003-03-04 17:30 |显示全部楼层

Perl文件作首页?

谢谢两位大侠。

SSI我一点都不熟。

请问Apile大侠, 我已经在<Directory />;下面加了Options +ExecCGI,然后在WWW的根目录下有index.pl,并且已经加了AddHandler cgi-script .cgi .pl, 还将index.pl的mode设为777。但是在IE中输入http://<IP地址>;还不能自动执行index.pl,但有index.pl的文件列表。当单击index.pl时出现如下错误:

Forbidden
You don't have permission to access /index.pl on this server.


--------------------------------------------------------------------------------

Apache/1.3.20 Server at <全称域名>; Port 80

我该怎么办呢?

谢谢谢谢!!

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
发表于 2003-03-05 08:23 |显示全部楼层

Perl文件作首页?

WWW權限是否有設定成755??
不是加在<directory />;
應該是 <directory "/usr/local/apache2/htdocs">;
這裡...加上+ExecCGI.....
你加錯地方了...
另外..在DirectoryIndex 處加上 index.pl...
下次自然用http:/x.x.x.x/ 時就會找到...
記得改好厚...用apachectl restart..重新啟動apache...

论坛徽章:
0
发表于 2003-03-06 11:45 |显示全部楼层

Perl文件作首页?

一切都好了。Apile, 多谢多谢。 

论坛徽章:
0
发表于 2003-03-06 18:50 |显示全部楼层

Perl文件作首页?

Hi,

  问题又来了。将index.pl放在DocumentRoot目录下是没有问题,可以自动执行;

 但现在index.pl是在cgi-bin下面的一个目录中,我通过ScriptAlias功能将这一目录映射成另一目录,格式(大致)如:

  ScriptAlias /aa/  "/var/www/cgi-bin/aa/"
并在/var/www/cgi-bin/aa/目录的选项中设定了
  options +ExecCGI
      options Indexes FollowSymLinks

然后将首页aa.pl符号链接至index.pl
结果是:
  通过http://x.x.x.x/aa/index.pl可打开网页
但通过
  http://x.x.x.x/aa 或http://x.x.x.x/aa/都出现错误,
前者是“找不到网页”错误,后者是:

Forbidden
You don't have permission to access /aa/ on this server.


--------------------------------------------------------------------------------

Apache/1.3.20 Server at <FQDN>; Port 80



HELP!!!!

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
发表于 2003-03-06 19:13 |显示全部楼层

Perl文件作首页?

 options +ExecCGI
options Indexes FollowSymLinks
改成
options All
選項全部打開試試看...
如果不行..去看apache 的說明文件吧...
照理講options只能一行..
不能分兩行吧??我也是很不清楚..

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
发表于 2003-03-07 04:15 |显示全部楼层

Perl文件作首页?

不知是不是你需要设定DirectoryIndex

http://httpd.apache.org/docs/mod/mod_dir.html#directoryindex



Apache HTTP Server Version 1.3
Module mod_dir
This module provides for "trailing slash" redirects and serving directory index files.

Status: Base
Source File: mod_dir.c
Module Identifier: dir_module

Summary
The index of a directory can come from one of two sources:
A file written by the user, typically called index.html. The DirectoryIndex directive sets the name of this file. This is controlled by mod_dir.
Otherwise, a listing generated by the server. This is provided by mod_autoindex.
The two functions are separated so that you can completely remove (or replace) automatic index generation should you want to.
A "trailing slash" redirect is issued when the server receives a request for a URL http://servername/foo/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/foo/dirname/.

Directives
DirectoryIndex

--------------------------------------------------------------------------------

DirectoryIndex directive
Syntax: DirectoryIndex local-url [local-url] ...
Default: DirectoryIndex index.html
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_dir
The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the a directory name. Local-url is the (%-encoded) URL of a document on the server relative to the requested directory; it is usually the name of a file in the directory. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.

Example:

DirectoryIndex index.html
then a request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or would list the directory if it did not.
Note that the documents do not need to be relative to the directory;

DirectoryIndex index.html index.txt /cgi-bin/index.pl
would cause the CGI script /cgi-bin/index.pl to be executed if neither i

ndex.html or index.txt existed in a directory
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP