{"id":427,"date":"2010-12-17T17:05:31","date_gmt":"2010-12-17T12:05:31","guid":{"rendered":"http:\/\/linuxndme.com\/?p=109"},"modified":"2010-12-17T17:05:31","modified_gmt":"2010-12-17T12:05:31","slug":"lamp-installation-from-source","status":"publish","type":"post","link":"https:\/\/blog.nixwind.com\/?p=427","title":{"rendered":"LAMP installation from source"},"content":{"rendered":"<p><strong>Overview<\/strong><\/p>\n<p>Installing Apache ( 2.2.17 ) , Mysql ( 5.1.54 ) and php ( 5.3.4 ) on a Centos server.<\/p>\n<p><strong>Requirements<\/strong><\/p>\n<p>Centos Server<\/p>\n<p><strong>Objective<\/strong><\/p>\n<p>Building from source an optimised\/light Apache-Mysql-PHP on top of Centos server<\/p>\n<p><strong>Configuration<\/strong><\/p>\n<p><strong>Step 1<\/strong><\/p>\n<p>Install Mysql<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>groupadd mysql<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>useradd -r -g mysql mysql<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cd \/usr\/local<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>wget http:\/\/dev.mysql.com\/get\/Downloads\/MySQL-5.1\/mysql-5.1.54-linux-i686-glibc23.tar.gz\/from\/http:\/\/mysql.easynet.be\/<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>gunzip &lt; <\/strong><strong> \/usr\/local\/<\/strong><strong>mysql-5.1.54-linux-i686-glibc23.tar.gz<\/strong><strong> | tar xvf &#8211;<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>ln -s \/usr\/local\/mysql-5.1.54-linux-i686-glibc23 mysql<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cd mysql<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>chown -R mysql .<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>chgrp -R mysql .<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>scripts\/mysql_install_db &#8211;user=mysql<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>chown -R root .<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>chown -R mysql data<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cp \/usr\/local\/mysql\/support-files\/my-small.cnf \/etc\/my.cnf<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>bin\/mysqld_safe &#8211;user=mysql &amp;<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cp \/usr\/local\/mysql\/support-files\/mysql.server \/etc\/init.d\/mysql<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~#<\/span> ln -s \/usr\/local\/mysql\/bin\/* \/usr\/bin\/<\/strong><\/p>\n<p><strong>Step 2<\/strong><\/p>\n<p>Install Apache , also install the dependent packages and compilers. You have to install the below packages for the most needed compile options that I have used.<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>yum install gcc zlib-devel openssl-devel make<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cd \/usr\/local\/src\/<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>wget http:\/\/www.alliedquotes.com\/mirrors\/apache\/\/httpd\/httpd-2.2.17.tar.bz2<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>tar -jxvf httpd-2.2.17.tar.bz2<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cd \/usr\/local\/src\/httpd-2.2.17<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>.\/configure &#8211;prefix=\/usr\/local\/apache &#8211;host=i686-redhat-linux-gnu &#8211;build=i686-redhat-linux-gnu &#8211;target=i386-redhat-linux\u00a0 &#8211;enable-deflate &#8211;enable-proxy &#8211;enable-proxy-http&#8212;enable-proxy-connect &#8211;enable-so &#8211;enable-cgi &#8211;enable-info &#8211;enable-rewrite &#8211;enable-speling &#8211;enable-usertrack &#8211;enable-deflate &#8211;enable-mime-magic &#8211;enable-ssl<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>make<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>make install<\/strong><\/p>\n<p><strong>Step 3 <\/strong><\/p>\n<p>Install php, as we did before you need to install the dependencies before the php installation<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cd \/usr\/local\/src\/<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>wget http:\/\/in2.php.net\/get\/php-5.3.4.tar.bz2\/from\/us.php.net\/mirror<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>tar -jxvf php-5.3.4.tar.bz2<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>cd \/usr\/local\/src\/php-5.3.4\/<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>yum install libxml2-devel pcre-devel bzip2-devel curl-devel libjpeg-devel libpng-devel libXpm-devel libc-client-devel libmcrypt-devel libmcrypt-devel expat-devel<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>.\/configure &#8211;with-apxs2=\/usr\/local\/apache\/bin\/apxs &#8211;enable-bcmath &#8211;enable-calendar &#8211;enable-ftp &#8211;enable-libxml &#8211;enable-magic-quotes &#8211;enable-pdo=shared &#8211;enable-soap &#8211;enable-sockets &#8211;enable-zip &#8211;prefix=\/usr &#8211;with-bz2 &#8211;with-curl=\/opt\/curlssl\/ &#8211;with-gd &#8211;with-imap=\/opt\/php_with_imap_client\/ &#8211;with-imap-ssl=\/usr &#8211;with-jpeg-dir=\/usr &#8211;with-kerberos &#8211;with-libexpat-dir=\/usr &#8211;with-libxml-dir &#8211;with-libxml-dir &#8211;with-mcrypt=\/opt\/libmcrypt\/ &#8211;with-mhash=\/opt\/mhash\/ &#8211;with-mysql=\/usr\/local\/mysql\/ &#8211;with-mysql-sock &#8211;with-openssl=\/usr &#8211;with-openssl-dir=\/usr &#8211;with-pcre-regex &#8211;with-pdo-mysql=shared &#8211;with-pdo-sqlite=shared &#8211;with-png-dir=\/usr &#8211;with-sqlite=shared &#8211;with-xmlrpc &#8211;with-xpm-dir=\/usr &#8211;with-zlib &#8211;with-zlib-dir=\/usr<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>make<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>make install<\/strong><br \/>\n<strong>Step 4<\/strong><\/p>\n<p>Configure php to phrase .php extension as php<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>vi \/usr\/local\/apache\/conf\/httpd.conf<\/strong><\/p>\n<p>find the line &#8220;<em>LoadModule php5_module        modules\/libphp5.so<\/em>&#8221; add the below line after it.<br \/>\n<em>AddType application\/x-httpd-php .php<\/em><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span> \/usr\/local\/apache\/bin\/apachectl restart <\/strong><\/p>\n<p><strong>Step 5<\/strong><\/p>\n<p>That is it, you can now test your installation<\/p>\n<p><strong>echo &#8220;<em>&lt;?php phpinfo(); ?&gt;<\/em><\/strong><strong> <\/strong><strong>&#8221; &gt; \/usr\/local\/apache\/htdocs\/phpinfo.php<\/strong><\/p>\n<p>Access and check your phpinfo page with,<br \/>\nhttp:\/\/your_server_ip\/phpinfo.php<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Installing Apache ( 2.2.17 ) , Mysql ( 5.1.54 ) and php ( 5.3.4 ) on a Centos server. Requirements Centos Server Objective Building from source an optimised\/light Apache-Mysql-PHP on top of Centos server Configuration Step 1 Install Mysql root@serv:~# groupadd mysql root@serv:~# useradd -r -g mysql mysql root@serv:~# cd \/usr\/local root@serv:~# wget http:\/\/dev.mysql.com\/get\/Downloads\/MySQL-5.1\/mysql-5.1.54-linux-i686-glibc23.tar.gz\/from\/http:\/\/mysql.easynet.be\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[60,62,64],"tags":[102,61,63,65],"_links":{"self":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/427"}],"collection":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=427"}],"version-history":[{"count":0,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/427\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}