{"id":6457,"date":"2017-02-02T12:31:41","date_gmt":"2017-02-02T04:31:41","guid":{"rendered":"http:\/\/rmohan.com\/?p=6457"},"modified":"2017-02-02T12:31:41","modified_gmt":"2017-02-02T04:31:41","slug":"centos-lamp","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6457","title":{"rendered":"CentOS LAMP"},"content":{"rendered":"<p># mount \/dev\/cdrom \/mnt\/cdrom<\/p>\n<p># vi \/etc\/yum.repos.d\/CentOS-Media.repo<\/p>\n<p>[c5-media]<br \/>\nname=CentOS-$releasever &#8211; Media<br \/>\nbaseurl=file:\/\/\/mnt\/cdrom<br \/>\nfile:\/\/\/media\/cdrom\/<br \/>\nfile:\/\/\/media\/cdrecorder\/<br \/>\ngpgcheck=1<br \/>\nenabled=1<br \/>\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-5<\/p>\n<p>2?<br \/>\n\/etc\/yum.repos.d\/CentOS-Base.repo<br \/>\n# mv \/etc\/yum.repos.d\/CentOS-Base.repo \/backup<\/p>\n<p>3? gcc?gcc-c++<br \/>\nyum -y install gcc<br \/>\nyum -y install gcc-c++<\/p>\n<p>2? RPM Apache?MySQL httpd?mysqld<\/p>\n<p>service httpd stop<br \/>\nservice mysqld stop<\/p>\n<p>chkconfig\u00a0 &#8211;level\u00a0 2345\u00a0 httpd?mysqld?\u00a0 off<\/p>\n<p>3? SELinux?<\/p>\n<p>1? SELinux<\/p>\n<p># vi \/etc\/selinux\/config<\/p>\n<p>SELINUX=disabled<\/p>\n<p>2?Netfilter\/iptables<\/p>\n<p># iptables\u00a0 -F<\/p>\n<p>iptables -Z<\/p>\n<p>iptables\u00a0 -X<\/p>\n<p>4?<\/p>\n<p># ntsysv<\/p>\n<p>atd<\/p>\n<p>crond\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # atd?crond<\/p>\n<p>irqbalance<\/p>\n<p>microcode_ctl<\/p>\n<p>network<\/p>\n<p>sendmail<\/p>\n<p>sshd<\/p>\n<p>syslog<\/p>\n<p>5<\/p>\n<p># vi tar.sh<br \/>\ncd \/lamp<br \/>\n\/bin\/ls *.tar.gz &gt; ls.list<br \/>\n\/bin\/ls *.tgz &gt;&gt; ls.list<br \/>\nfor TAR in `cat ls.list`<br \/>\ndo<br \/>\n\/bin\/tar -zxf $TAR<br \/>\ndone<br \/>\n\/bin\/rm ls.list<\/p>\n<p>#yum\u00a0 install\u00a0 -y\u00a0 libxml2-devel<\/p>\n<p>cd \/lamp\/libxml2-2.6.30<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/libxml2\/<br \/>\nmake<br \/>\nmake install<br \/>\n# libmcrypt<br \/>\nlibmcrypt DES, 3DES, RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUR, SERPENT, SAFER+<br \/>\ncd \/lamp\/libmcrypt-2.5.8<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/libmcrypt\/<br \/>\nmake<br \/>\nmake install<\/p>\n<p>#libltdl?libmcrypt<\/p>\n<p>cd \/lamp\/libmcrypt-2.5.8\/libltdl<\/p>\n<p>.\/configure &#8211;enable-ltdl-install<\/p>\n<p>make<\/p>\n<p>make install<\/p>\n<p>zlib<\/p>\n<p>cd \/lamp\/zlib-1.2.3<\/p>\n<p>.\/configure<\/p>\n<p>make<\/p>\n<p>make install\u00a0 &gt;&gt;\u00a0 \/root\/zlib.log<\/p>\n<p>#libpng<br \/>\ncd \/lamp\/libpng-1.2.31<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/libpng\/<br \/>\nmake<br \/>\nmake install<\/p>\n<p>#jpeg6<\/p>\n<p>mkdir \/usr\/local\/jpeg6<br \/>\nmkdir \/usr\/local\/jpeg6\/bin<br \/>\nmkdir \/usr\/local\/jpeg6\/lib<br \/>\nmkdir \/usr\/local\/jpeg6\/include<br \/>\nmkdir -p \/usr\/local\/jpeg6\/man\/man1<br \/>\ncd \/lamp\/jpeg-6b<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/jpeg6\/ &#8211;enable-shared &#8211;enable-static<br \/>\nmake<br \/>\nmake install<br \/>\n* &#8211;enable-shared?&#8211;enable-static<\/p>\n<p>freetype<br \/>\ncd \/lamp\/freetype-2.3.5<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/freetype\/<br \/>\nmake<br \/>\nmake install<\/p>\n<p>#autoconf<br \/>\ncd \/lamp\/autoconf-2.61<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<\/p>\n<p>GD<\/p>\n<p>mkdir \/usr\/local\/gd2<br \/>\ncd \/lamp\/gd-2.0.35<br \/>\n* png<\/p>\n<p>vi gd_png.c<\/p>\n<p>#include \u201cpng.h\u201d\u00a0 #include &#8220;\/usr\/local\/libpng\/include\/png.h&#8221;<\/p>\n<p>.\/configure &#8211;prefix=\/usr\/local\/gd2\/ &#8211;with-jpeg=\/usr\/local\/jpeg6\/ &#8211;with-freetype=\/usr\/local\/freetype\/ &#8211;with-png=\/usr\/local\/libpng\/<br \/>\nmake<br \/>\nmake install<\/p>\n<p>Apache<br \/>\ncd \/lamp\/httpd-2.2.9<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/apache2\/ &#8211;sysconfdir=\/usr\/local\/apache2\/etc\/ &#8211;with-included-apr &#8211;enable-so &#8211;enable-deflate=shared &#8211;enable-expires=shared &#8211;enable-rewrite=shared<br \/>\nmake &amp;&amp; make install<\/p>\n<p>Apache<br \/>\n\/usr\/local\/apache2\/bin\/apachectl start<br \/>\nps \u2013aux | grep httpd<br \/>\nnetstat \u2013tlun | grep :80<\/p>\n<p>\/usr\/local\/apache2\/modules\/mod_deflate.so<br \/>\nchcon -t texrel_shlib_t \/usr\/local\/apache2\/modules\/mod_deflate.so ?<br \/>\n\u201cchcon -t texrel_shlib_t<\/p>\n<p>echo &#8220;\/usr\/local\/apache2\/bin\/apachectl start&#8221; &gt;&gt; \/etc\/rc.d\/rc.local<\/p>\n<p>Ncurses<\/p>\n<p>1?yum -y install \u201cncurses*\u201d<\/p>\n<p>2?<\/p>\n<p>cd \/lamp\/ncurses-5.6<\/p>\n<p>.\/configure &#8211;with-shared &#8211;without-debug &#8211;without-ada &#8211;enable-overwrite<\/p>\n<p>make<\/p>\n<p>make install<\/p>\n<p># MySQL<br \/>\ngroupadd mysql<br \/>\nuseradd -g mysql mysql<br \/>\ncd \/lamp\/mysql-5.1.59<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/mysql &#8211;without-debug &#8211;enable-thread-safe-client &#8211;with-pthread &#8211;enable-assembler &#8211;enable-profiling &#8211;with-mysqld-ldflags=-all-static &#8211;with-client-ldflags=-all-static &#8211;with-extra-charsets=all &#8211;with-plugins=all &#8211;with-mysqld-user=mysql &#8211;without-embedded-server &#8211;with-server-suffix=-community &#8211;with-unix-socket-path=\/tmp\/mysql.sock<\/p>\n<p>make<\/p>\n<p>make install<\/p>\n<p>cp \/usr\/local\/mysql\/share\/mysql\/my-medium.cnf\u00a0 \/etc\/my.cnf<\/p>\n<p>vi\u00a0 \/etc\/my.cnf<\/p>\n<p>1)[client]<\/p>\n<p>default-character-set=utf8<\/p>\n<p>2)[ mysqld]<\/p>\n<p>character-set-server=utf8<\/p>\n<p>collation-server = utf8_general_ci<\/p>\n<p>setfacl -m u:mysql:rwx -R \/usr\/local\/mysql<\/p>\n<p>setfacl -m d:u:mysql:rwx -R \/usr\/local\/mysql<\/p>\n<p>* acl mysql \/usr\/local\/mysql<\/p>\n<p>\/usr\/local\/mysql\/bin\/mysql_install_db &#8211;user=mysql<\/p>\n<p>MySQL?<\/p>\n<p>1.mysql<\/p>\n<p>\/usr\/local\/mysql\/bin\/mysqld_safe &#8211;user=mysql &amp;<\/p>\n<p>2.<\/p>\n<p>vi \/etc\/rc.local<\/p>\n<p>\/usr\/local\/mysql\/bin\/mysqld_safe &#8211;user=mysql &amp;<\/p>\n<p>3.mysql<\/p>\n<p>\/usr\/local\/mysql\/bin\/mysqladmin -uroot password 123<\/p>\n<p>history\u00a0 -c<\/p>\n<p>* mysql root lampbrother<\/p>\n<p>\u201clampbrother\u201d<\/p>\n<p>\/usr\/local\/mysql\/bin\/mysql -u root -p<\/p>\n<p>mysql&gt;show databases;<\/p>\n<p>mysql&gt;use test;<\/p>\n<p>mysql&gt;show tables;<br \/>\nmysql&gt; exit<\/p>\n<p>PHP<br \/>\nlibtool libtool-ltdl<\/p>\n<p>yum -y install \u201clibtool*\u201d<\/p>\n<p>yum -y install \u201clibtool-ltdl*\u201d<\/p>\n<p>cd \/lamp\/php-5.2.6<\/p>\n<p>.\/configure &#8211;prefix=\/usr\/local\/php\/ &#8211;with-config-file-path=\/usr\/local\/php\/etc\/ &#8211;with-apxs2=\/usr\/local\/apache2\/bin\/apxs &#8211;with-mysql=\/usr\/local\/mysql\/ &#8211;with-libxml-dir=\/usr\/local\/libxml2\/ &#8211;with-jpeg-dir=\/usr\/local\/jpeg6\/ &#8211;with-png-dir=\/usr\/local\/libpng\/ &#8211;with-freetype-dir=\/usr\/local\/freetype\/ &#8211;with-gd=\/usr\/local\/gd2\/ &#8211;with-mcrypt=\/usr\/local\/libmcrypt\/ &#8211;with-mysqli=\/usr\/local\/mysql\/bin\/mysql_config &#8211;enable-soap &#8211;enable-mbstring=all &#8211;enable-sockets<\/p>\n<p>l<\/p>\n<p>&#8211;with-config-file-path=\/usr\/local\/php\/etc\/<\/p>\n<p>&#8211;with-apxs2=\/usr\/local\/apache2\/bin\/apxs<\/p>\n<p>&#8211;with-mysql=\/usr\/local\/mysql\/<\/p>\n<p>&#8211;with-libxml-dir=\/usr\/local\/libxml2<\/p>\n<p>&#8211;with-jpeg-dir=\/usr\/local\/jpeg6\/<\/p>\n<p>&#8211;with-png-dir=\/usr\/local\/libpng\/<\/p>\n<p>&#8211;with-freetype-dir=\/usr\/local\/freetype\/<\/p>\n<p>&#8211;with-gd=\/usr\/local\/gd2\/<\/p>\n<p>&#8211;with-mcrypt=\/usr\/local\/libmcrypt\/<\/p>\n<p>&#8211;with-mysqli=\/usr\/local\/mysql\/bin\/mysql_config<\/p>\n<p>&#8211;enable-soap<\/p>\n<p>&#8211;enable-mbstring=all<\/p>\n<p>&#8211;enable-sockets<\/p>\n<p>make<br \/>\nmake install<\/p>\n<p>php.ini<\/p>\n<p>cp \/lamp\/php-5.2.6\/php.ini-dist\u00a0 \/usr\/local\/php\/etc\/php.ini<\/p>\n<p>vi \/usr\/local\/apache2\/etc\/httpd.conf<\/p>\n<p>AddType application\/x-httpd-php .php .phtml .phps<\/p>\n<p>* .phtml.phps PHP<\/p>\n<p>??Apache???\/usr\/local\/apache2\/bin\/apachectl stop<\/p>\n<p>\/usr\/local\/apache2\/bin\/apachectl start<\/p>\n<p>* Apache cannot restore segment prot after reloc: Permission denied<\/p>\n<p>chcon -t texrel_shlib_t \/usr\/local\/apache2\/modules\/libphp5.so<\/p>\n<p>?vi \/usr\/local\/apache2\/htdocs\/test.php<\/p>\n<p>&lt;?<\/p>\n<p>phpinfo();<\/p>\n<p>?&gt;<\/p>\n<p>?http:\/\/Apache\/test.php<\/p>\n<p>\/var\/www\/html\/<\/p>\n<p>#memcache<\/p>\n<p>cd \/lamp\/memcache-2.2.5<\/p>\n<p>\/usr\/local\/php\/bin\/phpize<\/p>\n<p>.\/configure &#8211;with-php-config=\/usr\/local\/php\/bin\/php-config<\/p>\n<p>make &amp;&amp; make install<\/p>\n<p>#PDO_MYSQL<\/p>\n<p>PDO PHP<\/p>\n<p>cd \/lamp\/PDO_MYSQL-1.0.2\/<\/p>\n<p>\/usr\/local\/php\/bin\/phpize<\/p>\n<p>.\/configure &#8211;with-php-config=\/usr\/local\/php\/bin\/php-config &#8211;with-pdo-mysql=\/usr\/local\/mysql<\/p>\n<p>make &amp;&amp; make install<\/p>\n<p>\/usr\/local\/php\/etc\/php.ini<\/p>\n<p>extension_dir = &#8220;\/usr\/local\/php\/\/lib\/php\/extensions\/no-debug-non-zts-20060613\/&#8221;<\/p>\n<p>extension=&#8221;memcache.so&#8221;;<\/p>\n<p>extension=&#8221;pdo.so&#8221;;<\/p>\n<p>extension=&#8221;pdo_mysql.so&#8221;;<\/p>\n<p># Zend<\/p>\n<p>cd \/lamp\/ZendOptimizer-3.2.6-linux-glibc21-i386<\/p>\n<p>.\/install.sh<\/p>\n<p>l Apache<\/p>\n<p>l \/usr\/local\/php\/etc\/<\/p>\n<p>l \/usr\/local\/apache2\/bin\/apachectl<\/p>\n<p>memcache<\/p>\n<p>yum -y install \u201clibevent*\u201d<\/p>\n<p>cd \/lamp\/memcached-1.4.10<\/p>\n<p>.\/configure &#8211;prefix=\/usr\/local\/memcache<\/p>\n<p>make &amp;&amp; make install<\/p>\n<p>useradd memcache<\/p>\n<p>passwd memcache<\/p>\n<p>* Linux root memcache?lampbrother?<\/p>\n<p>\/usr\/local\/memcache\/bin\/memcached -umemcache &amp;<\/p>\n<p>netstat an | grep :11211<\/p>\n<p>telnet 192.168.10.1 11211<\/p>\n<p>stats<\/p>\n<p>vi \/etc\/rc.d\/rc.local<\/p>\n<p>\/usr\/local\/memcache\/bin\/memcached -umemcache &amp;<\/p>\n<p>#phpMyAdmin<\/p>\n<p>cp -r \/lamp\/phpMyAdmin-3.0.0-rc1-all-languages \/usr\/local\/apache2\/htdocs\/phpmyadmin<\/p>\n<p>cd \/usr\/local\/apache2\/htdocs\/phpmyadmin<\/p>\n<p>cp config.sample.inc.php config.inc.php<\/p>\n<p>vi config.inc.php<\/p>\n<p>$cfg[&#8216;Servers&#8217;][$i][&#8216;auth_type&#8217;] = &#8216;cookie&#8217;;<\/p>\n<p>$cfg[&#8216;Servers&#8217;][$i][&#8216;auth_type&#8217;] = &#8216;http&#8217;;<\/p>\n<p>http:\/\/Apache\/phpmyadmin\/index.php<\/p>\n<p>GRANT ALL PRIVILEGES ON *.* TO &#8216;root&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;123&#8217; WITH GRANT OPTION;<\/p>\n","protected":false},"excerpt":{"rendered":"<p># mount \/dev\/cdrom \/mnt\/cdrom<\/p>\n<p># vi \/etc\/yum.repos.d\/CentOS-Media.repo<\/p>\n<p>[c5-media] name=CentOS-$releasever &#8211; Media baseurl=file:\/\/\/mnt\/cdrom file:\/\/\/media\/cdrom\/ file:\/\/\/media\/cdrecorder\/ gpgcheck=1 enabled=1 gpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-5<\/p>\n<p>2? \/etc\/yum.repos.d\/CentOS-Base.repo # mv \/etc\/yum.repos.d\/CentOS-Base.repo \/backup<\/p>\n<p>3? gcc?gcc-c++ yum -y install gcc yum -y install gcc-c++<\/p>\n<p>2? RPM Apache?MySQL httpd?mysqld<\/p>\n<p>service httpd stop service mysqld stop<\/p>\n<p>chkconfig &#8211;level 2345 httpd?mysqld? off<\/p>\n<p>3? SELinux?<\/p>\n<p>1? SELinux<\/p>\n<p># vi \/etc\/selinux\/config<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,5],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6457"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6457"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6457\/revisions"}],"predecessor-version":[{"id":6458,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6457\/revisions\/6458"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}