<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Temporini Matteo &#187; mod_suphp</title>
	<atom:link href="http://www.temporini.net/category/mod_suphp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.temporini.net</link>
	<description>It&#039;s time to fix!</description>
	<lastBuildDate>Fri, 10 Sep 2010 11:30:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Configurare suphp con Apache</title>
		<link>http://www.temporini.net/configurare-suphp-con-apache</link>
		<comments>http://www.temporini.net/configurare-suphp-con-apache#comments</comments>
		<pubDate>Mon, 16 Jul 2007 17:31:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[mod_suphp]]></category>
		<category><![CDATA[suphp]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.temporini.net/archives/36</guid>
		<description><![CDATA[<p>Questo modulo per apache serve a risolvere un problema che da sempre crea non pochi problemi legati alla gestione dei permessi tramite apache.</p>
<p>Infatti solitamene si incappa nel problema che caricando un file tramite uno script in php ad esempio, l&#8217;ownership del file caricato viene cambiata, rendendo di fatto difficoltosa la gestione dello stesso tramite ftp che [...]]]></description>
			<content:encoded><![CDATA[<p>Questo modulo per <strong>apache </strong>serve a risolvere un problema che da sempre crea non pochi problemi legati alla gestione dei permessi tramite apache.</p>
<p>Infatti solitamene si incappa nel problema che caricando un file tramite uno script in php ad esempio, l&#8217;ownership del file caricato viene cambiata, rendendo di fatto difficoltosa la gestione dello stesso tramite ftp che risulta essere associato ad un altro utente.</p>
<p>Stiamo parlando di <strong>hosting </strong>condivisi multiutente che lavorano tramite <strong>virtualhost</strong></p>
<p>Installare <strong>suphp </strong>su fedora core 5</p>
<p>Basta semplicemente installare <strong>mod_suphp</strong></p>
<p><em>[root@backup ~]# yum install mod_suphp</em></p>
<p>e configurare i file<br />
/etc/httpd/conf.d/php.conf<br />
/etc/httpd/conf.d/mod_suphp.conf<br />
/etc/suphp.conf</p>
<p>NEl file /etc/httpd/conf.d/php.conf fare attenzione a commentare questa riga</p>
<p><em>#AddHandler php5-script .php</em></p>
<p>in modo da togliere all&#8217;interprete di default il php</p>
<p>Nel file /etc/httpd/conf.d/mod_suphp.conf aggiungere</p>
<p><em>AddHandler x-httpd-php .php</em></p>
<p>e decommentare le righe</p>
<p><em>LoadModule suphp_module modules/mod_suphp.so</em></p>
<p><em>suPHP_Engine on<br />
suPHP_AddHandler x-httpd-php</em></p>
<p>Infine nel file /etc/suphp.conf cambiare il parametro</p>
<p><em>umask=0022</em></p>
<p>con i prmessi desiderati per i file creati dagli script.</p>
<p>Inoltre modificare le security optoins come segue</p>
<p><em> ; Security options<br />
;allow_file_group_writeable=false<br />
allow_file_group_writeable=true<br />
allow_file_others_writeable=false<br />
;allow_directory_group_writeable=false<br />
allow_directory_group_writeable=true<br />
allow_directory_others_writeable=false</em></p>
<p>e mettere i minimum UID e GUD con quelli di apache pe mantenere la compatibilità con eventuali script con l&#8217;ownership di apache<br />
in fedora il 48 corrisponde all&#8217;utente apache, bisogna mettere zero altrimenti ci son problemi con phpmyadmin che gira come root, oppure bisogna studiare una soluzione alternativa che non tratto in questo documento.</p>
<p><em> ; Minimum UID<br />
min_uid=0</em></p>
<p><em>; Minimum GID<br />
min_gid=0</em></p>
<p>Inoltre bisogna mettere a false questo sennò da problemi con mysql.domain.tld per il mysql</p>
<p><em>;Check wheter script is within DOCUMENT_ROOT<br />
check_vhost_docroot=false</em></p>
<p>Di seguito trovate i tre file di configurazione.</p>
<p><em>###########################<br />
/etc/httpd/conf.d/php.conf#<br />
###########################<br />
#<br />
# PHP is an HTML-embedded scripting language which attempts to make it<br />
# easy for developers to write dynamically generated webpages.<br />
#</em></p>
<p><em>LoadModule php5_module modules/libphp5.so</em></p>
<p><em>#<br />
# Cause the PHP interpreter to handle files with a .php extension.<br />
#<br />
#AddHandler php5-script .php<br />
AddType text/html .php</em></p>
<p><em>#<br />
# Add index.php to the list of files that will be served as directory<br />
# indexes.<br />
#<br />
DirectoryIndex index.php</em></p>
<p><em>#<br />
# Uncomment the following line to allow PHP to pretty-print .phps<br />
# files as PHP source code:<br />
#<br />
#AddType application/x-httpd-php-source .phps</em></p>
<p><em>#################################<br />
/etc/httpd/conf.d/mod_suphp.conf#<br />
#################################<br />
# This is the Apache server configuration file providing suPHP support..<br />
# It contains the configuration directives to instruct the server how to<br />
# serve php pages while switching to the user context before rendering.<br />
# For directives see &lt;URL:http://httpd.apache.org/docs-2.0/mod/mod_suphp.html&gt;</em></p>
<p><em>LoadModule suphp_module modules/mod_suphp.so<br />
AddHandler x-httpd-php .php</em></p>
<p><em># To use suPHP to parse PHP-Files</em></p>
<p><em># This option tells mod_suphp if a PHP-script requested on this server (or<br />
# VirtualHost) should be run with the PHP-interpreter or returned to the<br />
# browser &#8220;as it is&#8221;.<br />
### Uncomment to activate mod_suphp<br />
suPHP_Engine on<br />
suPHP_AddHandler x-httpd-php</em></p>
<p><em># This option tells mod_suphp which path to pass on to the PHP-interpreter<br />
# (by setting the PHPRC environment variable).<br />
# Do *NOT* refer to a file but to the directory the file resists in.<br />
#<br />
# E.g.: If you want to use &#8220;/path/to/server/config/php.ini&#8221;, use &#8220;suPHP_Config<br />
# /path/to/server/config&#8221;.<br />
#<br />
# If you don&#8217;t use this option, PHP will use its compiled in default path.<br />
#suPHP_ConfigPath /etc</em></p>
<p><em>################<br />
/etc/suphp.conf#<br />
################<br />
[global]<br />
;Path to logfile<br />
logfile=/var/log/suphp.log</em></p>
<p><em>;Loglevel<br />
loglevel=info</em></p>
<p><em>;User Apache is running as<br />
webserver_user=apache</em></p>
<p><em>;Path all scripts have to be in<br />
docroot=/</em></p>
<p><em>;Path to chroot() to before executing script<br />
;chroot=/mychroot</em></p>
<p><em>; Security options<br />
;allow_file_group_writeable=false<br />
allow_file_group_writeable=true<br />
allow_file_others_writeable=false<br />
;allow_directory_group_writeable=false<br />
allow_directory_group_writeable=true<br />
allow_directory_others_writeable=false</em></p>
<p><em>;Check wheter script is within DOCUMENT_ROOT<br />
check_vhost_docroot=true</em></p>
<p><em>;Send minor error messages to browser<br />
errors_to_browser=true</em></p>
<p><em>;PATH environment variable<br />
env_path=/bin:/usr/bin</em></p>
<p><em>;Umask to set, specify in octal notation<br />
;umask=0077<br />
umask=0022</em></p>
<p><em>; Minimum UID<br />
min_uid=500</em></p>
<p><em>; Minimum GID<br />
min_gid=500</em></p>
<p><em>; Use correct permissions for mod_userdir sites<br />
handle_userdir=true</em></p>
<p><em>[handlers]<br />
;Handler for php-scripts<br />
x-httpd-php=php:/usr/bin/php-cgi</em></p>
<p><em>;Handler for CGI-scripts<br />
x-suphp-cgi=execute:!self</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.temporini.net/configurare-suphp-con-apache/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
