<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="http://www.booservers.com/styles/rss.css" type="text/css"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns="http://my.netscape.com/rdf/simple/0.9/"
>

 <channel>
  <title>Booservers - All about dedicated servers</title>
  <link>http://www.booservers.com</link>
  <description></description>
 </channel>
    <item>
   <title>Using fail2ban to ban abusive IP&#039;s for SSH and Apache</title>
   <description>&lt;p&gt;How to automatically ban abusive ip&#039;s using fail2ban&lt;/p&gt;&lt;p&gt;Originally from Ensim 4.0; similar steps had to be taken after the upgrade to 4.0.2; I would assume the same follows until python 2.3 is included [it may already be; corrections welcome].&lt;/p&gt;&lt;p&gt;Fail2Ban scans log files like /var/log/pwdfail or /var/log/apache/error_log and bans IP that makes too many password failures. It updates firewall rules to reject the IP address.&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;&lt;a href=&quot;http://fail2ban.sourceforge.net/&quot;&gt;http://fail2ban.sourceforge.net/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;RPM version can be obtained from here;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://fail2ban.sourceforge.net/rpm...1jik.noarch.rpm&quot;&gt;http://fail2ban.sourceforge.net/rpm...1jik.noarch.rpm&lt;/a&gt;&lt;/p&gt;&lt;p&gt;For those of you / us who do not have python2.3; it is required.&lt;br /&gt;You can snag an rpm for your system here:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.python.org/2.3.5/rpms.html&quot;&gt;http://www.python.org/2.3.5/rpms.html&lt;/a&gt;&lt;br /&gt;I used the following version for Red Hat EL3.&lt;/p&gt;&lt;p&gt;python2.3-2.3.5-4pydotorg.i386.rpm&lt;/p&gt;&lt;p&gt;Python will require db4. The following url has satisfactory versions for different systems.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://rpm.pbone.net/index.php3?sta...h=db4&amp;amp;srodzaj=3&quot;&gt;http://rpm.pbone.net/index.php3?sta...h=db4&amp;amp;srodzaj=3&lt;/a&gt;&lt;br /&gt;I used the following version for Red Hat EL3.&lt;/p&gt;&lt;p&gt;db4-4.2.52-6.i386.rpm&lt;/p&gt;&lt;p&gt;# The following would then be performed as root&lt;/p&gt;&lt;p&gt;1) cd /root; mkdir fail2ban&lt;/p&gt;&lt;p&gt;2) do you have python 2.3?&lt;br /&gt;&#039;which python&#039; or if you have tab completion enabled type in &#039;pyth&#039; and hit tab two or three times, it should pop up as &#039;python2.3&#039;. &lt;/p&gt;&lt;p&gt;3) wget &lt;a href=&quot;http://fail2ban.sourceforge.net/rpm...1jik.noarch.rpm&quot;&gt;http://fail2ban.sourceforge.net/rpm...1jik.noarch.rpm&lt;/a&gt;&lt;/p&gt;&lt;p&gt;4) rpm -i fail2ban-0.6.0-ljik.noarch.rpm&lt;/p&gt;&lt;p&gt;5) nano -w /etc/fail2ban.conf&lt;/p&gt;&lt;p&gt;6) change the following items&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;[DEFAULT]&lt;br /&gt;# Option:  background&lt;br /&gt;# Notes.:  start fail2ban as a daemon. Output is redirect to logfile.&lt;br /&gt;# Values:  [true | false]  Default:  false&lt;br /&gt;#&lt;br /&gt;background = true&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;change :: background = true&lt;br /&gt;# This is so we can start it as a service when the machine comes up&lt;/p&gt;&lt;p&gt;6a) You can also have email sent to you by changing&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;[MAIL]&lt;br /&gt;# Option:  enabled&lt;br /&gt;# Notes.:  enable mail notification when banning an IP address.&lt;br /&gt;# Values:  [true | false]  Default:  false&lt;br /&gt;#&lt;br /&gt;enabled = true&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;change :: enabled = true&lt;br /&gt;And then inputting an email address below. Most of the configuration is dead simple for a machine you haven&#039;t change the logging facilities on.&lt;/p&gt;&lt;p&gt;You may also wish to add this to the end of the failregex.&lt;/p&gt;&lt;p&gt;|Did not receive identification &lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;# Option:  failregex&lt;br /&gt;# Notes.:  regex to match the password failures messages in the logfile.&lt;br /&gt;# Values:  TEXT  Default:  Authentication failure|Failed password|Invalid user&lt;br /&gt;#&lt;br /&gt;failregex = Authentication failure|Failed password|Invalid user|Did not receive identification&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;7) Start the service&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;# service fail2ban start&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;8) Make sure it comes up with the system&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;# chkconfig --level 2345 fail2ban on&lt;/p&gt;&lt;p&gt;----------------------------&lt;/p&gt;&lt;p&gt;9) Test it from a spare ip (if you have one, if not the ban is lifted after the time set in the conf file [600 seconds standard]).&lt;/p&gt;&lt;p&gt;9a) Use screen to &#039;tail -f /var/log/fail2ban.log&#039;&lt;br /&gt;9b) Use bad logins from an untrusted ip to test for actual banning, email output.&lt;br /&gt;9c) If this fails, use the debug option in /etc/fail2ban.conf&lt;/p&gt;&lt;p&gt;10) Enjoy not one, but two less headaches as apache / ssh scanners, spammers and crackers are locked out of your box. With out too much work you could append a script that would either dump the logs and make repeat offenders banned permenantly, or roll some other solution for your own needs up. Enjoy, and please post any corrections.&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/32_using_fail2ban_to_ban_abusive_ips_for_ssh_and_apache.html</link>
      <pubDate>Thu, 15 Dec 2005 21:24:21 +0000</pubDate>   
  </item>
    <item>
   <title>Install/Upgrade Apache 2.0</title>
   <description>&lt;p&gt;FRESH INSTALL&lt;/p&gt;&lt;p&gt;This part of the how-to is for a clean install only, for upgrades please scroll down.&lt;/p&gt;&lt;p&gt;Make a copy of your current httpd.conf incase you need to roll-back&lt;/p&gt;&lt;p&gt;cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_back &lt;/p&gt;&lt;p&gt;Download The Apache Tar.Gz File&lt;br /&gt;wget &lt;a href=&quot;http://www.tux.org/pub/net/apache/d...d-2.0.47.tar.gz&quot;&gt;http://www.tux.org/pub/net/apache/d...d-2.0.47.tar.gz&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Extract The File To Your Server&lt;br /&gt;tar -xz -f httpd* &lt;/p&gt;&lt;p&gt;Move Into The Extracted Folder&lt;br /&gt;cd httpd*&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;Run The Configuration File, (The bits following ./configure were custom wrote by me, you may customise these how you wish)&lt;br /&gt;./configure --prefix=/usr/local/apache --with-php --with-mysql --with-susexec --enable-mods-shared=all --disable-info&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Run The Make File&lt;br /&gt;make &lt;/p&gt;&lt;p&gt;Run The Install Make File&lt;br /&gt;make install &lt;/p&gt;&lt;p&gt;-----------------------------------&lt;br /&gt;Apache 2.0 is now installed on your system. The four lines below are certain security measures that can be taken to hide the identity of apache. *These are optional* &lt;/p&gt;&lt;p&gt;Edit The http.conf File&lt;br /&gt;pico -w /usr/local/apache/conf/httpd.conf &lt;/p&gt;&lt;p&gt;Disable Apache Signatures (Security)&lt;br /&gt;Locate ServerSignature and change to off &lt;/p&gt;&lt;p&gt;Add the line below, after ServerSignature off&lt;br /&gt;ServerTokens ProductOnly&lt;/p&gt;&lt;p&gt;Save httpd.conf&lt;br /&gt;CTRL + X then &amp;quot;Y&amp;quot; then &amp;quot;enter&amp;quot; without the &amp;quot;&#039;s&lt;/p&gt;&lt;p&gt;-----------------------------------&lt;/p&gt;&lt;p&gt;Start Your New Apache&lt;br /&gt;/usr/local/apache/bin/apachectl start &lt;/p&gt;&lt;p&gt;Your sites should now be working. &lt;/p&gt;&lt;p&gt;Please scroll down to the bottom of the page, after performing the commands above&lt;/p&gt;&lt;p&gt;------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;UPGRADE&lt;/p&gt;&lt;p&gt;Make a copy of your current httpd.conf incase you need to roll-back&lt;br /&gt;cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_back &lt;/p&gt;&lt;p&gt;Download The Apache Tar.Gz File&lt;br /&gt;wget &lt;a href=&quot;http://www.tux.org/pub/net/apache/d...d-2.0.47.tar.gz&quot;&gt;http://www.tux.org/pub/net/apache/d...d-2.0.47.tar.gz&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Extract The File To Your Server&lt;br /&gt;tar -xz -f httpd* &lt;/p&gt;&lt;p&gt;Move Into The Extracted Folder&lt;br /&gt;cd httpd* &lt;/p&gt;&lt;p&gt;Run The Configuration File&lt;br /&gt;./config.nice &lt;/p&gt;&lt;p&gt;Run The Make File&lt;br /&gt;make &lt;/p&gt;&lt;p&gt;Run The Install Make File&lt;br /&gt;make install &lt;/p&gt;&lt;p&gt;Start Apache&lt;br /&gt;/usr/local/apache/bin/apachectl restart &lt;/p&gt;&lt;p&gt;&lt;br /&gt;------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;All done, you should now have a successfully upgraded/installed apache configuration. &lt;/p&gt;&lt;p&gt;Credits: &lt;a href=&quot;http://www.serveguard.com&quot;&gt;http://www.serveguard.com&lt;/a&gt; &lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/23_installupgrade_apache_20.html</link>
      <pubDate>Thu, 15 Dec 2005 20:58:01 +0000</pubDate>   
  </item>
    <item>
   <title>Forward domain.com to www.domain.com</title>
   <description>&lt;p&gt;For getting my domain.com to forward to &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt; automatically.&lt;/p&gt;&lt;p&gt;&amp;lt;keywords&amp;gt;&lt;br /&gt;Here is how to get domain.com to auto automatically forward to &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt; add www to my url rewrite my url from mydomain.com to &lt;a href=&quot;http://www.mydomain.com&quot;&gt;www.mydomain.com&lt;/a&gt; httpd.conf configure redirect url to &#039;www.&#039;&lt;br /&gt;&amp;lt;/keywords&amp;gt;&lt;/p&gt;&lt;p&gt;edit: /usr/local/apache/conf/httpd.conf&lt;/p&gt;&lt;p&gt;(ignore my line numbers)&lt;br /&gt;Make a backup of your original httpd.conf file in case you screw it up. You&#039;ll be able to swap em back out and get things live again in a hurry.&lt;/p&gt;&lt;p&gt;Find the domain.com VirtualHost entry you want to fix:&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;----------------------&lt;/p&gt;&lt;p&gt;   1301 &amp;lt;VirtualHost xx.xx.xx.xx&amp;gt;&lt;br /&gt;   1302 ServerAlias &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt; domain.com&lt;br /&gt;   1303 ServerAdmin &lt;a href=&quot;mailto:webmaster@domain.com&quot;&gt;webmaster@domain.com&lt;/a&gt;&lt;br /&gt;   1304 DocumentRoot /home/myuser/public_html&lt;br /&gt;   1305 BytesLog domlogs/domain.com-bytes_log&lt;br /&gt;   1306 ServerName &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt;&lt;br /&gt;   1307 ScriptAlias /cgi-bin/ /home/myuser/public_html/cgi-bin/&lt;br /&gt;   1309 User myuser&lt;br /&gt;   1310 Group myuser&lt;br /&gt;   1311 CustomLog domlogs/domain.com combined&lt;br /&gt;   1312 &amp;lt;/VirtualHost&amp;gt;&lt;/p&gt;&lt;p&gt;----------------------&lt;/p&gt;&lt;p&gt;Double it by copying/pasting the block and modify as detailed below:&lt;/p&gt;&lt;p&gt;----------------------&lt;/p&gt;&lt;p&gt;&lt;br /&gt;   1301 &amp;lt;VirtualHost xx.xx.xx.xx&amp;gt;&lt;br /&gt;   1302 #ServerAlias &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt; domain.com&lt;br /&gt;   1303 ServerAdmin &lt;a href=&quot;mailto:webmaster@domain.com&quot;&gt;webmaster@domain.com&lt;/a&gt;&lt;br /&gt;   1304 DocumentRoot /home/myuser/public_html&lt;br /&gt;   1305 BytesLog domlogs/domain.com-bytes_log&lt;br /&gt;   1306 ServerName &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt;&lt;br /&gt;   1307 ScriptAlias /cgi-bin/ /home/myuser/public_html/cgi-bin/&lt;br /&gt;   1309 User myuser&lt;br /&gt;   1310 Group myuser&lt;br /&gt;   1311 CustomLog domlogs/domain.com combined&lt;br /&gt;   1312 &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;   1313 &lt;br /&gt;   1314 &amp;lt;VirtualHost xx.xx.xx.xx&amp;gt;&lt;br /&gt;   1315 #ServerAlias &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt; domain.com&lt;br /&gt;   1316 ServerAdmin &lt;a href=&quot;mailto:webmaster@domain.com&quot;&gt;webmaster@domain.com&lt;/a&gt;&lt;br /&gt;   1317 DocumentRoot /home/myuser/public_html&lt;br /&gt;   1318 BytesLog domlogs/domain.com-bytes_log&lt;br /&gt;   1319 ServerName domain.com&lt;br /&gt;   1320 ScriptAlias /cgi-bin/ /home/myuser/public_html/cgi-bin/&lt;br /&gt;   1321 Redirect / &lt;a href=&quot;http://www.domain.com&quot;&gt;http://www.domain.com&lt;/a&gt;&lt;br /&gt;   1322 User myuser&lt;br /&gt;   1323 Group myuser&lt;br /&gt;   1324 CustomLog domlogs/domain.com combined&lt;br /&gt;   1325 &amp;lt;/VirtualHost&amp;gt;&lt;/p&gt;&lt;p&gt;----------------------&lt;/p&gt;&lt;p&gt;What to do:&lt;br /&gt;- comment out (or delete) the &#039;ServerAlias&#039; lines of each since there aren&#039;t any needs for aliases now.&lt;br /&gt;- change the line: &amp;quot;ServerName &lt;a href=&quot;http://www.domain.com&quot;&gt;www.domain.com&lt;/a&gt;&amp;quot; to &amp;quot;ServerName domain.com&amp;quot; so it can be forwarded.&lt;br /&gt;- added the whole line: &amp;quot;Redirect / &lt;a href=&quot;http://www.domain.com&quot;&gt;http://www.domain.com&lt;/a&gt;&amp;quot; to the domain.com VirtualHost to do the fowarding.&lt;/p&gt;&lt;p /&gt;</description>
   <link>http://www.booservers.com/archivo/22_forward_domaincom_to_wwwdomaincom.html</link>
      <pubDate>Thu, 15 Dec 2005 20:54:10 +0000</pubDate>   
  </item>
    <item>
   <title>HOW-TO: Apache + (phpsuexec, not required) + php4 (mod_php4 or cgi) + php5 (cgi)</title>
   <description>&lt;p&gt;HOW-TO updated to reflect 5.0.4 update to 5.0.5&lt;/p&gt;&lt;p&gt;Finally I have confirmed that this setup works!&lt;/p&gt;&lt;p&gt;I&#039;m using Apache 1.3.33 (1.3.34 out, but it will not broke anything) + phpsuexec coming with cPanel + custom php 4.3.11 compiled as cgi (actually you may use the Apache Update via WHM to compile working php4 in cgi mode/phpsuexec) + custom php 5.0.5 compiled as cgi (it is easy to do as well, I will explain)&lt;/p&gt;&lt;p&gt;php5 works the same as php4 and it saves the permissions and etc. E.g. no problems with nobody as well.&lt;/p&gt;&lt;br/&gt;&lt;center&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-7209259988091090&quot;;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = &quot;300x250_as&quot;;
