<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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/"
	>

<channel>
	<title>How to install Webhosting Guide</title>
	<link>http://www.howtoinstall.net</link>
	<description>Apache  PHP Mysql  Bind DNS Yum</description>
	<pubDate>Mon, 09 Jul 2007 08:47:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>Cpanel mysql5 and php5 how to</title>
		<link>http://www.howtoinstall.net/2007/07/09/cpanel-mysql5-and-php5-how-to/</link>
		<comments>http://www.howtoinstall.net/2007/07/09/cpanel-mysql5-and-php5-how-to/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 08:46:11 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>AdminTutorials</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2007/07/09/cpanel-mysql5-and-php5-how-to/</guid>
		<description><![CDATA[I updated today to mysql5 and php5 .. and I ran into one problem&#8230;. the sql server would not start
after installing I was getting:
Starting MySQLCouldn't find MySQL manager or server        [FAILED]
1st! how to install mysql5 and php5 with cpanel (with out having cpanel downgrade you automatically)
(read below)
* login [...]]]></description>
			<content:encoded><![CDATA[<p>I updated today to mysql5 and php5 .. and I ran into one problem&#8230;. the sql server would not start<br />
after installing I was getting:</p>
<p><code class="bb-code">Starting MySQLCouldn't find MySQL manager or server        [FAILED]</code></p>
<p>1st! how to install mysql5 and php5 with cpanel (with out having cpanel downgrade you automatically)<br />
(read below)</p>
<p>* login to the WHM interface, and from “Server Configuration / Tweak Settings” choose in the “MySQL” section the 5.0 radio button. (This will actually run the script: <span style="font-weight: bold">/scripts/mysqlup</span> that will download and install the latest MySQL5 rpms available at that time.)</p>
<p>* After completion as instructed you should rebuild your perl mysql libraries and rebuild apache (to have php build against the newly installed mysql library).</p>
<p><code class="bb-code">/scripts/perlinstaller --force Bundle::DBD::mysql</code></p>
<p>* On the WHM interface and from &#8220;Software&#8221; choose &#8220;Apache Update&#8221; and make sure you select the version of php that you want (in this case 5.21, I also select CURL) and <span style="font-weight: bold">rebuild</span> (this will take some time) (if you have php5 already installed you can just run from your commandline:</p>
<p><code class="bb-code">/scripts/easyapache</code></p>
<p>and you are done&#8230;.<br />
But in my case &#8230; when I tried to run mysql I had a problem&#8230;</p>
<p><code>/etc/init.d/mysql start<br />
Starting MySQLCouldn't find MySQL manager or server        [FAILED]</code></p>
<p>to fix this I had to edit <span style="font-weight: bold">/etc/my.cnf</span></p>
<p><code>[mysqld]<br />
datadir=/var/lib/mysql<br />
socket=/var/lib/mysql/mysql.sock<br />
# Default to using old password format for compatibility with mysql 3.x<br />
# clients (those using the mysqlclient10 compatibility package).<br />
old_passwords=1</code></p>
<p>[mysql.server]<br />
user=mysql<br />
<span style="font-weight: bold">#basedir=/var/lib  <--- COMMENT OUT THIS LINE</span><br />
old-passwords = 1</p>
<p>[mysqld_safe]<br />
log-error=/var/log/mysqld.log<br />
pid-file=/var/run/mysqld/mysqld.pid</p>
<p>the line <span style="font-weight: bold">basedir=/var/lib </span>was causing the error and in case you are having the same problem commenting out that line will solve the problem and MySQL will start properly.</p>
<p>thanks for <a title="Read carlos's latest blog entries." class="blog_usernames_blog" href="http://carlosrivero.com/blog/carlos">carlos&#8217;s blog</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2007/07/09/cpanel-mysql5-and-php5-how-to/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix Apache - No space left on device: Couldn&#8217;t create accept lock or Cannot create SSLMutex</title>
		<link>http://www.howtoinstall.net/2007/07/09/fix-apache-no-space-left-on-device-couldnt-create-accept-lock-or-cannot-create-sslmutex/</link>
		<comments>http://www.howtoinstall.net/2007/07/09/fix-apache-no-space-left-on-device-couldnt-create-accept-lock-or-cannot-create-sslmutex/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 08:41:00 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>Apache</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2007/07/09/fix-apache-no-space-left-on-device-couldnt-create-accept-lock-or-cannot-create-sslmutex/</guid>
		<description><![CDATA[When dealing with mem-leaks in my mod_perl-apps I ran into a curious apache-problem. After a while apache could not be started but failed with strange errors like:
[emerg] (28)No space left on device: Couldn&#8217;t create accept lock
or
[crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed
or
[Wed Dec 07 00:00:09 2005] [error] (28)No space [...]]]></description>
			<content:encoded><![CDATA[<p>When dealing with mem-leaks in my mod_perl-apps I ran into a curious apache-problem. After a while apache could not be started but failed with strange errors like:<br />
[emerg] (28)No space left on device: Couldn&#8217;t create accept lock<br />
or<br />
[crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed<br />
or<br />
[Wed Dec 07 00:00:09 2005] [error] (28)No space left on device: Cannot create SSLMutex<br />
There was definitely enough space on the device where the locks are stored (default /usr/local/apache2/logs/). I tried to explicetely different Lockfiles using the LockFile-directive but this did not help. I also tried a non-default AcceptMutex (flock) which then solved the acceptlock-issue and ended in the rewrite_log_lock-issue.<br />
Only reboot of the system helped out of my crisis.<br />
Solution: There were myriads of semaphore-arrays left, owned by my apache-user.<br />
<code>ipcs -s | grep apache</code><br />
Removing this semaphores immediately solved the problem.<br />
<code>ipcs -s | grep apache | perl -e 'while (&lt;STDIN&gt;) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'</code></p>
<p>or with theese command</p>
<p>ipcs -s | grep  apache  | awk &#8216; { print $2 } &#8216; | xargs ipcrm sem</p>
<p>thank you for this helpful Article to <a target="_blank" href="http://carlosrivero.com/fix-apache---no-space-left-on-device-couldnt-create-accept-lock">Carlosrivero</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2007/07/09/fix-apache-no-space-left-on-device-couldnt-create-accept-lock-or-cannot-create-sslmutex/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Apache, MySQL, and PHP on Linux</title>
		<link>http://www.howtoinstall.net/2007/01/20/installing-apache-mysql-and-php-on-linux/</link>
		<comments>http://www.howtoinstall.net/2007/01/20/installing-apache-mysql-and-php-on-linux/#comments</comments>
		<pubDate>Sun, 21 Jan 2007 00:03:01 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>Apache</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2007/01/20/installing-apache-mysql-and-php-on-linux/</guid>
		<description><![CDATA[This tutorial is designed to guide you through the initial steps of setting up Apache, MySQL, and PHP on Linux. The Linux distribution being utilized for this tutorial is Fedora Core 1, however the steps should be very similar across most distributions. This tutorial makes the assumption that you have the required development tools loaded [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is designed to guide you through the initial steps of setting up <a href="http://www.apache.org/"><font color="#ff0000">Apache</font></a>, <a href="http://www.mysql.com/" target="_blank"><font color="#ff0000">MySQL</font></a>, and <a href="http://www.php.net/" target="_blank"><font color="#ff0000">PHP</font></a> on <a href="http://www.linux.org/" target="_blank"><font color="#ff0000">Linux</font></a>. The Linux distribution being utilized for this tutorial is <a href="http://fedora.redhat.com/" target="_blank"><font color="#ff0000">Fedora Core 1</font></a>, however the steps should be very similar across most distributions. This tutorial makes the assumption that you have the required <span lang="en-US">development</span> tools loaded for compiling programs from source, these tools are beyond the scope of this document and will not be covered here. Also, it assumes you can use the <strong>vi</strong> text editor for basic editing tasks.</p>
<p> </p>
<p><font size="+0">Apache, MySQL, and PHP have become one of the most utilized combinations for <span lang="en-US">developing</span> content driven websites. They are robust, flexible, provide a decent level of security, and they are available for many different platforms. That being said, lets get to building a <span lang="en-US">web server.</span></font></p>
<p><font size="+0"><span lang="en-US"><font size="+0">The first thing you need to do is obtain the sourceballs for each package, we will be compiling each package from scratch here, and, while there are also binary packages available for some distributions, I find your end results are usually better when building each package for your machine. Make sure you get the source files.</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Here are the links and the package versions available at the time this tutorial was written</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>Apache</strong><br />
<strong>URL : </strong><a href="http://httpd.apache.org/download.cgi" target="_blank"><font color="#ff0000">http://httpd.apache.org/download.cgi</font></a><br />
<strong>Current Version - </strong>2.0.48</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>MySQL</strong><br />
<strong>URL : </strong><a href="http://www.mysql.com/downloads/mysql-4.0.html" target="_blank"><font color="#ff0000">http://www.mysql.com/downloads/mysql-4.0.html</font></a><br />
<strong>Current Version - </strong>4.0.16</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>PHP</strong><br />
<strong>URL : </strong><a href="http://www.php.net/downloads.php" target="_"blank""><font color="#ff0000">http://www.php.net/downloads.php</font></a><br />
<strong>Current Version - </strong>4.3.4</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Ok, so you&#8217;ve got the files now what ?, well now the fun begins..</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>Installation - </strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">The first thing we need to do is extract the sourceballs so we can work with the files included in them. Beginning now we will be working as root, so open a terminal window, change to the directory in which you saved your downloaded files and become root by issuing the <strong>su</strong> command, enter the root password and you should be good to go.</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">To extract the sourceballs type the following commands;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#tar -zxf httpd-2.0.48.tar.gz (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#tar -zxf mysql-4.0.16.tar.gz (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#tar -zxf php-4.3.4.tar.gz (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">The commands above will extract the sourceballs into their own separate directories. Now lets move on to compiling the source into <span lang="en-US">usable</span> programs. We&#8217;ll start with Apache.</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>Compiling Apache - </strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Change into the directory created when you untarred the sourceball as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd httpd-2.0.48 (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Follow this command by typing;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#./configure &#8211;prefix=/usr/local/apache2 &#8211;enable-mods-shared=most (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">This tells Apache to install in the <strong>/usr/local/apache2</strong> directory, and to build most of the available loadable modules. There are a ton of options with Apache, but these should work for the most part. Once the configure is done and the system returns the prompt to you, issue the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#make</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">This will take a few minutes, once the prompt comes back again issue the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#make install</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Wait for a few minutes and viola !, Apache is installed with the exception of a few minor changes we still need to make. They are as follows..</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Issue the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#vi /usr/local/apache2/conf/httpd.conf</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Check to make sure the following line is present in the file at the bottom of the LoadModule list, if it is not there add it;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>LoadModule php4_module modules/libphp4.so</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Find the DirectoryIndex line and edit it so it looks like the following;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>DirectoryIndex index.html index.html.var index.php</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Find the AddType application section and add the following line;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>AddType application/x-httpd-php .php</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Thats it, save the file and we are done with Apache. Now, on to MySQL !</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>Compiling MySQL -</strong> </font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Change into the MySQL source directory as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd mysql-4.0.16 (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Follow this command by typing;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#./configure &#8211;prefix=/usr/local/mysql &#8211;localstatedir=/usr/local/mysql/data &#8211;disable-maintainer-mode &#8211;with-mysqld-user=mysql &#8211;enable-large-files-without-debug (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Sit back and wait for a while while configure does its thing, once the system returns the prompt to you issue the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#make (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Unless you have a very fast machine this will take some time, so spend time with your family, grab a beer, go for a walk, or whatever you&#8217;re into. When you get back, assuming the system has returned the prompt to you issue the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#make install (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Cool !, MySQL is installed, there are only a couple things left to do to get it working, first we need to create a group for MySQL as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#/usr/sbin/groupadd mysql (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Then we create a user called mysql which belongs to the mysql group;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#/usr/sbin/useradd -g mysql mysql (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Now we install the database files as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#./scripts/mysql_install_db (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Then we make a couple minor ownership changes;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong># chown -R root:mysql /usr/local/mysql (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong># chown -R mysql:mysql /usr/local/mysql/data (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Last but not least, we use vi to add a line the ld.so.conf file as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#vi /etc/ld.so.conf</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">And we add the following line;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>/usr/local/mysql/lib/mysql</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Thats it, MySQL is installed, you can run it by issuing the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#/usr/local/mysql/bin/mysqld_safe &#8211;user=mysql &#038;</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">And as long as we&#8217;re here we might as well set a root password for MySQL as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#/usr/local/mysql/bin/mysqladmin -u root password new_password</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Where new_password is the password you want to use.</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Ok, so far so good, on to PHP !</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>Compiling PHP -</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Change into the PHP source directory as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd php-4.3.4 (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Follow this command by typing;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#./configure &#8211;prefix=/usr/local/php &#8211;with-apxs2=/usr/local/apache2/bin/apxs &#8211;with-mysql=/usr/local/mysql (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Once the prompt comes back to you issue the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#make (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Hang out for awhile, and then yep, you guessed it, once you have the prompt back;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#make install (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Once the install finishes and you have the prompt back issue the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cp php.ini-recommended /usr/local/php/lib/php.ini (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Then edit that file;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#vi /usr/local/php/lib/php.ini (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">And change the following;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Find the <strong>doc_root</strong> section and enter the correct path for the directory which serves your web content, such as;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>doc_root= &#8220;/usr/local/apache2/htdocs/&#8221;</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>(this is default for apache2)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Then find the file_uploads section and change it to reflect the following;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>file_uploads=Off</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">(for security reasons)</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Thats if for PHP, now lets see if it all works..</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>Testing - </strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Assuming your MySQL process is still running from earlier, lets start Apache by issuing the following command;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#/usr/local/apache2/bin/apachectl start (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">This starts the Apache web server, now change into the following directory;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd /usr/local/apache2/htdocs (enter)</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">And using vi create a file called <strong>test.php</strong>;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#vi test.php</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Add the following line to the file;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong><?php phpinfo(); ?></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Save the file, then fire up your browser and point it to <strong>localhost/test.php</strong>. You should see a listing of all kinds of cool info about Apache, PHP, etc. If you do then your set !, if you don&#8217;t, then take a look at your logs for Apache and MySql, and remember <a href="http://www.google.com/" target="_blank"><font color="#ff0000">Google</font></a> is your friend. But hopefully you do, and now you have a fully functioning setup. </font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Ok, one last step and we&#8217;ll be done, you have everything running now, but you had to start Apache and MySql manually, that&#8217;s something you don&#8217;t want to have to remember to do everytime you reboot your machine, so lets fix it.</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>Starting Apache and MySQL Automatically - </strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Lets start with MySQL, as </font><font size="+0"><strong>root</strong> make your working directory that of the MySQL source directory you worked with earlier, something similar to;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd /home/xxxx/mysql-4.0.16 <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Then, copy the file <strong>mysql.server</strong> to your <strong>/etc/init.d</strong> directory as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cp support-files/mysql.server /etc/init.d/mysql</strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Ok, lets create some links in the startup folders for run levels 3 and 5.</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd /etc/rc3.d <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s ../init.d/mysql S85mysql <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s ../init.d/mysql K85mysql <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd /etc/rc5.d <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s ../init.d/mysql S85mysql <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s ../init.d/mysql K85mysql <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd ../init.d <enter></strong></font></p>
<p><font size="+0"><strong>#chmod 755 mysql <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Thats it for MySQL, it should start automatically now when you reboot your machine. Now lets do the same for Apache, still as <strong>root</strong> make your working directory that of the Apache binaries as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd /usr/local/apache2/bin</strong> <strong><enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Then, copy the file called <strong>apachectl </strong>as follows;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cp apachectl /etc/init.d/httpd <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">Now, for some more links;</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd /etc/rc3.d <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s ../init.d/httpd S85httpd <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s</strong> <strong>../init.d/httpd K85httpd <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#cd /etc/rc5.d <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s ../init.d/httpd S85httpd <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0"><strong>#ln -s ../init.d/httpd K85httpd <enter></strong></font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">And thats it for Apache !, it should start automatically along with MySQL the next time you boot your machine.</font></p>
<p><font size="+0"><br />
</font></p>
<p><font size="+0">That brings us to the end of this tutorial, hopefully you found it helpful, and Good Luck !</font></p>
<p></span></font>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2007/01/20/installing-apache-mysql-and-php-on-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finding/locating files with find command</title>
		<link>http://www.howtoinstall.net/2007/01/14/findinglocating-files-with-find-command/</link>
		<comments>http://www.howtoinstall.net/2007/01/14/findinglocating-files-with-find-command/#comments</comments>
		<pubDate>Sun, 14 Jan 2007 13:41:12 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>AdminTutorials</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2007/01/14/findinglocating-files-with-find-command/</guid>
		<description><![CDATA[UNIX/Linux system administrator can use nifty find utility to gain lots of useful information. This will help to monitor and enhance the security of system.
(A) Finding all set user id files
# find / -perm +u=s
OR
# find / -perm +4000
See also, shell script to find all programs and scripts with setuid set on.
(B) Finding all set [...]]]></description>
			<content:encoded><![CDATA[<p>UNIX/Linux system administrator can use nifty find utility to gain lots of useful information. This will help to monitor and enhance the security of system.</p>
<p>(A) Finding all set user id files<br />
# find / -perm +u=s<br />
OR<br />
# find / -perm +4000<br />
See also, shell script to find all programs and scripts with setuid set on.</p>
<p>(B) Finding all set group id files<br />
# find / -perm +g=s<br />
OR<br />
# find / -perm +2000</p>
<p>See also, shell script to find all programs and scripts with setgid bit set on.</p>
<p>(C)Finding all large directories – For example find all directories taking 40k (kilobytes) blocks of space. This is useful to find out which directories on system taking lot of space.<br />
# find / -type d -size +40k<br />
/var/lib/dpkg/info<br />
/var/log/ksymoops<br />
/usr/share/doc/HOWTO/en-html<br />
/usr/share/man/man3</p>
<p>(D) Finding all large files on a Linux<br />
# find / -type f -size +10000k<br />
/var/log/kern.log<br />
/sys/devices/pci0000:00/0000:00:02.0/resource0<br />
/sys/devices/pci0000:00/0000:00:00.0/resource0<br />
/opt/03Jun05/firefox-1.0.4-source.tar.bz2</p>
<p>However my favorite hack to above command is as follows:<br />
find / -type f -size +10000k -exec ls -lh {} \; | awk ‘{ print $8 “: ” $5 }’<br />
/var/log/kern.log: 22M<br />
/sys/devices/pci0000:00/0000:00:02.0/resource0: 128M</p>
<p>Above command will find all files block size greater than 10000k and print filename followed by file size. Now this is more informative than the normal output  .
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2007/01/14/findinglocating-files-with-find-command/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing zend optimizer</title>
		<link>http://www.howtoinstall.net/2007/01/01/installing-zend-optimizer/</link>
		<comments>http://www.howtoinstall.net/2007/01/01/installing-zend-optimizer/#comments</comments>
		<pubDate>Mon, 01 Jan 2007 20:07:11 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>Website Optimization</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2007/01/01/installing-zend-optimizer/</guid>
		<description><![CDATA[Zend optimizer is a plugin to php which allows a server to read zend encoded files as well as serve as a platform to install zend modules such as eaccelerator. The installation is incredibly simple thanks to zend&#8217;s script. The current 10a version works with php 4.4.1 as well as the latest version of eaccelerator. [...]]]></description>
			<content:encoded><![CDATA[<p>Zend optimizer is a plugin to php which allows a server to read zend encoded files as well as serve as a platform to install zend modules such as eaccelerator. The installation is incredibly simple thanks to zend&#8217;s script. The current 10a version works with php 4.4.1 as well as the latest version of eaccelerator. Currently the cPanel scripts do NOT install a version of zend compatible with php 4.4.1 so a manual install must be done.</p>
<p> </p>
<p>I have a local copy of the files:</p>
<p>cd /usr/local/src<br />
wget http://www.eth0.us/files/ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz<br />
tar -zxf ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz<br />
cd ZendOptimizer-2.5.10a-linux-glibc21-i386<br />
./install</p>
<p>Now just hit enter a few times until it is done and you are done! It is as easy as that.</p>
<p>Article from eth0.us
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2007/01/01/installing-zend-optimizer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Optimizing host.conf and sysctl.conf</title>
		<link>http://www.howtoinstall.net/2007/01/01/optimizing-hostconf-and-sysctlconf/</link>
		<comments>http://www.howtoinstall.net/2007/01/01/optimizing-hostconf-and-sysctlconf/#comments</comments>
		<pubDate>Mon, 01 Jan 2007 20:05:06 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>AdminTutorials</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2007/01/01/optimizing-hostconf-and-sysctlconf/</guid>
		<description><![CDATA[Well, here is another net-based optimization script i have for you. It also is not a masterpiece, but when you include this with everything else, this small addition is the topping to the cake. 
#!/bin/sh
cp /etc/host.conf /etc/host.back
echo &#8220;# Lookup names via DNS first then fall back to /etc/hosts.&#8221; > /etc/host.conf
echo &#8220;order bind,hosts&#8221; >> /etc/host.conf
echo &#8220;# We [...]]]></description>
			<content:encoded><![CDATA[<div class="content">Well, here is another net-based optimization script i have for you. It also is not a masterpiece, but when you include this with everything else, this small addition is the topping to the cake. </p>
<p>#!/bin/sh<br />
cp /etc/host.conf /etc/host.back<br />
echo &#8220;# Lookup names via DNS first then fall back to /etc/hosts.&#8221; > /etc/host.conf<br />
echo &#8220;order bind,hosts&#8221; >> /etc/host.conf<br />
echo &#8220;# We have machines with multiple IP addresses.&#8221; >> /etc/host.conf<br />
echo &#8220;multi on&#8221; >> /etc/host.conf<br />
echo &#8220;# Check for IP address spoofing.&#8221; >> /etc/host.conf<br />
echo &#8220;nospoof on&#8221; >> /etc/host.conf<br />
cp /etc/sysctl.conf /etc/sysctl.conf.old<br />
echo &#8220;# Max File Handlers&#8221; >> /etc/sysctl.conf<br />
echo &#8220;fs.file-max = 8192&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Disable CTR+ALT+DEL Restart Keys&#8221; >> /etc/sysctl.conf<br />
echo &#8220;kernel.ctrl-alt-del = 1&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Enable TCP SYN cookie protection&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_syncookies = 1&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Disable ICMP Redirect Acceptance&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.conf.all.accept_redirects = 0&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Enable bad error message protection&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.icmp_ignore_bogus_error_responses = 1&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Decrease time between keepalives&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_keepalive_time = 1200&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Turn off timestamps&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_timestamps = 0&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Ignore icmp broadcast request&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.icmp_echo_ignore_broadcasts = 1&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Decrease the time default value for tcp_fin_timeout connection&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_fin_timeout = 25&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Turn off the tcp_window_scaling&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_window_scaling = 0&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Turn off the tcp_sack&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_sack = 0&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Allow more SYN backlog&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_max_syn_backlog = 1048&#8243; >> /etc/sysctl.conf<br />
echo &#8220;# Lower retry rates&#8221; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_synack_retries = 2&#8243; >> /etc/sysctl.conf<br />
echo &#8220;net.ipv4.tcp_syn_retries = 3&#8243; >> /etc/sysctl.conf<br />
cp /etc/syslog.conf /etc/syslog.conf.old<br />
echo &#8220;# Log all kernel messages to the new file /var/log/kernel&#8221; >> /etc/syslog.conf<br />
echo &#8220;kern.* /var/log/kernel&#8221; >> /etc/syslog.conf<br />
echo &#8220;# Log all logins to /var/log/login_log&#8221; >> /etc/syslog.conf<br />
echo &#8220;auth.*;user.*;daemon.none /var/log/login_log&#8221; >> /etc/syslog.conf</p>
<p>when you look through the script, you can generally see what it is doing. But for a basic overveiw, the script is setting up the configs most people forget about, or maybe never even knew about. The script also makes a back-up of itself incase something might go wrong.</p>
<p>Enjoy.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2007/01/01/optimizing-hostconf-and-sysctlconf/feed/</wfw:commentRss>
		</item>
		<item>
		<title>how to install eAccelerator</title>
		<link>http://www.howtoinstall.net/2006/12/30/how-to-install-eaccelerator/</link>
		<comments>http://www.howtoinstall.net/2006/12/30/how-to-install-eaccelerator/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 21:57:08 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>Website Optimization</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2006/12/30/how-to-install-eaccelerator/</guid>
		<description><![CDATA[eAccelerator is a PHP caching system, which caches frequently used portions of PHP files to RAM to increase performance. This is especially great on high traffic websites such as forums. Performance gains of up to 1000% have been seen with eAccelerator. The following tutorial shows how to install eAccelerator from source on Linux.
Download the source:
cd [...]]]></description>
			<content:encoded><![CDATA[<p><span class="textArialSpacing">eAccelerator is a PHP caching system, which caches frequently used portions of PHP files to RAM to increase performance. This is especially great on high traffic websites such as forums. Performance gains of up to 1000% have been seen with eAccelerator. The following tutorial shows how to install eAccelerator from source on Linux.</span></p>
<p class="textArialSpacing">Download the source:</p>
<p class="textCodeBlueCourier">cd /usr/src/<br />
wget http://internap.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.3.tar.gz<br />
tar zxvf eaccelerator-0.9.3.tar.gz<br />
cd eaccelerator-0.9.3</p>
<p class="textArialSpacing">Build:</p>
<p class="textCodeBlueCourier">export PHP_PREFIX=&#8221;/usr&#8221;<br />
$PHP_PREFIX/bin/phpize<br />
./configure &#8211;enable-eaccelerator=shared &#8211;with-php-config=$PHP_PREFIX/bin/php-config<br />
make</p>
<p class="textArialSpacing">Note, the PHP_PREFIX should be set to where you have PHP installed.</p>
<p class="textArialSpacing">Install:</p>
<p class="textCodeBlueCourier">make install</p>
<p class="textArialSpacing">If you are using Zend, add the following to your php.ini file:</p>
<p class="textCodeBlueCourier">zend_extension=&#8221;/usr/local/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so&#8221;<br />
eaccelerator.shm_size=&#8221;16&#8243;<br />
eaccelerator.cache_dir=&#8221;/tmp/eaccelerator&#8221;<br />
eaccelerator.enable=&#8221;1&#8243;<br />
eaccelerator.optimizer=&#8221;1&#8243;<br />
eaccelerator.check_mtime=&#8221;1&#8243;<br />
eaccelerator.debug=&#8221;0&#8243;<br />
eaccelerator.filter=&#8221;"<br />
eaccelerator.shm_max=&#8221;0&#8243;<br />
eaccelerator.shm_ttl=&#8221;0&#8243;<br />
eaccelerator.shm_prune_period=&#8221;0&#8243;<br />
eaccelerator.shm_only=&#8221;0&#8243;<br />
eaccelerator.compress=&#8221;1&#8243;<br />
eaccelerator.compress_level=&#8221;9&#8243;</p>
<p class="textArialSpacing">Note: zend_extension should be equal to the location to where the extension was installed.</p>
<p class="textArialSpacing">If you are not using Zend, you can load eAccelerator as a PHP extension:</p>
<p class="textCodeBlueCourier">extension=&#8221;eaccelerator.so&#8221;<br />
eaccelerator.shm_size=&#8221;16&#8243;<br />
eaccelerator.cache_dir=&#8221;/tmp/eaccelerator&#8221;<br />
eaccelerator.enable=&#8221;1&#8243;<br />
eaccelerator.optimizer=&#8221;1&#8243;<br />
eaccelerator.check_mtime=&#8221;1&#8243;<br />
eaccelerator.debug=&#8221;0&#8243;<br />
eaccelerator.filter=&#8221;"<br />
eaccelerator.shm_max=&#8221;0&#8243;<br />
eaccelerator.shm_ttl=&#8221;0&#8243;<br />
eaccelerator.shm_prune_period=&#8221;0&#8243;<br />
eaccelerator.shm_only=&#8221;0&#8243;<br />
eaccelerator.compress=&#8221;1&#8243;<br />
eaccelerator.compress_level=&#8221;9&#8243;</p>
<p class="textArialSpacing">Setup caching directories:</p>
<p class="textCodeBlueCourier">mkdir /tmp/eaccelerator<br />
chmod 0777 /tmp/eaccelerator</p>
<p class="textArialSpacing">You can copy the eaccelerator.php file to a web accessible location, and check if eAccelerator is running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2006/12/30/how-to-install-eaccelerator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Guide to .htaccess tutorial and tips</title>
		<link>http://www.howtoinstall.net/2006/12/30/guide-to-htaccess-tutorial-and-tips/</link>
		<comments>http://www.howtoinstall.net/2006/12/30/guide-to-htaccess-tutorial-and-tips/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 21:37:19 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>Apache</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2006/12/30/guide-to-htaccess-tutorial-and-tips/</guid>
		<description><![CDATA[Guide to .htaccess tutorial and tips
Introduction
In this tutorial you will find out about the .htaccess file and the power it has to improve your website. Although .htaccess is only a file, it can change settings on the servers and allow you to do many different things, the most popular being able to have your own [...]]]></description>
			<content:encoded><![CDATA[<p class="style35">Guide to .htaccess tutorial and tips</p>
<p class="style33">Introduction</p>
<p class="style33">In this tutorial you will find out about the .htaccess file and the power it has to improve your website. Although .htaccess is only a file, it can change settings on the servers and allow you to do many different things, the most popular being able to have your own custom 404 error pages. .htaccess isn&#8217;t difficult to use and is really just made up of a few simple instructions in a text file.</p>
<p class="style33">Will My Host Support It?</p>
<p class="style33">This is probably the hardest question to give a simple answer to. Many hosts support .htaccess but don&#8217;t actually publicise it and many other hosts have the capability but do not allow their users to have a .htaccess file. As a general rule, if your server runs Unix or Linux, or any version of the Apache web server it will support .htaccess, although your host may not allow you to use it.</p>
<p class="style33">A good sign of whether your host allows .htaccess files is if they support password protection of folders. To do this they will need to offer .htaccess (although in a few cases they will offer password protection but not let you use .htaccess). The best thing to do if you are unsure is to either upload your own .htaccess file and see if it works or e-mail your web host and ask them.</p>
<p class="style33">What Can I Do?</p>
<p class="style33">You may be wondering what .htaccess can do, or you may have read about some of its uses but don&#8217;t realise how many things you can actually do with it.</p>
<p class="style33">There is a huge range of things .htaccess can do including: password protecting folders, redirecting users automatically, custom error pages, changing your file extensions, banning users with certian IP addresses, only allowing users with certain IP addresses, stopping directory listings and using a different file as the index file.</p>
<p class="style33">Creating A .htaccess File</p>
<p class="style33">Creating a .htaccess file may cause you a few problems. Writing the file is easy, you just need enter the appropriate code into a text editor (like notepad). You may run into problems with saving the file. Because .htaccess is a strange file name (the file actually has no name but a 8 letter file extension) it may not be accepted on certain systems (e.g. Windows 3.1). With most operating systems, though, all you need to do is to save the file by entering the name as:</p>
<p class="style33">&#8220;.htaccess&#8221;</p>
<p class="style33">(including the quotes). If this doesn&#8217;t work, you will need to name it something else (e.g. htaccess.txt) and then upload it to the server. Once you have uploaded the file you can then rename it using an FTP program.</p>
<p class="style33">Warning</p>
<p class="style33">Before beginning using .htaccess, I should give you one warning. Although using .htaccess on your server is extremely unlikely to cause you any problems (if something is wrong it simply won&#8217;t work), you should be wary if you are using the Microsoft FrontPage Extensions. The FrontPage extensions use the .htaccess file so you should not really edit it to add your own information. If you do want to (this is not recommended, but possible) you should download the .htaccess file from your server first (if it exists) and then add your code to the beginning.</p>
<p class="style33">Custom Error Pages</p>
<p class="style33">The first use of the .htaccess file which I will cover is custom error pages. These will allow you to have your own, personal error pages (for example when a file is not found) instead of using your host&#8217;s error pages or having no page. This will make your site seem much more professional in the unlikely event of an error. It will also allow you to create scripts to notify you if there is an error (for example I use a PHP script on Free Webmaster Help to automatically e-mail me when a page is not found).</p>
<p class="style33">You can use custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file:</p>
<p class="style33">ErrorDocument errornumber /file.html</p>
<p class="style33">For example if I had the file notfound.html in the root directory of my site and I wanted to use it for a 404 error I would use:</p>
<p class="style33">ErrorDocument 404 /notfound.html</p>
<p class="style33">If the file is not in the root directory of your site, you just need to put the path to it:</p>
<p class="style33">ErrorDocument 500 /errorpages/500.html</p>
<p class="style33">These are some of the most common errors:</p>
<p class="style33">401 - Authorization Required<br />
400 - Bad request<br />
403 - Forbidden<br />
500 - Internal Server Error<br />
404 - Wrong page</p>
<p class="style33">Then, all you need to do is to create a file to display when the error happens and upload it and the .htaccess file.</p>
<p class="style33">Part 2</p>
<p class="style33">In part 2 I will show you how to use some of the other .htaccess functions to improve your website.</p>
<p class="style33"> </p>
<p class="style33">Introduction</p>
<p class="style33">In the last part I introduced you to .htaccess and some of its useful features. In this part I will show you how to use the .htaccess file to implement some of these.</p>
<p class="style33">Stop A Directory Index From Being Shown</p>
<p class="style33">Sometimes, for one reason or another, you will have no index file in your directory. This will, of course, mean that if someone types the directory name into their browser, a full listing of all the files in that directory will be shown. This could be a security risk for your site.</p>
<p class="style33">To prevent against this (without creating lots of new &#8216;index&#8217; files, you can enter a command into your .htaccess file to stop the directory list from being shown:</p>
<p class="style33">Options -Indexes</p>
<p class="style33">Deny/Allow Certian IP Addresses</p>
<p class="style33">In some situations, you may want to only allow people with specific IP addresses to access your site (for example, only allowing people using a particular ISP to get into a certian directory) or you may want to ban certian IP addresses (for example, keeping disruptive memembers out of your message boards). Of course, this will only work if you know the IP addresses you want to ban and, as most people on the internet now have a dynamic IP address, so this is not always the best way to limit usage.</p>
<p class="style33">You can block an IP address by using:</p>
<p class="style33">deny from 000.000.000.000</p>
<p class="style33">where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will block a whole range.</p>
<p class="style33">You can allow an IP address by using:</p>
<p class="style33">allow from 000.000.000.000</p>
<p class="style33">where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will allow a whole range.</p>
<p class="style33">If you want to deny everyone from accessing a directory, you can use:</p>
<p class="style33">deny from all</p>
<p class="style33">but this will still allow scripts to use the files in the directory.</p>
<p class="style33">Alternative Index Files</p>
<p class="style33">You may not always want to use index.htm or index.html as your index file for a directory, for example if you are using PHP files in your site, you may want index.php to be the index file for a directory. You are not limited to &#8216;index&#8217; files though. Using .htaccess you can set foofoo.blah to be your index file if you want to!</p>
<p class="style33">Alternate index files are entered in a list. The server will work from left to right, checking to see if each file exists, if none of them exisit it will display a directory listing (unless, of course, you have turned this off).</p>
<p class="style33">DirectoryIndex index.php index.php3 messagebrd.pl index.html index.htm</p>
<p class="style33">Redirection</p>
<p class="style33">One of the most useful functions of the .htaccess file is to redirect requests to different files, either on the same server, or on a completely different web site. It can be extremely useful if you change the name of one of your files but allow users to still find it. Another use (which I find very useful) is to redirect to a longer URL, for example in my newsletters I can use a very short URL for my affiliate links. The following can be done to redirect a specific file:</p>
<p class="style33">Redirect /location/from/root/file.ext http://www.othersite.com/new/file/location.xyz</p>
<p class="style33">In this above example, a file in the root directory called oldfile.html would be entered as:</p>
<p class="style33">/oldfile.html</p>
<p class="style33">and a file in the old subdirectory would be entered as:</p>
<p class="style33">/old/oldfile.html</p>
<p class="style33">You can also redirect whole directoires of your site using the .htaccess file, for example if you had a directory called olddirectory on your site and you had set up the same files on a new site at: http://www.newsite.com/newdirectory/ you could redirect all the files in that directory without having to specify each one:</p>
<p class="style33">Redirect /olddirectory http://www.newsite.com/newdirectory</p>
<p class="style33">Then, any request to your site below /olddirectory will bee redirected to the new site, with the extra information in the URL added on, for example if someone typed in:</p>
<p class="style33">http://www.youroldsite.com/olddirecotry/oldfiles/images/image.gif</p>
<p class="style33">They would be redirected to:</p>
<p class="style33">http://www.newsite.com/newdirectory/oldfiles/images/image.gif</p>
<p class="style33">This can prove to be extremely powerful if used correctly.</p>
<p class="style33">Part 3</p>
<p class="style33">In part 3 I will cover a few other uses of the .htaccess file including password protection.</p>
<p class="style33">Introduction</p>
<p class="style33">Although there are many uses of the .htaccess file, by far the most popular, and probably most useful, is being able to relaibly password protect directories on websites. Although JavaScript etc. can also be used to do this, only .htaccess has total security (as someone must know the password to get into the directory, there are no &#8216;back doors&#8217;)</p>
<p class="style33">The .htaccess File</p>
<p class="style33">Adding password protection to a directory using .htaccess takes two stages. The first part is to add the appropriate lines to your .htaccess file in the directory you would like to protect. Everything below this directory will be password protected:</p>
<p class="style33">AuthName &#8220;Section Name&#8221;<br />
AuthType Basic<br />
AuthUserFile /full/path/to/.htpasswd<br />
Require valid-user</p>
<p class="style33">There are a few parts of this which you will need to change for your site. You should replace &#8220;Section Name&#8221; with the name of the part of the site you are protecting e.g. &#8220;Members Area&#8221;.</p>
<p class="style33">The /full/parth/to/.htpasswd should be changed to reflect the full server path to the .htpasswd file (more on this later). If you do not know what the full path to your webspace is, contact your system administrator for details.</p>
<p class="style33">The .htpasswd File</p>
<p class="style33">Password protecting a directory takes a little more work than any of the other .htaccess functions because you must also create a file to contain the usernames and passwords which are allowed to access the site. These should be placed in a file which (by default) should be called .htpasswd. Like the .htaccess file, this is a file with no name and an 8 letter extension. This can be placed anywhere within you website (as the passwords are encrypted) but it is advisable to store it outside the web root so that it is impossible to access it from the web.</p>
<p class="style33">Entering Usernames And Passwords</p>
<p class="style33">Once you have created your .htpasswd file (you can do this in a standard text editor) you must enter the usernames and passwords to access the site. They should be entered as follows:</p>
<p class="style33">username:password</p>
<p class="style33">where the password is the encrypted format of the password. To encrypt the password you will either need to use one of the premade scripts available on the web or write your own. There is a good username/password service at the KxS site which will allow you to enter the user name and password and will output it in the correct format.</p>
<p class="style33">For multiple users, just add extra lines to your .htpasswd file in the same format as the first. There are even scripts available for free which will manage the .htpasswd file and will allow automatic adding/removing of users etc.</p>
<p class="style33">Accessing The Site</p>
<p class="style33">When you try to access a site which has been protected by .htaccess your browser will pop up a standard username/password dialog box. If you don&#8217;t like this, there are certain scripts available which allow you to embed a username/password box in a website to do the authentication. You can also send the username and password (unencrypted) in the URL as follows:</p>
<p class="style33">http://username:password@www.website.com/directory/</p>
<p class="style33">Summary</p>
<p class="style33">.htaccess is one of the most useful files a webmaster can use. There are a wide variety of different uses for it which can save time and increase security on your website.</p>
<p class="style33">Thanks to freewebmasterhelp.com for providing this article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2006/12/30/guide-to-htaccess-tutorial-and-tips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Apache Log Files Explained</title>
		<link>http://www.howtoinstall.net/2006/12/30/apache-log-files-explained/</link>
		<comments>http://www.howtoinstall.net/2006/12/30/apache-log-files-explained/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 21:36:01 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>Apache</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2006/12/30/apache-log-files-explained/</guid>
		<description><![CDATA[Apache Log Files Explained
Configure Web Logs in Apache
Author&#8217;s Note: While most of this piece discusses configuration options for any operating system Apache supports, some of the content will be Unix/Linux (*nix) specific, which now includes Macintosh OS X and its underlying Unix kernel.
One of the many pieces of the Website puzzle is Web logs. Traffic [...]]]></description>
			<content:encoded><![CDATA[<p class="style35">Apache Log Files Explained</p>
<p class="style33">Configure Web Logs in Apache<br />
Author&#8217;s Note: While most of this piece discusses configuration options for any operating system Apache supports, some of the content will be Unix/Linux (*nix) specific, which now includes Macintosh OS X and its underlying Unix kernel.</p>
<p class="style33">One of the many pieces of the Website puzzle is Web logs. Traffic analysis is central to most Websites, and the key to getting the most out of your traffic analysis revolves around how you configure your Web logs. Apache is one of the most &#8212; if not the most &#8212; powerful open source solutions for Website operations. You will find that Apache&#8217;s Web logging features are flexible for the single Website or for managing numerous domains requiring Web log analysis.</p>
<p class="style33">For the single site, Apache is pretty much configured for logging in the default install. The initial httpd.conf file (found in /etc/httpd/conf/httpd.conf in most cases) should have a section on logs that looks similar to this (Apache 2.0.x), with descriptive comments for each item. Your default logs folder will be found in /etc/httpd/logs . This location can be changed when dealing with multiple Websites, as we&#8217;ll see later. For now, let&#8217;s review this section of log configuration.</p>
<p class="style33">ErrorLog logs/error_log</p>
<p class="style33">LogLevel warn</p>
<p class="style33">LogFormat &#8220;%h %l %u %t &#8220;%r&#8221; %>s %b &#8220;%{Referer}i&#8221; &#8220;%{User-Agent}i&#8221;" combined<br />
LogFormat &#8220;%h %l %u %t &#8220;%r&#8221; %>s %b&#8221; common<br />
LogFormat &#8220;%{Referer}i -> %U&#8221; referer<br />
LogFormat &#8220;%{User-agent}i&#8221; agent</p>
<p class="style33">CustomLog logs/access_log combined</p>
<p class="style33">Error Logs<br />
The error log contains messages sent from Apache for errors encountered during the course of operation. This log is very useful for troubleshooting Apache issues on the server side.</p>
<p class="style33">Apache Log Tip: If you are monitoring errors or testing your server, you can use the command line to interactively watch log entries. Open a shell session and type &#8220;tail –f /path/to/error_log&#8221; . This will show you the last few entries in the file and also continue to show new entries as they occur.</p>
<p class="style33">There are no real customization options available, other than telling Apache where to establish the file, and what level of error logging you seek to capture. First, let&#8217;s look at the error log configuration code from httpd.conf.</p>
<p class="style33">ErrorLog logs/error_log</p>
<p class="style33">You may wish to store all error-related information in one error log. If so, the above is fine, even for multiple domains. However, you can specify an error log file for each individual domain you have. This is done in the <VirtualHost> container with an entry like this:</p>
<p class="style33"><VirtualHost 10.0.0.2><br />
DocumentRoot &#8220;/home/sites/domain1/html/&#8221;<br />
ServerName domain1.com<br />
ErrorLog /home/sites/domain1/logs/error.log<br />
</VirtualHost></p>
<p class="style33">If you are responsible for reviewing error log files as a server administrator, it is recommended that you maintain a single error log. If you&#8217;re hosting for clients, and they are responsible for monitoring the error logs, it&#8217;s more convenient to specify individual error logs they can access at their own convenience.</p>
<p class="style33">The setting that controls the level of error logging to capture follows below.</p>
<p class="style33">LogLevel warn</p>
<p class="style33">Apache&#8217;s definitions for their error log levels are as follows:</p>
<p class="style33"> </p>
<p class="style33">Tracking Website Activity<br />
Often by default, Apache will generate three activity logs: access, agent and referrer. These track the accesses to your Website, the browsers being used to access the site and referring urls that your site visitors have arrived from.</p>
<p class="style33">It is commonplace now to utilize Apache&#8217;s &#8220;combined&#8221; log format, which compiles all three of these logs into one logfile. This is very convenient when using traffic analysis software as a majority of these third-party programs are easiest to configure and schedule when only dealing with one log file per domain.</p>
<p class="style33">Let&#8217;s break down the code in the combined log format and see what it all means.</p>
<p class="style33">LogFormat &#8220;%h %l %u %t &#8220;%r&#8221; %>s %b &#8220;%{Referer}i&#8221; &#8220;%{User-Agent}i&#8221;" combined</p>
<p class="style33">LogFormat starts the line and simply tells Apache you are defining a log file type (or nickname), in this case, combined. Now let&#8217;s look at the cryptic symbols that make up this log file definition.</p>
<p class="style33"> </p>
<p class="style33">To review all of the available configuration codes for generating a custom log, see Apache&#8217;s [1] docs on the module_log_config , which powers log files in Apache.</p>
<p class="style33">Apache Log Tip: You could capture more from the HTTP header if you so desired. A full listing and definition of data in the header is found at the World Wide Web Consortium [2] .</p>
<p class="style33">For a single Website, the default entry would suffice:</p>
<p class="style33">CustomLog logs/access_log combined</p>
<p class="style33">However, for logging multiple sites, you have a few options. The most common is to identify individual log files for each domain. This is seen in the example below, again using the log directive within the <VirtualHost> container for each domain.</p>
<p class="style33"><VirtualHost 10.0.0.2><br />
DocumentRoot &#8220;/home/sites/domain1/html/&#8221;<br />
ServerName domain1.com<br />
ErrorLog /home/sites/domain1/logs/error.log<br />
CustomLog /home/sites/domain1/logs/web.log<br />
</VirtualHost></p>
<p class="style33"><VirtualHost 10.0.0.3><br />
DocumentRoot &#8220;/home/sites/domain2/html/&#8221;<br />
ServerName domain2.com<br />
ErrorLog /home/sites/domain2/logs/error.log<br />
CustomLog /home/sites/domain2/logs/web.log<br />
</VirtualHost></p>
<p class="style33"><VirtualHost 10.0.0.4><br />
DocumentRoot &#8220;/home/sites/domain3/html/&#8221;<br />
ServerName domain3.com<br />
ErrorLog /home/sites/domain3/logs/error.log<br />
CustomLog /home/sites/domain3/logs/web.log<br />
</VirtualHost></p>
<p class="style33">In the above example, we have three domains with three unique Web logs (using the combined format we defined earlier). A traffic analysis package could then be scheduled to process these logs and generate reports for each domain independently.</p>
<p class="style33">This method works well for most hosts. However, there may be situations where this could become unmanageable. Apache recommends a special single log file for large virtual host environments and provides a tool for generating individual logs per individual domain.</p>
<p class="style33">We will call this log type the cvh format, standing for &#8220;common virtual host.&#8221; Simply by adding a %v (which stands for virtual host) to the beginning of the combined log format defined earlier and giving it a new nickname of cvh, we can compile all domains into one log file, then automatically split them into individual log files for processing by a traffic analysis package.</p>
<p class="style33">LogFormat &#8220;%v %h %l %u %t &#8220;%r&#8221; %>s %b &#8220;%{Referer}i&#8221; &#8220;%{User-Agent}i&#8221;" cvh</p>
<p class="style33">In this case, we do not make any CustomLog entries in the <VirtualHost> containers and simply have one log file generated by Apache. A program created by Apache called split_logfile is included in the src/support directory of your Apache sources. If you did not compile from source or do not have the sources, you can get the Perl script [3] .</p>
<p class="style33">The individual log files created from your master log file will be named for each domain (virtual host) and look like: virtualhost.log.</p>
<p class="style33">Log Rotation<br />
Finally, we want to address log rotation. High traffic sites will generate very large log files, which will quickly swallow up valuable disk space on your server. You can use log rotation to manage this process.</p>
<p class="style33">There are many ways to handle log rotation, and various third-party tools are available as well. However, we&#8217;re focusing on configurations native to Apache, so we will look at a simple log rotation scheme here. I&#8217;ll include links to more flexible and sophisticated log rotation options in a moment.</p>
<p class="style33">This example uses a rudimentary shell script to move the current Web log to an archive log, compresses the old file and keeps an archive for as long as 12 months, then restarts Apache with a pause to allow the log files to be switched out.</p>
<p class="style33">mv web11.tgz web12.tgz<br />
mv web10.tgz web11.tgz<br />
mv web9.tgz web10.tgz<br />
mv web8.tgz web9.tgz<br />
mv web7.tgz web8.tgz<br />
mv web6.tgz web7.tgz<br />
mv web5.tgz web6.tgz<br />
mv web5.tgz web6.tgz<br />
mv web4.tgz web5.tgz<br />
mv web3.tgz web4.tgz<br />
mv web2.tgz web3.tgz<br />
mv web1.tgz web2.tgz<br />
mv web.tgz web1.tgz<br />
mv web.log web.old<br />
/usr/sbin/apachectl graceful<br />
sleep 300<br />
tar cvfz web.tgz web.old</p>
<p class="style33">This code can be copied into a file called logrotate.sh , and placed inside the folder where your web.log file is stored (or whatever you name your log file, e.g. access_log, etc.). Just be sure to modify for your log file names and also chmod (change permissions on the file) to 755 so it becomes an executable.</p>
<p class="style33">This works fine for a single busy site. If you have more complex requirements for log rotation, be sure to see some of the following sites. In addition, many Linux distributions now come with a log rotation included. For example, Red Hat 9 comes with logrotate.d , a log rotation daemon which is highly configurable. To find out more, on your Linux system with logrotate.d installed, type man logrotate .</p>
<p class="style33"> </p>
<p class="style33">Log Rotation Sites<br />
For more information on log roation, see:</p>
<p class="style33">cronolog [4]<br />
modperl [5]
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2006/12/30/apache-log-files-explained/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Howto mod_rewrite with Apache</title>
		<link>http://www.howtoinstall.net/2006/12/30/howto-mod_rewrite-with-apache/</link>
		<comments>http://www.howtoinstall.net/2006/12/30/howto-mod_rewrite-with-apache/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 21:32:23 +0000</pubDate>
		<dc:creator>iguler</dc:creator>
		
		<category>Apache</category>

		<guid isPermaLink="false">http://www.howtoinstall.net/2006/12/30/howto-mod_rewrite-with-apache/</guid>
		<description><![CDATA[Howto mod_rewrite with Apache
About mod_rewrite for Apache
This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule to provide a really flexible and powerful URL manipulation mechanism. The URL [...]]]></description>
			<content:encoded><![CDATA[<p class="style35">Howto mod_rewrite with Apache</p>
<p class="style33">About mod_rewrite for Apache</p>
<p class="style33">This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule to provide a really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on various tests, for instance server variables, environment variables, HTTP headers, time stamps and even external database lookups in various formats can be used to achieve a really granular URL matching.</p>
<p class="style33">This module operates on the full URLs (including the path-info part) both in per-server context (httpd.conf) and per-directory context (.htaccess) and can even generate query-string parts on result. The rewritten result can lead to internal sub-processing, external request redirection or even to an internal proxy throughput.</p>
<p class="style33">But all this functionality and flexibility has its drawback: complexity. So don&#8217;t expect to understand this entire module in just one day.</p>
<p class="style33">Using Apache&#8217;s mod_rewrite</p>
<p class="style33">The Apache module mod_rewrite can be used to perform various forms of URI acrobatic manipulation. A prerequisite concept before attempting to understand mod_rewrite are regular expressions.</p>
<p class="style33">When a URL is requested by a server, this does not necessarily map directly to the server&#8217;s filesystem. This request can be twisted and turned to (hopefully) present more sense to the browsing user.</p>
<p class="style33">Why should I care?</p>
<p class="style33">A clean URL is part of a good user experience. It works as a breadcrumb trail - allowing the user to see where they are located in the site, it doesn&#8217;t break in bookmarks, you can easily send it over email, and allows users to guess where they want to go next. Most importantly a easy to read URL will be indexed by search engines such as Google. Having all your pages indexed creates a huge advantage to getting visitors to your website. Many search engine robots cannot read a URL with symbols such as ? &#038; or commas and therefor not indexing your website.</p>
<p class="style33">This is all possible by using human-readable URLs:</p>
<p class="style33">&#8220;In principle, users should not need to know about URLs which are a machine-level addressing scheme. In practice, users often go to websites or individual pages through mechanisms that involve exposure to raw URLs.&#8221; &#8212; Jakob Neilsen, Jakob Nielsen&#8217;s Alertbox, March 21, 1999: URL as UI</p>
<p class="style33">&#8220;a URL should contain human-readable directory and file names that reflect the nature of the information space.&#8221; &#8212; Jakob Nielsen, item #4 Top Ten Mistakes in Web Design</p>
<p class="style33">By choosing a well thought-out URL, you won&#8217;t have to change it during the next re-organization. URLs that remain the same tend to pick up more links over time.</p>
<p class="style33">Getting started:</p>
<p class="style33">First, Apache must be compiled with the mod_rewrite module for any of this to take place. Insert these lines into the vhost definition for the domain that you want to work with.</p>
<p class="style33">RewriteEngine on<br />
RewriteLog /path/to/logs/server.rewrite.txt<br />
RewriteLogLevel 1</p>
<p class="style33">The first line turns the RewriteEngine on. Otherwise, extra code doesn&#8217;t get processed by the Apache webserver. Next, we specify where the logfile that records the rewrite activity should be placed. This is mostly for debugging, as your CustomLog should be keeping track of traffic.</p>
<p class="style33">A beginning example:</p>
<p class="style33">One of the simplest uses of mod_rewrite is to re-direct a web request from one page to another. Many times this will be done if the first has expired, was spelled wrong, or the site has a new naming scheme. It&#8217;s nice to forward new users to the correct page in case they have the previous one bookmarked, or if a search engine has cached the old location.</p>
<p class="style33">RewriteRule ^/biogarphy.php3 /biography/ [R=301]</p>
<p class="style33">This forwards a browser request from one page to the other. because the [R=301] at the end. I&#8217;ve taken a file that was spelled wrong, and fixed it at the same time removing a an old filetype suffix. (php4 has replaced that suffix with .php) What if I were to dump php from my system, and go with *.html, *.jsp, or even *.willie? By rewriting my URI to look like a directory, it doesn&#8217;t matter what filetype I&#8217;m using, nor what my DirectoryIndex options are.</p>
<p class="style33">Compound Example:</p>
<p class="style33">What if you used the above example, but didn&#8217;t decide to create a &#8220;biography&#8221; directory at your Doc-root? Apache can still be told where the content resides by including another RewriteRule following the first. Rules will continue attempting to match until a &#8220;last&#8221; case is presented with the [L] modifier at the end. This is much like a switch programming structure, using break to prevent each option from being executed.</p>
<p class="style33">RewriteRule ^/biography/ /biogarphy.php3 [L]</p>
<p class="style33">This might seem a little redundant, since we just did the opposite. This line will tell requests to &#8220;biography&#8221; to read the content from /biogarphy.php3 instead of looking for a biography directory. Confusing? Well, I could do this instead:</p>
<p class="style33">RewriteRule ^/(.+)/?$ /content/$1.php [L]</p>
<p class="style33">I can search on anything that follows the beginning slash, and replace the file request to look for that file in the content directory through the use of the regular expression and the backreference.</p>
<p class="style33">I&#8217;ve also placed this inside another directory that I don&#8217;t necessarily want the browsing user to see, or know about, but it&#8217;s easier for the webmaster to keep track of the roles of each file on the site. Since I&#8217;ve upgraded from php3 to php4 the suffix has changed.</p>
<p class="style33">More Advanced - the Query String:</p>
<p class="style33">The query string is passed in separately from the URL. This means that a simple regex doesn&#8217;t necessarily do the trick, but a compound statement using RewriteCond (condition) is required.</p>
<p class="style33">RewriteCond %{QUERY_STRING} id=([^&#038;;]*)<br />
RewriteRule ^/$ http://%{SERVER_NAME}/%1/? [R]<br />
RewriteRule ^/([^/]*)/?$ /index.php?id=$1 [L]</p>
<p class="style33">The RewriteCondition matches only when the following condition is true, and continues until a &#8220;last&#8221; [L] is stated. The Condition&#8217;s backreferences are different, using the % prefix, and their scope lasts beyond the Condition line.</p>
<p class="style33">This above example would translate &#8220;/?id=home&#8221; into &#8220;/home/&#8221;, and then re-assign the value of &#8220;home&#8221; to the id HTTP_GET_VAR. One more thing to notice here is that the the second line has a trailing ? - this is used to negate copying of the query string into the new, re-directed URI.</p>
<p class="style33">More Reference Links:</p>
<p class="style33">http://www.engelschall.com/pw/apache/rewriteguide/<br />
http://httpd.apache.org/docs/mod/mod_rewrite.html<br />
http://httpd.apache.org/docs/misc/rewriteguide.html
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.howtoinstall.net/2006/12/30/howto-mod_rewrite-with-apache/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.638 seconds -->
