<?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>Debian Tutorials &#187; php</title>
	<atom:link href="http://www.debiantutorials.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debiantutorials.com</link>
	<description>Copy/Paste tutorials for Debian Linux</description>
	<lastBuildDate>Wed, 18 Aug 2010 00:35:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install and configure MailWatch monitoring tool for MailScanner</title>
		<link>http://www.debiantutorials.com/install-and-configure-mailwatch-monitoring-tool-for-mailscanner/</link>
		<comments>http://www.debiantutorials.com/install-and-configure-mailwatch-monitoring-tool-for-mailscanner/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 00:35:59 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mailscanner]]></category>
		<category><![CDATA[mailwatch]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=349</guid>
		<description><![CDATA[MailWatch for MailScanner is a web-based front-end to MailScanner written in PHP, MySQL and JpGraph. It comes with a CustomConfig module for MailScanner which causes MailScanner to log all message data (excluding body text) to a MySQL database which is then queried by MailWatch for reporting and statistics. 
1. Install Apache2, MySql server and PHP5 [...]]]></description>
			<content:encoded><![CDATA[<p>MailWatch for MailScanner is a web-based front-end to MailScanner written in PHP, MySQL and JpGraph. It comes with a CustomConfig module for MailScanner which causes MailScanner to log all message data (excluding body text) to a MySQL database which is then queried by MailWatch for reporting and statistics. </p>
<p>1. Install Apache2, MySql server and PHP5 with required modules. You may already have some or all of these packages installed.</p>
<p><code>apt-get install apache2 php5-cli php5 mysql-server libdbd-mysql-perl php5-gd php5-mysql libapache2-mod-php5<br />
</code><span id="more-349"></span></p>
<p>2. Download the latest version of MailWatch</p>
<p><code>wget http://downloads.sourceforge.net/project/mailwatch/mailwatch/1.0.5/mailwatch-1.0.5.tar.gz<br />
</code></p>
<p><em>At the time this tutorial was written, version 1.0.5 was the latest version. Check this location for latest version: http://sourceforge.net/projects/mailwatch/files/</em></p>
<p>3. Extract and enter the mailwatch directory</p>
<p><code>tar zxvf mailwatch-1.0.5.tar.gz<br />
cd mailwatch-1.0.5<br />
</code></p>
<p>4. Create the database and tables</p>
<p><code>mysql -p < create.sql<br />
</code></p>
<p>5. Create a MySql user used for MailScanner logging (mysql -u root -p)</p>
<p><code>GRANT ALL ON mailscanner.* TO '{username}'@'localhost' IDENTIFIED BY '{password}';<br />
FLUSH PRIVILEGES;<br />
</code></p>
<p><em>Replace {username} and {password} with a username and password of choice.</em></p>
<p>6. Configure the MailScanner logger (pico MailWatch.pm)</p>
<p><code>my($db_user) = '{username}';<br />
my($db_pass) = '{password}';<br />
</code></p>
<p><em>On line 43 and 44, input your MySql user created in step 5</em></p>
<p>7. Move the MailScanner logger to correct directory</p>
<p><code>mv MailWatch.pm /usr/share/MailScanner/MailScanner/CustomFunctions/<br />
</code></p>
<p>8. Edit Mail Scanner config to enable MailWatch logger (pico /etc/MailScanner/MailScanner.conf)</p>
<p><code>Always Looked Up Last = &#038;MailWatchLogging<br />
</code></p>
<p>9. Create a MailWatch web admin user (mysql -u root -p)</p>
<p><code>USE mailscanner;<br />
INSERT INTO users VALUES ('{username}',md5('{password}'),'Administrator name','A','0','0','0','0','0');<br />
</code></p>
<p><em>Replace {username} and {password} with a username and password used to enter the web interface.</em></p>
<p>10. Move the web interface to the web server's root</p>
<p><code>mv mailscanner /var/www/mailwatch<br />
</code></p>
<p>11. Make the temp and cache directories writeable</p>
<p><code>chmod 777 /var/www/mailwatch/temp<br />
chmod 777 /var/www/mailwatch/images/cache<br />
</code></p>
<p>12. Copy the example config file</p>
<p><code>mv /var/www/mailwatch/conf.php.example /var/www/mailwatch/conf.php<br />
</code></p>
<p>13. Configure the web interface (pico /var/www/mailwatch/conf.php)</p>
<p><code>define('DB_USER', '{username}');<br />
define('DB_PASS', '{password}');<br />
define('MAILWATCH_HOME', '/var/www/mailscanner');<br />
</code></p>
<p><em>Type the MySql username and password created in step 5</em></p>
<p>14. Install PEAR PHP framework</p>
<p><code>apt-get install php-pear<br />
</code></p>
<p>15. Install required PEAR packages</p>
<p><code>pear install DB<br />
pear install DB_Pager<br />
pear install Mail_mimeDecode-1.5.1<br />
</code></p>
<p>16. On line 37, add /usr/share/php to the mailwatch include path (pico /var/www/mailwatch/functions.php)</p>
<p><code>ini_set('include_path','.:'.MAILWATCH_HOME.'/pear:'.MAILWATCH_HOME.'/fpdf:'.MAILWATCH_HOME.'/xmlrpc:/usr/share/php');<br />
</code></p>
<p>17. Restart Apache and MailScanner</p>
<p><code>/etc/init.d/apache2 restart<br />
/etc/init.d/mailscanner restart<br />
</code></p>
<p>18. You're all set. Enter the web interface at this location http://yourserver/mailwatch</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/install-and-configure-mailwatch-monitoring-tool-for-mailscanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PEAR framework and packages</title>
		<link>http://www.debiantutorials.com/installing-pear-framework-and-packages/</link>
		<comments>http://www.debiantutorials.com/installing-pear-framework-and-packages/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 17:36:49 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=345</guid>
		<description><![CDATA[PEAR is a framework and distribution system for reusable PHP components.
1. Install the PEAR framework
get install php-pear

2. Restart apache
/etc/init.d/apace2 restart

3. Install a PEAR package (optional)
pear install Net_Ping-2.4.5

You can install any PEAR package using this command but in this example we'll install the Net_Ping package
4. Here's a sample PHP code to use the Net_Ping package (optional)
require_once [...]]]></description>
			<content:encoded><![CDATA[<p>PEAR is a framework and distribution system for reusable PHP components.</p>
<p>1. Install the PEAR framework</p>
<p><code>get install php-pear<br />
</code><span id="more-345"></span></p>
<p>2. Restart apache</p>
<p><code>/etc/init.d/apace2 restart<br />
</code></p>
<p>3. Install a PEAR package (optional)</p>
<p><code>pear install Net_Ping-2.4.5<br />
</code></p>
<p><em>You can install any PEAR package using this command but in this example we'll install the Net_Ping package</em></p>
<p>4. Here's a sample PHP code to use the Net_Ping package (optional)</p>
<p><code>require_once "Net/Ping.php";<br />
$ping = Net_Ping::factory();<br />
&nbsp;<br />
$host = 'debiantutorials.com';<br />
$count = 3;<br />
&nbsp;<br />
if (PEAR::isError($ping))<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo $ping->getMessage();<br />
}<br />
else<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;$ping->setArgs(array('count' => $count));<br />
&nbsp;&nbsp;&nbsp;&nbsp;$res = $ping->ping($host);<br />
&nbsp;&nbsp;&nbsp;&nbsp;foreach ($res->_raw_data as $line)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $line . "\n";<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
</code></p>
<p><em>This code will ping the host debiantutorials.com three times and echo the results</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-pear-framework-and-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install XCache</title>
		<link>http://www.debiantutorials.com/install-xcache/</link>
		<comments>http://www.debiantutorials.com/install-xcache/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 23:08:53 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xcache]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=233</guid>
		<description><![CDATA[XCache is a fast, stable  PHP opcode cacher that has been tested and is now running on production servers under high load. It overcomes a lot of problems that has been with other competing opcachers such as being able to be used with new PHP versions.
1. Installing the XCache package
apt-get install php5-xcache

2. Restart Apache
/etc/init.d/apache2 [...]]]></description>
			<content:encoded><![CDATA[<p>XCache is a fast, stable  PHP opcode cacher that has been tested and is now running on production servers under high load. It overcomes a lot of problems that has been with other competing opcachers such as being able to be used with new PHP versions.</p>
<p>1. Installing the XCache package</p>
<p><code>apt-get install php5-xcache<br />
</code><span id="more-233"></span></p>
<p>2. Restart Apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
<p>That's it. XCache is now installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/install-xcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Zend Optimizer</title>
		<link>http://www.debiantutorials.com/installing-zend-optimizer/</link>
		<comments>http://www.debiantutorials.com/installing-zend-optimizer/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 09:26:05 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.net/?p=109</guid>
		<description><![CDATA[The Zend Optimizer enables you to run Zend Guard encoded files.
1. Download a copy of Zend Optimizer / Guard from the location below and put it into /tmp
http://www.zend.com/en/products/guard/downloads

2. Extract
cd /tmp
tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

Replace with your actual filename
3. Create a directory to contain Zend optimizer
mkdir /usr/local/lib/Zend

3. Move the Zend optimizer lib to a permanent location
mv ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/local/lib/Zend/

Your [...]]]></description>
			<content:encoded><![CDATA[<p>The Zend Optimizer enables you to run Zend Guard encoded files.</p>
<p>1. Download a copy of Zend Optimizer / Guard from the location below and put it into /tmp</p>
<p><code>http://www.zend.com/en/products/guard/downloads<br />
</code><span id="more-109"></span></p>
<p>2. Extract</p>
<p><code>cd /tmp<br />
tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz<br />
</code></p>
<p><em>Replace with your actual filename</em></p>
<p>3. Create a directory to contain Zend optimizer</p>
<p><code>mkdir /usr/local/lib/Zend<br />
</code></p>
<p>3. Move the Zend optimizer lib to a permanent location</p>
<p><code>mv ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/local/lib/Zend/<br />
</code></p>
<p><em>Your ZendOptimizer directory name may be different since it includes version numbers and platform. I'm using the 5_2_x_comp directory because I have PHP 5.2 installed.</em></p>
<p>4. Add reference to your php.ini file (pico /etc/php5/apache2/php.ini)</p>
<p><code>zend_extension = /usr/local/lib/Zend/ZendOptimizer.so<br />
zend_optimizer.optimization_level = 15<br />
</code></p>
<p>5. Restart apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-zend-optimizer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing ionCube</title>
		<link>http://www.debiantutorials.com/installing-ioncube/</link>
		<comments>http://www.debiantutorials.com/installing-ioncube/#comments</comments>
		<pubDate>Mon, 18 May 2009 21:57:43 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[ioncube]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://debiantutorials.net/?p=55</guid>
		<description><![CDATA[ionCube protects software written using the PHP programming language from being viewed, changed, and run on unlicensed computers.
1. Download ionCube loaders
wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

2. Extract
tar zxvf ioncube_loaders_lin_x86.tar.gz

3. Move to a permanent location
mv ioncube /usr/local/

4. Add reference to your php.ini file (pico /etc/php5/apache2/php.ini)
zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so

There are a few versions of the loader in the tar archive and you [...]]]></description>
			<content:encoded><![CDATA[<p>ionCube protects software written using the PHP programming language from being viewed, changed, and run on unlicensed computers.</p>
<p>1. Download ionCube loaders</p>
<p><code>wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz<br />
</code><span id="more-55"></span></p>
<p>2. Extract</p>
<p><code>tar zxvf ioncube_loaders_lin_x86.tar.gz<br />
</code></p>
<p>3. Move to a permanent location</p>
<p><code>mv ioncube /usr/local/<br />
</code></p>
<p>4. Add reference to your php.ini file (pico /etc/php5/apache2/php.ini)</p>
<p><code>zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so<br />
</code></p>
<p><em>There are a few versions of the loader in the tar archive and you can choose the one that suites your needs</em></p>
<p>5. Restart apache</p>
<p><code>/etc/init.d/apache2 restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-ioncube/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Install Lighttpd web server with PHP5 support using MySQL backend</title>
		<link>http://www.debiantutorials.com/install-lighttpd-web-server-with-php5-support-using-mysql-backend/</link>
		<comments>http://www.debiantutorials.com/install-lighttpd-web-server-with-php5-support-using-mysql-backend/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 22:29:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://debiantutorials.net/install-lighttpd-web-server-with-php5-support-using-mysql-backend/</guid>
		<description><![CDATA[Lighttpd is a web server which is designed to be secure, fast, standards-compliant, and flexible while being optimized for speed-critical environments. Its low memory footprint (compared to other web servers), light CPU load and its speed goals make lighttpd suitable for servers that are suffering load problems, or for serving static media separately from dynamic [...]]]></description>
			<content:encoded><![CDATA[<p>Lighttpd is a web server which is designed to be secure, fast, standards-compliant, and flexible while being optimized for speed-critical environments. Its low memory footprint (compared to other web servers), light CPU load and its speed goals make lighttpd suitable for servers that are suffering load problems, or for serving static media separately from dynamic content. lighttpd is free software / open source, and is distributed under the BSD license.</p>
<p>In this tutorial you will be guided through the installation process and to configure the web server to use MySQL backend.<span id="more-5"></span></p>
<p>First install the lighttpd package and the MySQL backend module<br />
<code>apt-get install lighttpd lighttpd-mod-mysql-vhost<br />
</code></p>
<p>Create a MySQL database, table and insert some sample data<br />
<code>mysql -u root -p<br />
&nbsp;<br />
GRANT SELECT ON lighttpd.* TO vhosts@localhost IDENTIFIED BY 'mypasswd';<br />
FLUSH PRIVILEGES;<br />
CREATE DATABASE lighttpd;<br />
USE lighttpd;<br />
&nbsp;<br />
CREATE TABLE vhosts (<br />
domain varchar(64) NOT NULL PRIMARY KEY,<br />
docroot varchar(128) NOT NULL<br />
);<br />
&nbsp;<br />
INSERT INTO vhosts VALUES ('test.com','/var/www/test.com/');<br />
INSERT INTO vhosts VALUES ('www.test.com','/var/www/test.com/');<br />
&nbsp;<br />
quit;<br />
</code></p>
<p>Create a configuration file for the mysql backend (pico /etc/lighttpd/conf-available/10-mysql-vhost.conf). Add the following lines:<br />
<code>server.modules += ( "mod_mysql_vhost" )<br />
&nbsp;<br />
mysql-vhost.db = "lighttpd"<br />
mysql-vhost.user = "vhosts"<br />
mysql-vhost.pass = "mypasswd"<br />
mysql-vhost.sock = "/var/run/mysqld/mysqld.sock"<br />
mysql-vhost.sql = "SELECT docroot FROM vhosts WHERE domain='?';"<br />
</code></p>
<p>Make sure you change the db, user and pass variables to a valid mysql user and database on the local server.</p>
<p>Enable the mysql backend module<br />
<code>ln /etc/lighttpd/conf-available/10-mysql-vhost.conf /etc/lighttpd/conf-enabled/10-mysql-vhost.conf<br />
</code></p>
<p>Install PHP5 packages<br />
<code>apt-get install php5-cgi php5-mysql php5-gd php5-imagick php5-imap php5-mcrypt php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl<br />
</code></p>
<p>Configure PHP5 to display correct values for PATH_INFO and PHP_SELF (pico /etc/php5/cgi/php.ini). Change the following variable found in your php.ini file:<br />
<code>cgi.fix_pathinfo = 1<br />
</code></p>
<p>Configure fastcgi to use PHP5 insted of the default PHP4 (pico /etc/lighttpd/conf-available/10-fastcgi.conf)<br />
<code>"bin-path" =&gt; "/usr/bin/php5-cgi",<br />
</code></p>
<p>Enable fastcgi/PHP5:<br />
<code>ln /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/10-fastcgi.conf<br />
</code></p>
<p>Restart the lighttpd web server:<br />
<code>/etc/init.d/lighttpd restart<br />
</code></p>
<p>Now you're all set and you should be able to browse to test.com. (make sure the host exists in DNS or has been placed in your local hosts file)</p>
<p>Lighttpd caches the vhost configurations until next restart so you'll have to restart lighttpd everytime a change is made in the MySQL database.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/install-lighttpd-web-server-with-php5-support-using-mysql-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
