{"id":778,"date":"2002-07-31T15:30:00","date_gmt":"2002-07-31T15:30:00","guid":{"rendered":"https:\/\/jasonmartin.info\/?p=778"},"modified":"2002-07-31T15:30:00","modified_gmt":"2002-07-31T15:30:00","slug":"howto-quick-and-easy-apache-php-mysql-mod_gzip","status":"publish","type":"post","link":"https:\/\/www.jasonmartin.info\/index.php\/2002\/07\/31\/howto-quick-and-easy-apache-php-mysql-mod_gzip\/","title":{"rendered":"HOWTO: Quick and Easy Apache, PHP, MySQL, Mod_Gzip"},"content":{"rendered":"\n<p>O.K. first things you will need to download the source tarballs for each file Apache 1.3.24 (<a href=\"http:\/\/www.apache.org\/dist\/httpd\/apache_1.3.26.tar.gz\">http:\/\/www.apache.org\/dist\/httpd\/apache_1.3.26.tar.gz<\/a>) PHP 4.2.2 (<a href=\"http:\/\/ca.php.net\/do_download.php?download_file=php-4.2.2.tar.gz\">http:\/\/ca.php.net\/do_download.php?download_file=php-4.2.2.tar.gz<\/a>) MySQL 3.23.51 (<a href=\"http:\/\/www.mysql.com\/Downloads\/MySQL-3.23\/mysql-3.23.51.tar.gz\">http:\/\/www.mysql.com\/Downloads\/MySQL-3.23\/mysql-3.23.51.tar.gz<\/a>) and the pre-compiled Mod_Gzip 1.3.19.1a Module (<a href=\"http:\/\/www.remotecommunications.com\/apache\/mod_gzip\/src\/1.3.19.1a\/mod_gzip.so\">http:\/\/www.remotecommunications.com\/apache\/mod_gzip\/src\/1.3.19.1a\/mod_gzip.so<\/a>)<br><br><em>(*Note* These are the current versions of the software as of the date 07\/31\/2002)<\/em><br><br>Once you have downloaded and saved all those files start by uncompressing MySQL by typing &#8216;gzip -dc mysql-3.23.51.tar.gz | tar xvvf -&#8216; followed by &#8216;cd mysql-3.23.51&#8217;.<br>The next step will be to run the configure script. This is done by typing:<br>&#8216;.\/configure &#8211;prefix=\/usr\/local\/mysql&#8217; ( the &#8211;prefix flag will tell the config script where to install mysql too, in this case its \/usr\/local\/mysql, you can use something different, but this is what I use \ud83d\ude42 )<br>After it is done going through the configuration process and it makes all the make files you can type &#8216;make&#8217;. After it is done building the last command you have to do is &#8216;make install&#8217;. Now that, &#8216;make install&#8217; has finished you may think your done, but your not. Follow these simple directions and you will be completed the first task.<br><br>Type the following commands at the command prompt:<br><br>&#8216;groupadd mysql&#8217; This will add the mysql group<br>&#8216;useradd -g mysql mysql&#8217; This will add a mysql user to the mysql group<br>&#8216;scripts\/mysql_install_db&#8217; This will install the default databases<br>&#8216;chown -R root \/usr\/local\/mysql&#8217; This will change the ownership of \/usr\/local\/mysql<br>&#8216;chown -R mysql \/usr\/local\/mysql\/var&#8217; Same with this one<br>&#8216;chgrp -R mysql \/usr\/local\/mysql&#8217; This changes the group<br>&#8216;cp support-files\/my-medium.cnf \/etc\/my.cnf&#8217; Copies the conf file<br>&#8216;\/usr\/local\/mysql\/bin\/safe_mysqld &#8211;user=mysql &amp;&#8217;<br><br><br>There now you are done installing mysql.<br><br>Now onto the next step. It&#8217;s a fairly simple step. All as you have to do is type the following:<br><br>&#8216;gzip -dc apache_1.3.26.tar.gz | tar xvvf -&#8216;<br>&#8216;cd apache_1.3.26&#8217;<br>&#8216;.\/configure &#8211;prefix=\/usr\/local\/apache&#8217; You can also place this wherever you like.<br><br><br>That is all you have to do so far for apache.<br><br>Now for php. Type the following commands:<br><br>&#8216;gzip -dc php-4.2.2.tar.gz | tar xvvf -&#8216;<br>&#8216;cd php-4.2.2&#8217;<br>&#8216;.\/configure &#8211;with-mysql=\/usr\/local\/mysql &#8211;with-apache=..\/apache_1.3.26&#8217; Point &#8211;with-apache to your apache src dir<br>&#8216;make&#8217;<br>&#8216;make install&#8217;<br><br>When its done compiling php is done. Just a couple more things to do and your done. Go back to your apache directory and type:<br><br>&#8216;.\/configure &#8211;prefix=\/usr\/local\/apache &#8211;enable-module=so &#8211;activate-module=src\/modules\/php4\/libphp4.a&#8217;<br>&#8216;make&#8217;<br>&#8216;make install&#8217;<br><br>The last and final step, is to copy mod_gzip.so to \/usr\/lib\/apache\/<br><br>There, you are now done building your packages, now to configure them.<br><br>Change the directory to \/usr\/local\/apache\/conf (or wherever\/you\/put\/apache\/conf) and edit the httpd.conf<br><br>Find the line that contains &#8216;DirectoryIndex index.html&#8217; and make it look like &#8216;DirectoryIndex index.html index.php&#8217;<br><br>This step allows index.php to be recognized as an index file.<br><br>Now open up \/usr\/local\/apache\/conf\/httpd.conf and insert the following line:<br><br>AddType application\/x-httpd-php .php<br><br>Now php is ready to work with apache, onto mod_gzip.<br>Look for the line that contains &#8216;# LoadModule foo_module modules\/mod_foo.so&#8217; And right below it add the line. &#8216;LoadModule gzip_module modules\/mod_gzip.so&#8217;<br><br>Then right below that add the following lines:<br># [mod_gzip configuration]<br>mod_gzip_on Yes<br>mod_gzip_minimum_file_size 300<br>mod_gzip_maximum_file_size 0<br>mod_gzip_maximum_inmem_size 100000<br>mod_gzip_keep_workfiles No<br>mod_gzip_temp_dir \/tmp<br>mod_gzip_dechunk Yes<br>mod_gzip_item_include file \\.htm$<br>mod_gzip_item_include file \\.html$<br>mod_gzip_item_include file \\.php$<br>mod_gzip_item_include file \\.pl$<br>mod_gzip_item_include file \\.cgi$<br>mod_gzip_item_include file \\.phps$<br>mod_gzip_item_include mime text\/.*<br><br>Save what you just did as httpd.conf (Don&#8217;t worry, overwrite the current httpd.conf) Then run &#8216;\/usr\/local\/apache\/bin\/apachectl configtest&#8217; If you edited your config file right (which you should have) you will see the line &#8216;Syntax OK&#8217;<br>You can now start your apache server by typing &#8216;\/usr\/local\/apache\/bin\/apachectl start&#8217;<br>Now, to see if it is all working:<br>To see if apache and mysql are running type:<br><br>&#8216;ps -aux | grep apache&#8217; (If apache is running it will show running apache processes)<br>&#8216;ps -aux | grep mysql&#8217; (If mysql is running, again, it will show)<br><br>Now to see if php worked. Make a file in &#8216;\/usr\/local\/apache\/htdocs&#8217; called &#8216;test.php&#8217; and insert the following line of code into it: &lt;? phpinfo(); ?&gt;<br><br>Now load http:\/\/localhost\/test.php in your browser. You will get fairly large page with all your php information in it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A really quick tutorial on how to compile Apache, PHP, MySQL, and Mod_Gzip from source.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[16,30,31,32,37],"class_list":["post-778","post","type-post","status-publish","format-standard","hentry","category-linux","tag-apache","tag-linux","tag-mod_gzip","tag-mysql","tag-php"],"_links":{"self":[{"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/posts\/778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/comments?post=778"}],"version-history":[{"count":0,"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/posts\/778\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/media?parent=778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/categories?post=778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasonmartin.info\/index.php\/wp-json\/wp\/v2\/tags?post=778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}