Issues related to compiling apache, php etc..Files uploaded with php scripts are owned by apache – how to install suPhp

Issues related to compiling apache, php etc..Files uploaded with php scripts are owned by apache – how to install suPhp

When a php file is in its default state “CLI”, php scripts will run as the apache user.
If there any files are uploaded or created with php, then those files will be saved as the apache user.

If there you would like to have php then run as the system user instead of “apache”, then you would need to install suPhp.

For doing so, type, after the “./build update_data” command, use this:

 

 

 

 

Please Note that all logs for suPhp are stored in:
/var/log/suphp.log

If there you get any “Internal Server Error” messages, check the suphp.log to see why.
Usually, the things like writeable by “all” or “group” … or have the incorrect ownership of the file would cause this.
Please Note that directories can not be tune  to 777 with suPhp.  755 is usually the max permissions for directories (you do not need 777 with suphp since php writes as the User).
Files should be no more than 644, but php files can be 600 since they are read in by the User (security benefit with suPhp).
All files/folders must be chown to the user, and not to apache.

Important:

Please Note that the safe_mode and open_basedir settings in Admin Level -> Php Safemode Config only apply to php CLI, not suPhp.

If there you want open_basedir and safe_mode, use this guide to enable a per-user php.ini file.

You may there need to rewrite the webapps php scripts to reset the ownerships if you get internal server errors with them, eg:

 

 

 

[warn] (2)No such file or directory: Failed to enable the ‘dataready’ Accept Filter

If there you get the following error in your apache log:

[warn] (2)No such file or directory: Failed to enable the ‘dataready’ Accept Filter

Then add:

accf_data_load=”YES”

to your /boot/loader.confand run:

kldload accf_data.ko

Curl Compile Error: ../lib/.libs/libcurl.so: undefined reference to `idna_to_ascii_lz@LIBIDN_1.0′

If you are getting a curl compile error similar to this one:

/bin/sh ../libtool –tag=CC –mode=link
c  -g0 -O2 -Wno-system-headers   -o curl  main.o hugehelp.o urlglob.o
writeout.o writeenv.o getpass.o homedir.o curlutil.o os-specific.o
strtoofft.o strdup.o rawstr.o nonblock.o  ../lib/libcurl.la -lz
libtool: link: gcc -g0 -O2 -Wno-system-headers -o .libs/curl main.o
hugehelp.o urlglob.o writeout.o writeenv.o getpass.o homedir.o curlutil.o
os-specific.o strtoofft.o strdup.o rawstr.o nonblock.o

 

 

 

 

 

 

 

`stringprep_locale_charset@LIBIDN_1.0′
collect2: ld returned 1 exit status
make[2]: *** [curl] Error 1
make[2]: Leaving directory
`/usr/local/directadmin/custombuild/curl-7.20.0/src’
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/usr/local/directadmin/custombuild/curl-7.20.0/src’
make: *** [all-recursive] Error 1

it there you would mean that you are missing the libidn files.  To add them, type:

yum install libidn libidn-devel

and compile again.

Leave a Reply

Your email address will not be published. Required fields are marked *