# tar -xf apr-1.5.0.tar.bz2 # cd apr-1.5.0 #./configure --prefix=/usr/local/apr //指定其安装位置 # make && make install
# tar -xf apr-util-1.5.3.tar.bz2 # cd apr-util-1.5.3 # ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr # make && make install
# tar -xf pcre-8.35.tar.gz # cd pcre-8.35 # ./configure --prefix=/usr/local/pcre # make && make install
# tar -xf httpd2.4.9.tar.gz # cd <span style="font-family: Arial, Helvetica, sans-serif;">httpd2.4.9</span> # ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most # make && make install编译过程中如果缺少其他依赖,可单独安装即可,安装过程如上面apr安装。
/usr/local/apache/bin/apachectl start浏览器输入http://IP/即可看到 It Works!
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
cd /usr/local/mysql chown -R mysql . chgrp -R mysql . scripts/mysql_install_db --user=mysql chown -R root .
</pre><h3>编译安装PHP</h3></div><pre name="code" class="html"># tar -xf php-5.5.12.tar.gz # cd <span style="font-family: Arial, Helvetica, sans-serif;">php-5.5.12</span> # ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-apxs2=/usr/local/apache/bin/apxs --enable-fastcgi --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --disable-debug --disable-ipv6 --with-iconv-dir --with-freetype-dir --with-jpeg-dir=/usr/local/jpeg --with-zlib --with-libxml-dir=/usr/local/libxml2 --enable-xml=/usr/local/libxml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local/curl --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap # make && make install编译过程中如果缺少其他依赖,可单独安装即可,安装过程如上面apr安装。
AddType
application
/x-httpd-php
.php
AddType
application
/x-httpd-php-source
.phps
# tar xf xcache-3.0.3.tar.gz # cd xcache-3.0.3 # /usr/local/php5/bin/phpize //phpize是用来安装php扩展模块的,通过phpize可以建立php的外挂模块,若你想在原来编译好的php中加入memcached或者ImageMagick等扩展模块,就需要使用phpize # ./configure --enable=xcache --with-php-config=/usr/local/php5/bin/php-config [root@Spg-RedHat xcache-3.1.0]#make && make install Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-zts-20121212/
[xcache-common] extension = <span style="white-space: nowrap; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;">/usr/local/php5/lib/php/extensions/no-debug-zts-20121212</span><span style="white-space: nowrap; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;">/xcache.so</span> [xcache.admin] xcache.admin.enable_auth = On xcache.admin.user = "admin" xcache.admin.pass = "6a0194f9707fa832ece6f5b66a25567e" #echo -n "youp-assword" |md5sum |awk '{print $1}' [xcache] xcache.shm_scheme = "mmap" xcache.size = 128M xcache.count = 1 xcache.slots = 8K xcache.ttl = 0 xcache.gc_interval = 0 xcache.var_size = 0M xcache.var_count = 1 xcache.var_slots = 8K xcache.var_ttl = 0 xcache.var_maxttl = 0 xcache.var_gc_interval = 300 xcache.test = Off xcache.readonly_protection = Off xcache.mmap_path = "/dev/zero" xcache.coredump_directory = "" xcache.cacher = On xcache.stat = On xcache.optimizer = Off [xcache.coverager] xcache.coverager = Off xcache.coveragedump_directory = ""注意:其中的extension值“/usr/local/php5/lib/php/extensions/no-debug-zts-20121212/”为前面make install的结果。
原文地址:http://blog.csdn.net/fengspg/article/details/35223385