suPHP en Debian 9 (Stretch), o en Windows WSL (Ubuntu)


REQUERIMIENTOS PREVIOS:
apt-get install apache2-dev build-essential autoconf automake libtool flex bison debhelper binutils 



DESCARGAR, PARCHEAR y COMPILAR:
cd /usr/local/src 
wget http://suphp.org/download/suphp-0.7.2.tar.gz
tar zxvf suphp-0.7.2.tar.gz
wget -O suphp.patch http://soft.cucurella.net/suphp.patch
patch -Np1 -d suphp-0.7.2 < suphp.patch
cd suphp-0.7.2
autoreconf -if
./configure --prefix=/usr/ --sysconfdir=/etc/suphp/ --with-apr=/usr/bin/apr-1-config --with-apache-user=www-data --with-setid-mode=owner --with-logfile=/var/log/suphp/suphp.log
make
make install



CONFIGURAR:
mkdir /var/log/suphp 
mkdir /etc/suphp


mcedit /etc/suphp/suphp.conf
[global] 
;Path to logfile
logfile=/var/log/suphp/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=www-data

;Path all scripts have to be in
docroot=/

;Path to chroot() to before executing script
;chroot=/mychroot

; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false

;Send minor error messages to browser
errors_to_browser=false

;PATH environment variable
env_path=/bin:/usr/bin

;Umask to set, specify in octal notation
umask=0022

; Minimum UID
min_uid=100

; Minimum GID
min_gid=100


[handlers]
; Handler for php-scripts
x-httpd-suphp="php:/usr/bin/php-cgi"
application/x-httpd-suphp="php:/usr/bin/php-cgi"

; Handler for CGI-scripts
x-suphp-cgi=execute:!self


echo "LoadModule suphp_module /usr/lib/apache2/modules/mod_suphp.so" > /etc/apache2/mods-available/suphp.load 


mcedit /etc/apache2/mods-available/suphp.conf
<IfModule mod_suphp.c> 
       AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml
       suPHP_AddHandler application/x-httpd-suphp

       <Directory />
              suPHP_Engine on
       </Directory>

       # By default, disable suPHP for debian packaged web applications as files
       # are owned by root and cannot be executed by suPHP because of min_uid.
       <Directory /usr/share>
              suPHP_Engine off
       </Directory>

       # # Use a specific php config file (a dir which contains a php.ini file)
       # suPHP_ConfigPath /etc/php5/cgi/suphp/
       # # Tells mod_suphp NOT to handle requests with the type <mime-type>.
       # suPHP_RemoveHandler <mime-type>
</IfModule>



a2enmod suphp 
a2dismod php7.0
service apache2 restart



 

 

add comment

 

all blogs        help  
 
© 2017, Carles Bataller - Disseny web cucurella.net