LAMP 2011
LAMP
- #yum -y install ntp vim wget
- #yum -y install gcc make patch gcc-c++ gcc-g77 flex bison autoconf automake \
- libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \
- zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel \
- curl curl-devel libtiff-devel fontconfig-devel libXpm-devel gettext-devel pam-devel pcre-devel \
- libtool libtool-ltdl openssl openssl-devel libtool libtool-libs autoconf kernel-devel \
- libevent libevent-devel apr-devel apr-util
- ####( GD2 LibXML2 LibMcrypt jpeg6 freetype zlib libpng)
- Mysql
- #mkdir /var/lib/mysqldata
- # groupadd mysql
- # useradd -r -g mysql mysql
- #chown -R mysql.mysql /var/lib/mysqldata
- # wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz or yum install cmake cmake-gui
- # tar zxvf cmake-2.8.5.tar.gz
- # cd cmake-2.8.5
- # ./configure
- # make && make install
- # wget http://mysql.stu.edu.tw/Downloads/MySQL-5.5/mysql-5.5.14.tar.gz
- # tar zxvf mysql-5.5.14.tar.gz
- # cd mysql-5.5.14.tar.gz
- #md5sum mysql-5.5.14.tar.gz
- #show options
- #cmake . -LH or cmake .
- # cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
- -DDEFAULT_CHARSET=utf8 \
- -DDEFAULT_COLLATION=utf8_general_ci \
- -DENABLE_DTRACE=1 \
- -DMYSQL_DATADIR=/var/lib/mysqldata \
- -DMYSQL_TCP_PORT=3306 \
- -DMYSQL_UNIX_ADDR=/var/lib/mysqldata/mysql.sock \
- -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
- -DWITH_MYISAM_STORAGE_ENGINE=1 \
- -DWITH_INNOBASE_STORAGE_ENGINE=1 \
- -DWITH_MEMORY_STORAGE_ENGINE=1 \
- -DWITH_READLINE=1 \
- -DENABLED_LOCAL_INFILE=1 \
- -DMYSQL_USER=mysql \
- # make
- # make install
- #cd /usr/local/mysql
- #chown -R mysql.mysql .
- # cp support-files/my-medium.cnf /etc/my.cnf
- # chmod 755 scripts/mysql_install_db
- # scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/var/lib/mysqldata
- # cp support-files/mysql.server /etc/init.d/mysql
- # chmod 755 /etc/init.d/mysqld
- # chkconfig mysql on
- # export PATH=/usr/local/mysql/bin:$PATH
- # alias mysql_start="mysqld_safe &"
- # alias mysql_stop="mysqladmin –u root -p shutdown"
- # /etc/init.d/mysqld start
- # mysql -u root –p
- # /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
- or # /usr/local/mysql/bin/mysqladmin -u root -h ‘hostname’ password 'new-password'
- http://www.cnblogs.com/yd1227/archive/2011/06/08/2074979.html
- http://www.libgd.org/releases/gd-2.0.35.tar.bz2
- tar jxvf gd-2.0.35.tar.bz2
- cd gd-2.0.35
- ./configure --prefix=/usr/local/gd2
- make && make install
- http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.12.tar.gz
- tar zxvf libiconv-1.12.tar.gz
- cd libiconv-1.12/
- ./configure --prefix=/usr/local
- make
- make install
- cd ../
- ln -s /usr/local/lib/libiconv.so.2 /usr/lib/
- http://mirror.optus.net/sourceforge/m/mc/mcrypt/libmcrypt-2.5.8.tar.gz
- tar zxvf libmcrypt-2.5.8.tar.gz
- cd libmcrypt-2.5.8/
- ./configure
- make
- make install
- /sbin/ldconfig
- cd libltdl/
- ./configure --enable-ltdl-install
- make
- make install
- cd ../../
- cp /usr/local/lib/libmcrypt.* /usr/lib
- http://mirror.optus.net/sourceforge/m/mh/mhash/mhash-0.9.9.tar.gz
- tar zxvf mhash-0.9.9.tar.gz
- cd mhash-0.9.9/
- ./configure
- make
- make install
- cd ../
- ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
- http://jaist.dl.sourceforge.net/sourceforge/mcrypt/mcrypt-2.6.7.tar.gz
- tar zxvf mcrypt-2.6.7.tar.gz
- cd mcrypt-2.6.7/
- ./configure
- make
- make install
- cd ../
- http://opensource.nchc.org.tw/COSA/CNS4/cronolog-1.6.2.tar.gz
- tar xvf cronolog-1.6.2.tar.gz
- cd cronolog-1.6.2
- ./configure --prefix=/usr/local/cronolog
- make && make install
- cd ..
- Apache 2
- --prefix=/usr/local/apache2 \
- --with-mpm=worker \
- --enable-so \
- --enable-deflate=shared \
- --enable-expires=shared \
- --enable-rewrite=shared \
- --enable-ssl=shared
- --enable-disk-cache
- --enable-file-cache
- --enable-mem-cache
- --enable-headers
- --enable-vhost_alias
- --enable-static-support \
- --enable-static-htpasswd \
- --enable-static-htdigest \
- --enable-static-rotatelogs \
- --enable-static-logresolve \
- --enable-static-htdbm \
- --enable-static-ab \
- --enable-static-checkgid \
- PHP
- # ./configure \
- --prefix=/usr/local/php \
- --with-apxs2=/usr/local/apache2/bin/apxs \
- --with-config-file-path=/usr/local/php/etc" \
- --with-mysql=/usr/local/mysql \
- --with-libxml-dir=/usr/ \
- --with-gd=/usr/local/gd2 \
- --with-jpeg-dir \
- --with-png-dir \
- --with-bz2 \
- --with-freetype-dir \
- --with-iconv-dir=/usr/local \
- --with-zlib-dir \
- --with-openssl=/usr/local/openssl \ ####
- --with-mcrypt=/usr/local/libmcrypt \
- --enable-soap \
- --enable-gd-native-ttf \
- --enable-ftp \
- --enable-mbstring \
- --enable-exif \
- --disable-ipv6 \
- --disable-cgi \
- --disable-cli
- mkdir -p /usr/local/php/etc
- cp php.ini-dist /usr/local/php/etc/php.ini
- cd ../
- # php extensions
- sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/php/etc/php.ini
- sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /usr/local/php/etc/php.ini
- sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /usr/local/php/etc/php.ini
- sed -i 's/;date.timezone =/date.timezone = PRC/g' /usr/local/php/etc/php.ini
- groupadd www
- useradd -g www www
- mkdir -p /var/www/html
- chmod +w /var/www/html
- chown -R www:www /var/www/html
- apache php
- # vi /usr/local/apache2/conf/httpd.conf
- LoadModule php5_module modules/libphp5.so
- AddType application/x-gzip .gz .tgz
- AddType application/x-httpd-php .php
- DirectoryIndex index.html index.htm index.php
- Include conf/extra/httpd-mpm.conf
- Include conf/extra/httpd-info.conf
- Include conf/extra/httpd-vhosts.conf
- Include conf/extra/httpd-default.conf
- mv /usr/local/apache2/conf/extra/httpd-vhosts.conf /usr/local/apache2/conf/extra/httpd-vhosts.conf.save
- mv /usr/local/apache2/conf/extra/httpd-default.conf /usr/local/apache2/conf/extra/httpd-default.conf.save
- mv /usr/local/apache2/conf/extra/httpd-mpm.conf /usr/local/apache2/conf/extra/httpd-mpm.conf.save
- vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
- NameVirtualHost *:80
- <VirtualHost *:80>
- ServerAdmin shake.chen@gmail.com
- DocumentRoot "/data/www/wwwroot/test.com"
- ServerName test.com
- ServerAlias bbs.test.com
- ErrorLog "logs/test.com-error_log"
- CustomLog "|/usr/local/cronolog/sbin/cronolog /data/logs/access_www.test.com.%Y%m%d" combined
- </VirtualHost>
- <VirtualHost *:80>
- ServerAdmin shake.chen@gmail.com
- DocumentRoot "/data/www/wwwroot/linux.com"
- ServerName linux.com
- ServerAlias bbs.linux.com
- ErrorLog "logs/linux.com-error_log"
- CustomLog "|/usr/local/cronolog/sbin/cronolog /data/logs/access_www.linux.com.%Y%m%d" combined
- </VirtualHost>
- vi /usr/local/apache2/conf/extra/httpd-default.conf
- Timeout 15
- KeepAlive Off
- MaxKeepAliveRequests 50
- KeepAliveTimeout 5
- UseCanonicalName Off
- AccessFileName .htaccess
- ServerTokens Prod
- ServerSignature Off
- HostnameLookups Off
- vi /usr/local/apache2/conf/extra/httpd-mpm.conf
- <IfModule mpm_prefork_module>
- ServerLimit 2000
- StartServers 10
- MinSpareServers 10
- MaxSpareServers 15
- MaxClients 2000
- MaxRequestsPerChild 10000
- </IfModule>
- echo "/usr/local/apache-2.2.15/bin/apachectl start" >> /etc/rc.local
- http://www.iuscommunity.org/Repos
- http://os.51cto.com/art/201103/248258.htm
- http://os.51cto.com/art/201103/250276.htm
- http://os.51cto.com/art/201103/247916.htm
- http://whxhz.iteye.com/blog/1084586
- http://bbs.chinaunix.net/viewthread.php?tid=1268156
- http://tuxlite.com/
- http://myhat.blog.51cto.com/391263/599316
- http://liujiesmart.iteye.com/blog/636151
- http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-centos-5.6-lamp