Apache config on centos (suexec) - (13)Permission denied

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
ewestland
TestLink user
Posts: 2
Joined: Sat Jan 03, 2009 3:39 am

Apache config on centos (suexec) - (13)Permission denied

Post by ewestland »

Hello,

I am trying to install under apache on centos and encountering the following errors loading the install page (/testlink/install/index.php). I tried to ignore them and completed the install (1.8 RC2), but these problems were rampant and the UI was missing functionality.

I have read some posts about suexec and php suggesting to chmod 755 or 644, but unless I missed the proper combination that didn't work.

Any help would be GREATLY appreciated...

Code: Select all

[notice] SELinux policy enabled; httpd running as context psuser_u:system_r:unconfined_t
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
...
[notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[notice] Apache configured -- resuming normal operations
[error] [client 192.168.1.137] (13)Permission denied: exec of '/var/www/testlink/install/css/style.css' failed, referer: http://host1.someplace.com/testlink/install/index.php
[error] [client 192.168.1.137] Premature end of script headers: style.css, referer: http://host1.someplace.com/testlink/install/index.php
[error] [client 192.168.1.137] (13)Permission denied: exec of '/var/www/testlink/install/img/dot.gif' failed, referer: http://host1.someplace.com/testlink/install/index.php
[error] [client 192.168.1.137] Premature end of script headers: dot.gif, referer: http://host1.someplace.com/testlink/install/index.php
From /etc/httpd/conf/httpd.conf

Code: Select all

ScriptAlias /testlink/ "/var/www/testlink/"

<Directory "/var/www/testlink">
    Order allow,deny
    Allow from all
</Directory>
Yum was used to do the installations

Code: Select all

httpd.x86_64          2.2.3-11.el5_2.centos.
php-mysql.x86_64   5.1.6-20.el5_2.1
mysql.x86_64         5.0.45-7.el5
From pinfo.php()

Code: Select all

PHP Version 5.1.6

Configure Command
 './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/usr/share/file/magic.mime' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' 

additional .ini files parsed
/etc/php.d/dbase.ini, /etc/php.d/gd.ini, /etc/php.d/ldap.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini 
Thanks in advance,
Erik
ewestland
TestLink user
Posts: 2
Joined: Sat Jan 03, 2009 3:39 am

Post by ewestland »

Well, I am getting closer to diagnosing (one of?) the problem(s). It appears that I have an issue rendering static content from the testlink directory.

This is clearly an apache/selinux issue (likely httpd.conf), so I will try posting there. I will include the cross-post link for future testlink users delpoying on selinux, but if anyone has any pointers, it would be appreciated.

Working php scripts:

Code: Select all

http://host1.someplace.com/pinfo.php (WORKS)
http://host1.someplace.com/testlink/pinfo.php (WORKS)

erik@host1:/var/www] $ ls -laZ ./html/pinfo.php
-rwxr-xr-x  root root user_u:object_r:httpd_sys_content_t ./html/pinfo.php
[erik@host1:/var/www] $ ls -laZ ./testlink/pinfo.php
-rwxr-xr-x  root root user_u:object_r:httpd_sys_content_t ./testlink/pinfo.php
Failing static content:

Code: Select all

http://host1.someplace.com/eow.gif (WORKS)
http://host1.someplace.com/icons/eow.gif (WORKS)

http://host1.someplace.com/testlink/eow.gif (FAILS)
Leads to the following in /etc/httpd/logs/error_log
[Sat Jan 03 01:23:09 2009] [error] [client 10.1.10.137] (13)Permission denied: exec of '/var/www/testlink/eow.gif' failed
[Sat Jan 03 01:23:09 2009] [error] [client 10.1.10.137] Premature end of script headers: eow.gif

Failures using testlink UI:
[Sat Jan 03 00:45:53 2009] [error] [client 10.1.10.137] (13)Permission denied: exec of '/var/www/testlink/gui/themes/default/css/testlink.css' failed, referer: http://host1.someplace.com/testlink/lib/testcases/listTestCases.php?feature=edit_tc
[Sat Jan 03 00:45:53 2009] [error] [client 10.1.10.137] Premature end of script headers: testlink.css, referer: http://host1.someplace.com/testlink/lib/testcases/listTestCases.php?feature=edit_tc

The apache docs ( http://wiki.apache.org/httpd/13PermissionDenied ) state that:
"Error 13 indicates a filesystem permissions problem. That is, Apache was denied access to a file or directory due to incorrect permissions. It does not, in general, imply a problem in the Apache configuration files."

I tried twiddling both the standard and extended permissions on the file in the testlink directory (to match the one in 'html'), but that didn't fix the problem.

Code: Select all

[erik@host1:/var/www] $ ls -alZ html/eow.gif
-rw-r--r--  root root user_u:object_r:httpd_sys_content_t html/eow.gif
[erik@host1:/var/www] $ ls -alZ testlink/eow.gif
-rw-r--r--  root root user_u:object_r:httpd_sys_content_t testlink/eow.gif
Other notes:
  • I am not using the PHP version recommended by testlink (5.1.6 vs 5.2), but I ~hope~ this isn't going to cause additional pain. I would happily update it, but the yum repos I am using doesn't contain 5.2. If this is important, I will do it by hand. Thoughts?

    I came across a post mentioning that pinfo.php might be using the built-in (?) engine rather than the compiled one. So, I might still encounter issues once the static reference stuff is resolved. Does this ring a bell for anyone?
Thanks again,
Erik
havlatm
Member of TestLink Community
Posts: 940
Joined: Mon Oct 31, 2005 1:24 am
Location: Czech

Post by havlatm »

I recommend you to use PHP 5.2 (required by EXT-JS component).
I used successfully the next repository:
http://www.jasonlitka.com/2007/06/01/up ... nd-centos/
Assure that you will have mysql and gd library with your Apache.

Code: Select all

[error] [client 192.168.1.137] (13)Permission denied: exec of '/var/www/testlink/install/css/style.css' failed, referer: http://host1.someplace.com/testlink/install/index.php 
It seems that apache user has not access to this file. Use chmod or chown to fix it. Otherwise Apache configuration doesn't support this extension of files.
Post Reply