Issues related to compiling apache, php etc.. Adding custom modules to apache for custombuild

Issues related to compiling apache, php etc.. Adding custom modules to apache for custombuild, If you want to add any extra modules to apache in custombuild, they’ll need to be compiled in.

For Any module that needs to be compiled it will have a –with- type flag which will need to be used. To add this flag, run the following:

cd /usr/local/directadmin/custombuild
mkdir -p custom/ap2
cp configure/ap2/configure.apache custom/ap2/configure.apache
vi custom/ap2/configure.apache

#add your –with-module line to the end of the file,
# and to make sure this character exist at the end of all lines except the latest one.

./build clean
./build apache

Then try restart apache:
RedHat:

/sbin/service httpd restart

FreeBSD:

/usr/local/etc/rc.d/httpd restart

Debian:

/etc/init.d/httpd restart

you may also need to recompile php as well If you face some problems :

./build php

Then try restart Apache again.

Files uploaded with php scripts are owned by apache – how to install suPhp

We are recommending you using php-fpm, or mod_ruid2+mod_php for User owned files to be upload by php.


When php is in it’s default state “CLI”, php scripts run as the apache user.
If there any files are uploading or creating with php, then the files will be save as the apache user.

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

suPhp is an option that can be set when installing the custombuild script:

To do so, type, after the “./build update_data” command, use this:

 

 

 

Now Note that all logs for suPhp are store in:
/var/log/suphp.log

If there you get any “Internal Server Error” messages, check the suphp.log to see why.
Usually, things like write-able by “all” or “group” … or having the incorrect ownership of the file would cause this.
Please Note that directories can not be set 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 not more than 644, but php files can be 600 since they are reading in by the User (security benefit with suPhp).
All the files/folders must be chown to the user, and not with Apache.

Important:

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

You may need to rewrite the web-apps php scripts to reset the ownership’s if you are getting internal server errors with them, eg:

Leave a Reply

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