指令碼安裝apache+php

餘二五發表於2017-11-15
#!/bin/bash
#注意,安裝前先安裝mysql,mysql安裝在/usr/local/mysql目錄。
tar -jxvf httpd-2.2.11.tar.bz2

mkdir   /usr/local/apache2

cd httpd-2.2.11

./configure –prefix=/usr/local/apache2/ –enable-so

make && make install

echo “/usr/local/apache2/bin/apachectl start” >>  /etc/rc.d/rc.local

/usr/local/apache2/bin/apxs -c -i -a /root/httpd-2.2.11/modules/mappers/mod_rewrite.c
cd

tar -jxvf       php-5.2.10.tar.bz2

cd      php-5.2.10

./configure  –prefix=/usr/local/php/ –with-apxs2=/usr/local/apache2/bin/apxs  –with-mysql=/usr/local/mysql/  –with-libxml-dir —

with-iconv  –with-gd –with-freetype-dir  –with-jpeg-dir –with-png-dir –with-zlib –enable-mbstring –enable-sockets

make && make install

cp php.ini-dist /usr/local/php/etc/php.ini

echo “AddType application/x-httpd-php .php” >> /usr/local/apache2/conf/httpd.conf

/usr/local/apache2/bin/apachectl start
本文轉自 fenghao.cn 51CTO部落格,原文連結:http://blog.51cto.com/linuxguest/309094,如需轉載請自行聯絡原作者


相關文章