1. LAMP
2. Linux .................................................................................................................................4 .............................................................................................................21AMP ........................................................................................................................27 Apache .......................................................................................................................27 MySQL ........................................................................................................................34 ......................................................................................................................39 PHP .............................................................................................................................44 Zend ...........................................................................................................................50 3. UpDate by 4/28/2012 4. LAMP LAMP Linux Linux CentOS 5.6 x86-64httpd-2.2.22.tar.gzphp-5.2.17.tar.bz2mysql-5.1.50.tar.gz 6 libxml2-2.6.27.tar.gzjpegsrc.v6b.tar.gzlibpng-1.2.16.tar.gzfreetype-2.1.10.tar.gzfreetds-0.82.tar.gzgd-2.0.33.tar.gzlibmcrypt-2.5.3.tar.gzzlib-1.2.5.tar.gzLinux Linux CentOS 5.6 X86-64 5. linux text skip 6. Next........... 7. 8. 9. 10. /boot 200M / 20G 11. swap 2 8-16G swap 16G 16Gswap 12. 13. IP IP Prefix(Netmask)24255.255.255.0 IPv6 IPv6 14. DNS// UTC(S) UTC(S) BIOS / +8 UTC 0 15. ROOT 16. 17. Sysstat 18. Sysstat 19. 20. Firewall Configuretion Disabled SELinuxDisbaled 21. Linux Linux AMP Linux SSH SSH SSH Secure Shell IETF Network Working Group SSH SSH PuTTy SecureCRT PuTTy 22. IP 22 Linux rootRoot 23. root root 2012 4 6 10:22:51 IP192.168.xxx.xxx linux echo "session required /lib64/security/pam_limits.so" >> /etc/pam.d/loginecho "* soft nofile 51200* hard nofile 51200" >> /etc/security/limits.conf 24. echo 16 > /sys/block/sda/queue/read_ahead_kbecho 512 > /sys/block/sda/queue/nr_requests linux ip Vi /etc/profilePROMPT_COMMAND={ date "+%Y-%m-%d %T ##### USER:$USER IP:$SSH_CLIENT PS:$SSH_TTY #### $(history 1 | { read x cmd; echo "$cmd"; })"; } >> /var/log/`date +%Y%m`.log 25. Init3 rm -rf /etc/rc3.d/* ls Ls /etc/rc3.d/ 26. chkconfig --add sysstatchkconfig --add syslogchkconfig --add rsyncchkconfig --add crondchkconfig --add xinetdchkconfig --add irqbalancechkconfig --add cpuspeedchkconfig --add sshdchkconfig --add mdmonitorchkconfig --add networkchkconfig --level 3 syslog onchkconfig --level 3 crond onchkconfig --level 3 xinetd onchkconfig --level 3 irqbalance onchkconfig --level 3 cpuspeed onchkconfig --level 3 sshd onchkconfig --level 3 sysstat onchkconfig --level 3 mdmonitor onchkconfig --level 3 network onchkconfig --level 3 cpuspeed onchkconfig --level 3 mdmonitor onchkconfig --level 3 mcstrans onchkconfig --level 3 mdmonitor onchkconfig --level 3 messagebus onchkconfig --level 3 rawdevices onchkconfig --level 3 readahead_early onchkconfig --level 3 restorecond onchkconfig --level 3 rpcgssd onchkconfig --level 3 rpcidmapd on 27. AMP Apache Apache useradd -s /sbin/nologin apache 28. tar httpd tar -zxvf httpd-2.2.22.tar.gz 29. ./configure --prefix=/usr/local/apache --datadir=/www --enable-rewrite --enable-cgi --enable-so --enable-cache --enable-mime-magic --enable-mem-cache --enable-modules=so --enable-mods-shared=all --enable-cache --enable-disk-cache --with-mpm=prefork 30. GCCmakemake install 31. echo "PATH=$PATH:/usr/local/apache/bin" >> /etc/profile Apache PATHsource /etc/profile apachectl start Apache It works! Apache 32. Apache vi /usr/local/apache/bin/apachectlvi /usr/local/apache/bin/apachectl# chkconfig: - 85 15# description: Apache is a World Wide Web server. It is used to serve# HTML files and CGI. 33. httpd.conf vi /usr/local/apsche/conf/httpd.confUser apacheGroup apacheDocumentRoot "/www"Options FollowSymLinksAllowOverride allOrder deny,allowDeny from allOptions FollowSymLinks AllowOverride allOrder allow,deny Allow from allDirectoryIndex index.php index.html index.html.varOrder allow,deny Allow from allSatisfy AllInclude conf/extra/httpd-mpm.conf 34. Include conf/extra/httpd-autoindex.confInclude conf/extra/httpd-languages.confInclude conf/extra/httpd-info.confInclude conf/extra/httpd-manual.confInclude conf/extra/httpd-dav.confInclude conf/extra/httpd-default.confcp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd apachectl httpdchmod +x /etc/rc.d/init.d/httpd httpd chkconfig --add httpd chkconfig --level 345 httpd on MySQL 35. mysql useradd -s /sbin/nologin mysqltar -zxvf mysql-5.1.50.tar.gzautoreconf --force --install 36. ./configure --prefix=/mysql --with-plugins=innobase,partition,csv,myisam,innodb_plugin,heap--enable-local-infile --with-embedded-server --with-client-ldflags=-all-static --with-big-tables--with-mysqld-ldflags=-all-static --with-mysqld-user=mysql --enable-assembler --with-extra-charsets=all --with-unix-socket-path=/tmp/mysql.sock./configure --prefix=/mysql --without-server --with-client-ldflags=-all-static --enable-local-infile--with-big-tables --with-mysqld-ldflags=-all-static --with-mysqld-user=mysql --enable-assembler--with-extra-charsets=all --with-unix-socket-path=/tmp/mysql.sockmakemake install 37. 38. echo "/mysql/lib/mysql" >> /etc/ld.so.conf/sbin/ldconfigln -s /mysql/lib/mysql /usr/lib64/mysqlln -s /mysql/include/mysql /usr/include/mysql#echo " /mysql/lib/mysql" >> /etc/ld.so.conf && ldconfig -v | grep libmysqlclient/mysql/bin/mysql_install_db --user=mysql 39. cp support-files/mysql.server /etc/rc.d/init.d/mysqldchmod +x /etc/rc.d/init.d/mysqldecho "PATH=$PATH:/mysql/bin" >> /etc/profile && source /etc/profilechkconfig --add mysqldchkconfig --level 345 mysqld oncp support-files/my-huge.cnf /etc/my.cnf # chown -R mysql.mysql /mysql/libxml2-2.6.27.tar.gzjpegsrc.v6b.tar.gz Jpeg libpng-1.2.16.tar.gzfreetype-2.1.10.tar.gzfreetds-0.82.tar.gzgd-2.0.33.tar.gz 40. 41. /usr/local/jpeg6/jpeg-6b/ 42. PHP 43. ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mssql=/usr/local/freetds --with-jpeg-dir=/usr/local/jpeg6 --with-freetype-dir=/usr/local/freetype --with-libxml-dir=/usr/local/libxml --with-png-dir=/usr/local/libpng --with-gd=/usr/local/gd --with-mysql=/mysql --enable-gd-native-ttf --enable-magic-quotes --enable-gd-jis-conv --enable-calendar --with-gettext --with-zlib --with-gdbm --enable-mod-charset --enable-mbstring --with-curl --enable-sockets --disable-ipv6 --enable-pcntl --enable-bcmath --enable-fastcgi 44. make & make install 45. echo > /www/htdocs/php.php Httpd PHP 46. php.inivi /usr/local/php/bin/php.inioutput_buffering = Onzlib.output_compression = Onexpose_php = Offmax_execution_time = 600max_input_time = 600display_errors = Offregister_globals = Onpost_max_size = 64Mmagic_quotes_gpc = offextension_dir = "/usr/local/php/modules/"upload_max_filesize = 32Mdefault_socket_timeout = 600extension=pgsql.soextension=xmlrpc.soextension=mysqli.sosession.auto_start = 1zend_extension=/usr/local/zend/ZendOptimizer.so ; Zend Zend mkdir /usr/local/zend 47. tar -zxf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gzcp 5_2_x_comp/ZendOptimizer.so /usr/local/zend/ PHP Zend /usr/local/zend