Hi Hugo, on my fedora 12 php and perl cgi not work.... work only index.htm .....
ERROR:
tail -f /var/log/hiawatha/error.log
Thu 29 Apr 2010 10:49:44 +0200|127.0.0.2|/var/www/speedtest/download.php|access denied via filesystem
Thu 29 Apr 2010 10:53:07 +0200|127.0.0.2|/var/www/speedtest/download.php|access denied via filesystem
.
.
brief hiawatha.conf:
# Hiawatha main configuration file
#
# GENERAL SETTINGS
#
ServerId = www-data
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log
# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
Port = 80
Interface = 127.0.0.1
# MaxKeepAlive = 30
# TimeForRequest = 3,20
}
#
Binding {
Port = 80
Interface = 127.0.0.2
# MaxKeepAlive = 30
# TimeForRequest = 3,20
MaxRequestSize = 1024
}
# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications. Use the 'php-fcgi'
# tool to start PHP as a FastCGI daemon.
#
CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/php-cgi:php
CGIextension = cgi
#
# DEFAULT WEBSITE
# It is wise to use your IP address as the hostname of the default website
# and give it a blank webpage. By doing so, automated webscanners won't find
# your possible vulnerable website.
#
Hostname = 127.0.0.1
WebsiteRoot = /var/www/hiawatha
StartFile = index.html
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
#ErrorHandler = 404:/error.cgi
# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
Hostname = 127.0.0.2
WebsiteRoot = /var/www/speedtest
StartFile = index.htm
#AccessLogfile = /var/log/hiawatha/hotspotad/access.log
#ErrorLogfile = /var/log/hiawatha/hotspotad/error.log
ExecuteCGI = yes
#RequireSSL = yes
WrapCGI = speed
TimeForCGI = 20
}
cgi-wrapper.conf:
# CGI wrapper configuration
#
# Use the 'newroot' tool to copy applications to a chroot directory.
# CGIhandler = /path/to/cgi-handler
#
CGIhandler = /usr/bin/perl
CGIhandler = /usr/bin/php-cgi
#CGIhandler = /usr/bin/python
#CGIhandler = /usr/bin/ruby
#CGIhandler = /usr/bin/ssi-cgi
# Wrap = <wrap-id>;<cgiroot>;<userid>[:<group>]
#
#Wrap = nobody ; /var/www|nobody ; 65534:65534
#Wrap = somebody ; /var/www/site ; 1001:33,200,201
#Wrap = hugo ; ~hugo ; hugo
Wrap = speed ; /var/www/speedtest ; 501:501
brief /etc/passwd:
speed:x:5061:5061::/var/www/speedtest:/sbin/nologin
www-data:x:5068:5066::/var/www:/sbin/nologin
brief /etc/group:
speed:x:5061:
www-data:x:5066:
ls -l /var/www/speetest:
drwxr-xr-x. 2 root root 4096 29 apr 10:54 .
drwxr-xr-x. 9 root root 4096 29 apr 10:05 ..
-rw-r--r--. 1 speed speed 94 15 gen 2006 bar.gif
-rwxr-x---. 1 speed speed 910 7 feb 2006 CHANGELOG
-rwxr-x---. 1 speed speed 1620 7 feb 2006 common.php
-rwxr-x---. 1 speed speed 9497 7 feb 2006 download.php
-rw-r--r--. 1 speed speed 1180 29 apr 10:54 index.htm
-rwxr-x---. 1 speed speed 4268 7 feb 2006 INSTALL
-rw-r--r--. 1 speed speed 62967 6 feb 2006 payload.js
-rwxr-x---. 1 speed speed 5295 7 feb 2006 results.php
-rwxr-x---. 1 speed speed 4467 28 apr 21:02 speedtest.cfg
-rw-r--r--. 1 speed speed 248 7 feb 2006 style.css
-rw-r--r--. 1 speed speed 57 5 feb 2006 unallowed.html
-rwxr-x---. 1 speed speed 4750 7 feb 2006 upload.cgi
ls -l /usr/local/sbin:
-rwsr-xr-x. 1 root root 54256 28 feb 11:18 cgi-wrapper
-rwxr-xr-x. 1 root root 757376 28 feb 11:18 hiawatha
-rwxr-xr-x. 1 root root 2488 28 feb 11:18 newroot
-rwxr-xr-x. 1 root root 60381 28 feb 11:18 php-fcgi
-rwxr-xr-x. 1 root root 73146 28 feb 11:18 wigwam
mount tab on my system:
/dev/sda7 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/sda2 on /home type ext4 (rw,noexec,nosuid,nodev)
/dev/sda5 on /usr type ext4 (rw)
/dev/sda8 on /var type ext4 (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=100M,rootcontext="system_u:object_r:tmp_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
selinux disabled for tests..... sestatus:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted