linux 搭建LAMP平台手册

1.apache2.2.22

  httpd.2.2.22/srclib/apr apr-util
           ./configure --prefix=/usr/local/apr
           ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
httpd.2.2.22
  "./configure" \
"--prefix=/usr/local/httpd" \
"--enable-track-vars" \
"--enable-cgi" \
"--enable-modules=all" \
"--enable-mods-shared=all" \
"--enable-file-cache" \
"--enable-disk-cache" \
"--enable-cache" \
"--enable-mem-cache" \
"--enable-dumpio" \
"--enable-logio" \
"--enable-mime-magic" \
"--enable-headers" \
"--enable-usertrack" \
"--enable-version" \
"--enable-ssl" \
"--enable-http" \
"--enable-rewrite" \
"--enable-proxy" \
"--enable-proxy-connect" \
"--enable-proxy-http" \
"--enable-proxy-ftp" \
"--enable-proxy-ajp" \
"--enable-proxy-balancer" \
"--enable-so" \
"--with-apr=/usr/local/apr" \
--with-apr=/usr/local/apr-util
      make && make install
2.Mysql(mysql-5.5.23)
     cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
         -DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock
                -DSYSCONFDIR=/etc
         -DDEFAULT_CHARSET=utf8
                -DDEFAULT_COLLATION=utf8_general_ci
                -DWITH_EXTRA_CHARSETS=all
                -DWITH_MYISAM_STORAGE_ENGINE=1
                -DWITH_INNOBASE_STORAGE_ENGINE=1
                -DWITH_MEMORY_STORAGE_ENGINE=1
                -DWITH_READLINE=1
                -DENABLED_LOCAL_INFILE=1 #若提示找不到scurses库则安装libcurses5-dev curses5-devel后
          -DCURSES_LIBRARY=/usr/lib/libncurses.so -DCURSES_INCLUDE_PATH=/usr/include
#若提示找不到相应的库文件,且己安装过,请删除CMakeCache.txt后再试
            gmake && make install
  mysql-5.5.23/support-files
            cp my-huge.cnf /etc/my.cnf
      /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
  cp /usr/local/mysql/support-files/mysql.server/etc/rc.d/init.d/mysqld
 chkconfig --add mysqld
 service mysqld start
   修改默认引擎:default-storage-engine=MyISAM
3.curl-7.25.0
     ./configure --prefix=/usr/local/curl make&&make install
4.jpeg-82
     ./configure --prefix=/usr/local/jpeg8 --enable-shared --enable-static / make && make install
5.libpng-1.2.49
./configure --prefix=/usr/local/libpng
6.freetype-2.4.9
./configure --prefix=/usr/local/freetype
7.zlib-1.2.6
./configure --prefix=/usr/local/zlib
8.gd-2.0.35
./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg8 --with-png=/usr/local/libpng --with-zlib=/usr/local/zlib --with- freetype=/usr/local/freetype
9.libxml2-2.7.8
./configure --prefix=/usr/local/libxml
10.libmcrypt-2.5.7
 ./configure --prfeix=/usr/local/libmcrypt
11.php-5.4.0
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-curl=/usr/local/curl --with- libxml-dir=/usr/local/libxml --enable-ftp --with-config-file-path=/usr/local/php5/etc --with-freetype-dir=/usr/local/freetype --with-jpeg- dir=/usr/local/jpeg8 --with-png-dir=/usr/local/libpng --with-zlib=/usr/local/zlib --with-libxml-dir=/usr/local/libxml --enable-xml --enable- bcmath --enable-shmop --eable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-zip --with- mcrypt=/usr/local/libmcrypt --with-gd --enable-soap
       make && make install
  cp php.ini-production /usr/local/php5/etc/php.ini
  httpd.conf
         index.php
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
           ServerName
    ServerName 122.49.32.114
12.libevent-2.0.14-stable
./configure --prefix=/usr/local/libevent && make && make install
13.memcached-1.4.4
./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent / make && make install
14.memcache-2.2.5
/usr/local/php5/bin/phpize
/configure --enable-memcache --with-php-config=/usr/local/php5/bin/php-config / make && make install
/usr/local/php5/etc/php.inií °×°êóú·
 extension_dir="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525"
  extension=memcache.so
    ==============================================================================================================================================
lnmp
==========================================================================
php5
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng --with-gd --with-zlib-dir=/usr/local/zlib --with-freetype-dir=/usr/local/freetype --with-libxml-dir=/usr/local/libxml --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql -enable-gd-native-ttf --with-curl=/usr/local/curl --with-pear --with-iconv --enable-mbstring=all --enable-soap --enable-sockets --enable-ftp --enable-fpm
  make && make install
 1. cp php.ini-dist /usr/local/php/etc/php.ini
 2.PHP-FPM
   /usr/local/php5/sbin/php-fpm start
 3. nginx配置取注释
      #location ~ \.php$ {
       # root html;
       # fastcgi_pass 127.0.0.1:9000;
       # fastcgi_index index.php;
       # fastcgi_param SCRIPT_FILENAME //$fastcgi_script_name;
       # include fastcgi_params;
       #}
============================
如果mysql不是编译安装的,php是编译安装的应该在配置时输入
./configure --prefix=/usr/local/php5.3 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-curl --with-libxml-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --enable-zip --with-gd --with-mcrypt