Re: 關¤_配置apache使用cgi for debian的問題!
On Wed, Aug 22, 2001 at 04:34:49PM +0800, wqinian rao wrote:
> 我按照東東兄的方法用apt-get install apache
> libapache-mod-perl把apache和mod_perl安裝好了,再用apacheconfig配置好了
> apache,已經能啟動了由于我是第一次配置APACHE使用CGI的所以不太清楚cgi程
> 序應該放在哪裡下面呢?我看的所有文章等,都是基于REDHAT和從soucre安裝來
> 配置的,但是按照書上的去用,就無法實現,有些文件目錄等都不在一個地方,
> 我自己也把那三個配置文件該試的都試了,還是行不通,不知道該如何配置呢?
> 光是看html文件就行,能在瀏覽器上顯示出來,但是CGI程序就不行!
自助方法:
1. 自行閱讀 /usr/doc/libapache-mod-perl/examples 以下的東西,
並要懂得靈活變通。例如,你的 /etc/apache/httpd.conf 可能就已經有
以下這樣的一段了:
<IfModule mod_perl.c>
Alias /perl/ /var/www/perl/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>
2. 為了安全起見,請先離線,以免范例的 *.pl 太暴露你系統的信息,
被外人見到。
3. 登錄為 root。假設你沒有 /var/www/perl 這個目錄:
# cd /var/www
# mkdir perl
# cp -av /usr/doc/libapache-mod-perl/examples/* perl/
# cd perl
# chmod +x *.pl
再依照 test.pl 的說明,在 /etc/apache/httpd.conf 適當的地方,加上:
PerlSendHeader On
# /etc/init.d/apache reload
4. 打開你的瀏覽器,往 http://localhost/perl/ ,再作測試。
5. 測試完畢, rm -rf /var/www/perl 後才好恢復連線,因為 registry.pl
等所顯示的資料太多,保密為妙。你以後可以把你的 *.pl 放在 /var/www/perl
底下,或修改 httpd.conf 讓 *.pl 在其他目錄也可以執行。
但要確保你的腳本夠安全,否則後果自負。這方面,要多多閱讀 Apache
相關的說明文件,要理解其概念和運作,單靠 cookbook 式記命令是不行的。
Hope this helps,
東東
--
Debian GNU/Linux Chinese Project ...... http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp ... http://www.olvc.ab.ca/
--
To UNSUBSCRIBE, email to debian-chinese-gb-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
--
| This message was re-posted from debian-chinese-gb@lists.debian.org
| and converted from gb2312 to big5 by an automatic gateway.
Reply to: