- 论坛徽章:
- 1
|
本帖最后由 dav_ 于 2014-07-18 10:56 编辑
我是悲情原PO
以下是我的/etc/apache2/sites-avaible/000-default.conf檔
- <VirtualHost *:80>
- # The ServerName directive sets the request scheme, hostname and port that
- # the server uses to identify itself. This is used when creating
- # redirection URLs. In the context of virtual hosts, the ServerName
- # specifies what hostname must appear in the request's Host: header to
- # match this virtual host. For the default virtual host (this file) this
- # value is not decisive as it is used as a last resort host regardless.
- # However, you must set it for any further virtual host explicitly.
- #ServerName www.example.com
- ServerAdmin webmaster@localhost
- DocumentRoot /var/www/html
- AddHandler cgi-script .cgi .pl
- ScriptAlias /var/www/html/cgi-bin/ /cgi-bin/
- <Directory "/var/www/html/cgi-bin">
- AllowOverride None
- Options +Indexes +ExecCGI +MultiViews +SymLinksIfOwnerMatch
- #Order allow,deny
- Require all granted
- Allow from all
- </Directory>
- ErrorLog ${APACHE_LOG_DIR}/error.log
- CustomLog ${APACHE_LOG_DIR}/access.log combined
- # For most configuration files from conf-available/, which are
- # enabled or disabled at a global level, it is possible to
- # include a line for only one particular virtual host. For example the
- # following line enables the CGI configuration for this host only
- # after it has been globally disabled with "a2disconf".
- #Include conf-available/serve-cgi-bin.conf
- </VirtualHost>
复制代码 我是用VirtualBox架设的,网络选择桥接适配卡,在外部用192.168.2.7能够正确显示/var/www/html/index.html档案
而将网址改为192.168.2.7/cgi-bin/exp1.pl 却显示500的错误
网络上查了一下,几个说法是说路径的权限没有开启,我检查却都正常,程序的权限也是可执行
- drwxr-xr-x 14 root root 4096 Jul 17 23:02 var/
- dav@dav:/var$ ll | grep www
- drwxr-xr-x 3 root root 4096 Jul 12 23:38 www/
- dav@dav:/var/www$ ll | grep html
- drwxr-xr-x 3 root root 4096 Jul 18 10:27 html/
- dav@dav:/var/www/html$ ll
- total 32
- drwxr-xr-x 3 root root 4096 Jul 18 10:27 ./
- drwxr-xr-x 3 root root 4096 Jul 12 23:38 ../
- -rw-r--r-- 1 root root 11510 Jul 15 15:53 backup_index.html
- drwxr-xr-x 2 root root 4096 Jul 18 10:14 cgi-bin/
- -r-xr-xr-x 1 root root 1478 Jul 15 16:11 exp1.pl*
- -rw-r--r-- 1 root root 382 Jul 18 10:27 index.html
- dav@dav:/var/www/html/cgi-bin$ ll
- total 12
- drwxr-xr-x 2 root root 4096 Jul 18 10:14 ./
- drwxr-xr-x 3 root root 4096 Jul 18 10:27 ../
- -r-xr-xr-x 1 root root 1472 Jul 18 10:14 exp1.pl*
复制代码 另一个说法是要到/etc/hosts加东西,但我实在看不懂要加甚么
这是我的/etc/hosts檔
- 127.0.0.1 localhost
- 127.0.1.1 dav.0.2.15 dav
- # The following lines are desirable for IPv6 capable hosts
- ::1 localhost ip6-localhost ip6-loopback
- ff02::1 ip6-allnodes
- ff02::2 ip6-allrouters
复制代码 无法进展.. 请各位知道的各位帮个忙
另外以下是我参考过的网站
http://perlmaven.com/perl-cgi-script-with-apache2
http://stackoverflow.com/questio ... un-perl-cgi-scripts
http://stackoverflow.com/questio ... tu-13-10-apache-2-4
|
|