<?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>x83.net &#187; apache</title>
	<atom:link href="http://www.x83.net/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.x83.net</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 13:53:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Plesk 10 nginx reverse proxy configuration in front of Apache</title>
		<link>http://www.x83.net/plesk-10-nginx-reverse-proxy-configuration-in-front-of-apache/</link>
		<comments>http://www.x83.net/plesk-10-nginx-reverse-proxy-configuration-in-front-of-apache/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 12:40:14 +0000</pubDate>
		<dc:creator>Giany</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[httpdmng]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[plesk 10]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[websrvmng]]></category>

		<guid isPermaLink="false">http://www.x83.net/?p=769</guid>
		<description><![CDATA[Plesk 10 nginx reverse proxy configuration On older Plesk version ( websrvmng &#8211;set-http-port &#8211;port=8080 Starting with Plesk 10 this is not so easy since you have to edit a php file called /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php. In my case instead of : domain-&#62;physicalHosting-&#62;ipAddress-&#62;address ?&#62;:server-&#62;webserver-&#62;httpsPort : $VAR-&#62;server-&#62;webserver-&#62;httpPort ?&#62;&#62; ServerName "domain-&#62;asciiName ?&#62;:server-&#62;webserver-&#62;httpsPort : $VAR-&#62;server-&#62;webserver-&#62;httpPort ?&#62;" I&#8217;ve set : &#160; &#60;VirtualHost [...]]]></description>
			<content:encoded><![CDATA[<p>Plesk 10 nginx reverse proxy configuration</p>
<p>On older Plesk version (</p>
<p><strong>websrvmng &#8211;set-http-port &#8211;port=8080</strong></p>
<p>Starting with Plesk 10 this is not so easy since you have to edit a php file called <em>/usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php</em>. In my case instead of :</p>
<p><code>domain-&gt;physicalHosting-&gt;ipAddress-&gt;address ?&gt;:<!--?php echo $OPT['ssl'] ? $VAR--->server-&gt;webserver-&gt;httpsPort : $VAR-&gt;server-&gt;webserver-&gt;httpPort ?&gt;&gt;<br />
ServerName "<!--?php echo $VAR--->domain-&gt;asciiName ?&gt;:<!--?php echo $OPT['ssl'] ? $VAR--->server-&gt;webserver-&gt;httpsPort : $VAR-&gt;server-&gt;webserver-&gt;httpPort ?&gt;"</code></p>
<p>I&#8217;ve set :</p>
<p>&nbsp;</p>
<p>&lt;VirtualHost &lt;?php echo $OPT['ipAddress']-&gt;escapedAddress ?&gt;:&lt;?php echo $OPT['ssl'] ? 8043 : 8080 ?&gt;&gt;<br />
ServerName &#8220;&lt;?php echo $VAR-&gt;domain-&gt;asciiName ?&gt;:&lt;?php echo $OPT['ssl'] ? 8043 : 8080 ?&gt;&#8221;</p>
<p><span style="font-family: monospace;"><br />
</span></p>
<p>Where 8043 will be the new https port and 8080 will be the http port.</p>
<p>After this change I had to run :</p>
<p><strong>/usr/local/psa/admin/bin/httpdmng &#8211;reconfigure-all</strong></p>
<p>Note that this is only for Plesk 10.x. On 9.x we used to have</p>
<p><strong>/usr/local/psa/admin/sbin/websrvmng &#8211;reconfigure-all</strong></p>
<p>After this make sure that the Apache server has set in its configuration files (/etc/httpd/conf/httpd.conf) Listen 8080 instead of Listen 80. Same thing for the /etc/httpd/conf.d/ssl.conf file, Listen 8043 instead of Listen 443.</p>
<p>Then you need to install nginx (yum install nginx) and download this zip file that these guys provided <a title="zip" href="http://www.grafxsoftware.com/download/nginx/nginx_setup.zip">http://www.grafxsoftware.com/download/nginx/nginx_setup.zip</a>. Furthermore you can check their <a title="Howto" href="http://www.grafxsoftware.com/faq.php/HOW-TO-configure-PLESK-with-NGinx-proxy-reverse/1/1/">http://www.grafxsoftware.com/faq.php/HOW-TO-configure-PLESK-with-NGinx-proxy-reverse/1/1/</a>.</p>
<p>Once downloaded run:</p>
<p><strong>sh generate_nginx_conf.sh</strong></p>
<p>Verify with &#8220;nginx -t&#8221; that there isn&#8217;t any error and finally restart the involved services :</p>
<p><strong>service httpd restart<br />
service nginx restart</strong></p>
<p>Make sure that 8043 and 8080 accept connections. (Note that its not necessary to change the https port).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x83.net/plesk-10-nginx-reverse-proxy-configuration-in-front-of-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing mod_suphp</title>
		<link>http://www.x83.net/installing-mod_suphp/</link>
		<comments>http://www.x83.net/installing-mod_suphp/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 22:32:21 +0000</pubDate>
		<dc:creator>Giany</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[chown]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[mod_suphp]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://www.x83.net/?p=715</guid>
		<description><![CDATA[Usually if you add a simple VirtualHost and set the DocumentRoot into on /home/ then its possible for some files not to be owned by that (e.g: uploaded images via web interface, php sessions..etc). A solution for this problem is to install mod_suphp which will make Apache to write in /home/ with permissions. To install [...]]]></description>
			<content:encoded><![CDATA[<p>Usually if you add a simple VirtualHost and set the <strong>DocumentRoot </strong>into on /home/<user> then its possible for some files not to be owned by that <user> (e.g: uploaded images via web interface, php sessions..etc).</p>
<p>A solution for this problem is to install mod_suphp which will make Apache to write in /home/<user> with <user> permissions. To install mod_suphp :</p>
<p><code> Download http://www.suphp.org/download/suphp-0.7.1.tar.gz<br />
tar zxvf suphp-0.7.1.tar.gz<br />
cd suphp-0.7.1<br />
yum install httpd-devel<br />
./configure --with-apxs=/usr/sbin/apxs --with-apache-user=httpd --with-logfile=/var/log/httpd/suphp.log --with-setid-mode=paranoid --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-php=/usr/bin/php-cgi --enable-SUPHP_USE_USERGROUP=yes<br />
make<br />
make install<br />
cd /etc/httpd/conf.d/<br />
mv php.conf php.conf.bk<br />
</code></p>
<p>Then create <strong>suphp.conf </strong>and put in it:<br />
<code><br />
LoadModule suphp_module modules/mod_suphp.so<br />
suPHP_Engine on<br />
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml<br />
<Directory /><br />
    suPHP_AddHandler application/x-httpd-php5<br />
</Directory></code></p>
<p>Then create <strong>/etc/suphp.conf</strong> and put in it:</p>
<p><code>; This file is parse anew by suPHP for each request<br />
; rather than being loaded once.</p>
<p>[global]<br />
;Path to logfile<br />
logfile=/var/log/httpd/suphp.log</p>
<p>;Loglevel<br />
loglevel=info</p>
<p>;User Apache is running as<br />
; MANDATORY<br />
webserver_user=apache</p>
<p>; Path all scripts have to be in<br />
; This works as a prefix when a trailing slash is not specified.<br />
; e.g. /home will match /home /home2 /home3 etc While /home/ will only match /home/<br />
;<br />
; Changing this to a more specific path will improve security<br />
docroot=/</p>
<p>;Path to chroot() to before executing script<br />
;chroot=/home</p>
<p>; Security options<br />
allow_file_group_writeable=true<br />
allow_file_others_writeable=true<br />
allow_directory_group_writeable=true<br />
allow_directory_others_writeable=true</p>
<p>; Check whether script is within DOCUMENT_ROOT<br />
; Does NOT perform this check on included scripts.<br />
; i.e. include_once("/test3.php"); works even though it's in the root directory<br />
;<br />
; Changing this to true will improve security but make all php userdir requests fail<br />
check_vhost_docroot=false</p>
<p>; Allow the user and group specified by a ~userdir request to override the<br />
; suPHP_UserGroup directive inside the source virtualhost<br />
;<br />
; Changing this to false will improve security but make some types of php userdir<br />
; requests fail<br />
;userdir_overrides_usergroup=true</p>
<p>; suPHP Paranoid mode checks that the target script UID and GID match<br />
; the UID and GID of the user running the script.  To disable these<br />
; checks change the following values to false.  Without these checks, mod_suphp<br />
; is effectively running in "Force" mode.<br />
;paranoid_uid_check=true<br />
;paranoid_gid_check=true</p>
<p>;Send minor error messages to browser<br />
errors_to_browser=false</p>
<p>;PATH environment variable<br />
env_path="/bin:/usr/bin"</p>
<p>;Umask to set, specify in octal notation<br />
umask=0022</p>
<p>; Minimum UID<br />
;min_uid=100</p>
<p>; Minimum GID<br />
;min_gid=100</p>
<p>; Normally suPHP only displays the PHP binary in process lists (ps aux).<br />
; Setting this option to 'true' will cause suPHP to display both the<br />
; PHP binary and the script filename.<br />
;full_php_process_display=true</p>
<p>[handlers]<br />
;Handler for php-scripts<br />
application/x-httpd-php="php:/usr/bin/php-cgi"<br />
application/x-httpd-php4="php:/usr/php4/bin/php-cgi"<br />
application/x-httpd-php5="php:/usr/bin/php-cgi"</p>
<p>;Handler for CGI-scripts<br />
;x-suphp-cgi="execute:!self"</p>
<p>[phprc_paths]<br />
;Uncommenting these will force all requests to that handler to use the php.ini<br />
;in the specified directory regardless of suPHP_ConfigPath settings.<br />
;application/x-httpd-php=/usr/local/lib/<br />
;application/x-httpd-php4=/usr/local/php4/lib/<br />
;application/x-httpd-php5=/usr/local/lib/</code></p>
<p>After this make sure that the VirtualHost contains :</p>
<p><code><br />
<IfModule mod_suphp.c><br />
                 suPHP_UserGroup user user<br />
    </IfModule></p>
<p>    <IfModule !mod_disable_suexec.c><br />
                SuexecUserGroup user user<br />
</IfModule></code></p>
<p>Also /etc/httpd/conf/httpd.conf should contain:</p>
<p><code>DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html<br />
</code></p>
<p>Finally do a <strong>service httpd restart</strong></p>
<p>Check /var/log/httpd/suphp.log and error_log for possible errors. In my case I noticed this:</p>
<blockquote><p>&#8220;[Fri Apr 22 14:36:55 2011] [warn] Mismatch between target UID (501) and UID (48) of file &#8220;/home/arpart/public_html/index.php&#8221;</p></blockquote>
<p>Which means that some files were not owned by <user>. Use <strong>chown -R user.user /home/user</strong> to fix the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x83.net/installing-mod_suphp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to autorestart httpd server if it fails</title>
		<link>http://www.x83.net/script-to-autorestart-httpd-server-if-it-fails/</link>
		<comments>http://www.x83.net/script-to-autorestart-httpd-server-if-it-fails/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 06:24:38 +0000</pubDate>
		<dc:creator>Giany</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[checkhttp.sh]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[ipcrm]]></category>
		<category><![CDATA[ipcs]]></category>
		<category><![CDATA[nobody]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[restartsrv_httpd]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.x83.net/?p=261</guid>
		<description><![CDATA[I use this script on a cpanel server..if output of pgrep command is 0 then the $restart command is issued #!/bin/bash restart=&#8221;/scripts/restartsrv_httpd&#8221; pgrep httpd &#124;&#124; $restart exit 0 If its a VPS then I might add to clear the Semaphore Arrays. for i in `ipcs -s &#124; grep nobody &#124; awk &#8216;{print $2}&#8217;`; do ipcrm [...]]]></description>
			<content:encoded><![CDATA[<p>I use this script on a cpanel server..if output of pgrep command is 0 then the $restart command is issued</p>
<blockquote><p>#!/bin/bash<br />
restart=&#8221;/scripts/restartsrv_httpd&#8221;<br />
pgrep httpd || $restart<br />
exit 0</p></blockquote>
<p>If its a VPS then I might add to clear the Semaphore Arrays.</p>
<blockquote><p>for i in `ipcs -s | grep nobody | awk &#8216;{print $2}&#8217;`; do ipcrm -s $i; done</p></blockquote>
<p>Then I put this script into Cron to run every 5 minutes.</p>
<blockquote><p># MIN HOUR DAYOFMONTH MONTH DAYOFWEEK COMMAND<br />
*/5 * * * * /root/checkhttp.sh
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.x83.net/script-to-autorestart-httpd-server-if-it-fails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