google_ad_type = &quot;text_image&quot;;
google_ad_channel =&quot;3498328464&quot;;
google_color_border = &quot;FFFFFF&quot;;
google_color_bg = &quot;FFFFFF&quot;;
google_color_link = &quot;006633&quot;;
google_color_url = &quot;000000&quot;;
google_color_text = &quot;0033CC&quot;;
//--&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
  src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;/center&gt;&lt;br&gt;&lt;p&gt;1. Make sure you has Apache installed and workind with php4. It doesn&#039;t matter if you run mod_php4 or php4/phpsuexec, but I recommend to have phpsuexec based install (Warning: if you are running mod_php4 and would like to switch to phpsuexec, read the threads in this forum or you may end up with numerous broken scripts!);&lt;/p&gt;&lt;p&gt;2. You would need to compile php 5. To do this use the SSH sessing logged as root.&lt;br /&gt;Then execute preparation commands (based on cPanel for better compatibility):&lt;br /&gt;---------------------------&lt;/p&gt;&lt;p&gt;/scripts/checkccompiler&lt;br /&gt;rm -rf /home/cpphpbuild&lt;br /&gt;mkdir /home/cpphpbuild&lt;br /&gt;cd /home/cpphpbuild&lt;br /&gt;wget &lt;a href=&quot;http://layer1.cpanel.net/buildapache/1/php-5.0.5.tar.gz&quot;&gt;http://layer1.cpanel.net/buildapache/1/php-5.0.5.tar.gz&lt;/a&gt;&lt;br /&gt;tar xfzv php-5.0.5.tar.gz&lt;br /&gt;cd php-5.0.5&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;Make sure that we do enabled Sendmail support:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;echo &amp;quot;#define HAVE_SENDMAIL 1&amp;quot; &amp;gt;&amp;gt; /home/cpphpbuild/php-5.0.5/main/php_config.h&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;It is recommended to apply the mail-header patch which allows to track the script which sent an email. You may skip this step.&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;wget &lt;a href=&quot;http://choon.net/opensource/php/php-5.0.5-mail-header.patch&quot;&gt;http://choon.net/opensource/php/php-5.0.5-mail-header.patch&lt;/a&gt;&lt;br /&gt;patch -p1 &amp;lt; /home/cpphpbuild/php-5.0.5/php-5.0.5-mail-header.patch&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;Then one of the most important steps. It is the configuring of the php. It would be better if you undestand these options. You may use the configure from your existing php. To get them type the following:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;php -i | grep configure | sed &amp;quot;s/&#039;//g&amp;quot;&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;You will get the almost clean configure you are currently using. The several important hints on this.&lt;br /&gt;a) REMOVE the &amp;quot;--with-apxs=/usr/local/apache/bin/apxs&amp;quot; from the line. We are going to compile CGI version and it WILL broke the Apache!&lt;/p&gt;&lt;p&gt;b) Make sure you have the following prefixes and suffixes to install to the proper directories - otherwise currently installed php could be broken:&lt;br /&gt;--prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --program-suffix=5&lt;/p&gt;&lt;p&gt;c) Add the necessary options for proper CGI redirects from Apache:&lt;br /&gt;--enable-force-cgi-redirect --enable-discard-path&lt;/p&gt;&lt;p&gt;The result line will looks like this (please, do not use it - it has no CURL and PostgreSQL support - you better to follow steps above):&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;./configure --prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --program-suffix=5 --with-xml --enable-bcmath --enable-calendar --enable-ftp --with-gd --enable-exif --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-imap --with-imap-ssl --with-kerberos --enable-mbstring --with-mbstring=all --enable-mbstr-enc-trans --with-mcrypt --with-mhash --enable-magic-quotes --with-mysql=/usr --with-openssl --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-versioning --with-zlib --with-pspell --with-gettext --enable-inline-optimization --disable-debug --enable-force-cgi-redirect --enable-discard-path&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;So, we are ready to start the compiling. Execute &amp;quot;make install&amp;quot; and it starts...&lt;br /&gt;If the process fails for any reason, carefully read the errors - usually they are self-explaining. In MOST cases errors are because of the inproper configure params.&lt;/p&gt;&lt;p&gt;Then run the cPanel script to complete:&lt;br /&gt;/scripts/findphpversion&lt;/p&gt;&lt;p&gt;The compiled version of php should be copied to the cPanel cgi-sys:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;cp -f /usr/local/php5/bin/php5 /usr/local/cpanel/cgi-sys/php5&lt;br /&gt;chown root:wheel /usr/local/cpanel/cgi-sys/php5&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;Our installation has no php.ini file yet. On MOST systems Zend Optimizer installed. In this case you may just create the symlink:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;ln -s /usr/local/Zend/etc/php.ini /usr/local/php5/lib/php.ini&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;Otherwise copy the default php.ini and edit it if needed:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;cp -p /home/cpphpbuild/php-5.0.5/php.ini-recommended /usr/local/php5/lib/php.ini&lt;br /&gt;chown root.root /usr/local/php5/lib/php.ini&lt;br /&gt;chmod 644 /usr/local/php5/lib/php.ini&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;It is recommended to add the following line to the php.ini at the bottom (it is a MUST if you compile php4 instead php5!):&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;cgi.fix_pathinfo        = 1     ; needed for CGI/FastCGI mode&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;We are almost done. Now we need to add several lines to Apache.&lt;/p&gt;&lt;p&gt;Run editor (you may use &amp;quot;vi&amp;quot; or &amp;quot;pico -w&amp;quot;):&lt;br /&gt;pico -w /usr/local/apache/conf/httpd.conf&lt;/p&gt;&lt;p&gt;Scroll down (better use the built-in search) to the &amp;quot;&amp;lt;IfModule mod_dir.c&amp;gt;&amp;quot;&lt;br /&gt;There we should to add index.php5 after index.jp, but before index.php4. Result would looks like this:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;&amp;lt;IfModule mod_dir.c&amp;gt;&lt;br /&gt;DirectoryIndex index.html index.wml index.cgi index.shtml index.jsp index.js index.jp index.php5 iindex.php4 index.php3 index.php index.phtml ndex.htm default.htm default.html home.htm&lt;br /&gt;&amp;lt;/IfModule&amp;gt;&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;This to allow index.php5 as index file.&lt;/p&gt;&lt;p&gt;Continue editing. Find the &amp;quot;AddType application/x-httpd-php .phtml&amp;quot; and after it add this:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;Action application/x-httpd-php5 &amp;quot;/cgi-sys/php5&amp;quot;&lt;br /&gt;AddType application/x-httpd-php5 .php5&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;This is the directives for Apache to use own php5 for files with extensions .php5&lt;/p&gt;&lt;p&gt;Check if we could find this line &amp;quot;ScriptAlias /cgi-sys/ /usr/local/cpanel/cgi-sys/&amp;quot;&lt;br /&gt;If not - add it or our directive will not work. By default cPanel add this line. Just to warn you.&lt;/p&gt;&lt;p&gt;Save the file and quit.&lt;/p&gt;&lt;p&gt;Verify that you not broke the Apache config by running:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;service httpd configtest&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;You SHOULD to get &amp;quot;Syntax OK&amp;quot; at the end and possible some minor warnings about &amp;quot;NameVirtualHost directive&amp;quot; - it is OK.&lt;br /&gt;Warning: if you get ERROR - DO NOT RESTART APACHE AND LOCATE THE ISSUE. Otherwise Apache will not start at all!&lt;/p&gt;&lt;p&gt;When you make sure it is OK restart the Apache:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;service httpd stop&lt;br /&gt;service httpd startssl&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;Check that Apache come ok:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;lynx --dump &lt;a href=&quot;http://localhost/whm-server-status&quot;&gt;http://localhost/whm-server-status&lt;/a&gt;;&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;It will show you the Apache status.&lt;/p&gt;&lt;p&gt;Well, I should congratulate you - you have done it!&lt;/p&gt;&lt;p&gt;To test php5 upload the simple php file with the following content to any of your sites and name this file phpinfo.php AND ANOTHER COPY phpinfo.php5:&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;phpinfo();&lt;br /&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;---------------------------&lt;/p&gt;&lt;p&gt;Then launch browser and point to phpinfo.php file first to see that php4 still OK, then open phpinfo.php5 to see that php5 is OK.&lt;/p&gt;&lt;p&gt;DONE!&lt;/p&gt;&lt;p&gt;ADDON:&lt;br /&gt;If you need to use php5 for applications hardcoded with .php extensions you could to add the magic line to the VirtualHost directive of this account:&lt;br /&gt;AddHandler application/x-httpd-php5 .php .php4 .php3 .phtml&lt;br /&gt;(.php5 already using php5, but you may add it if you wish)&lt;/p&gt;&lt;p&gt;This will redirect all php, php3, php4 and php5 (as it set default globally) to the php5.&lt;/p&gt;&lt;p&gt;If you need to leave the option of running php4 on .php4 files do this:&lt;br /&gt;AddHandler application/x-httpd-php5 .php .php3 .phtml .php5&lt;/p&gt;&lt;p&gt;But for those lazy folks there are an option to have these AddHandlers in the .htaccess files!&lt;br /&gt;Just add the respective line (example, with no quotes: &amp;quot;AddHandler application/x-httpd-php5 .php .php4 .php3 .phtml&amp;quot;) to the .htaccess and this directory and all its subdirectories would be able to use the php5 for chosen files!&lt;/p&gt;&lt;p&gt;This is awesome when you need to test some scripts. In this way create two directories:&lt;br /&gt;/public_html/directory1&lt;br /&gt;/public_html/directory2&lt;br /&gt;And in the directory2 place .htaccess with:&lt;br /&gt;AddHandler application/x-httpd-php5 .php .php4 .php3 .phtml&lt;/p&gt;&lt;p&gt;As a result you run php4 on .php in the directory1 and run php5 on .php in the directory2!&lt;/p&gt;&lt;p&gt;So it is very flexible and it all depends on how you would like to process php.&lt;/p&gt;&lt;p&gt;Credits: &lt;a href=&quot;http://isprohosting.com&quot; target=&quot;_blank&quot;&gt;ISProHosting.com&lt;/a&gt;&lt;/p&gt;</description>
   <link>http://www.booservers.com/archivo/5_apache_php_4_php5.html</link>
      <pubDate>Wed, 30 Nov 2005 21:18:31 +0000</pubDate>   
  </item>
  </rdf:RDF>
