標籤:des style blog http color io os 使用 ar
1.下載
wget http://apache.fayea.com/apache-mirror//httpd/httpd-2.2.29.tar.gz
tar zxvf httpd-2.2.29.tar.gz
cd httpd-2.2.29
./configure --prefix=/usr/local/httpd (你也可以指定自己的路徑)
make && make install
啟動apache
/usr/local/httpd/bin/apachectl start
註冊為服務
cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S61httpd
這樣就可以使用sevice httpd 來管理了
2.修改指令碼使其支援chkconfig
編輯httpd指令碼,在第2行添加如下注釋資訊:
# chkconfig: 35 61 61
# description: Apache
儲存後執行:chkconfig --add httpd
第一行的3個參數意義分別為:在哪些運行層級啟動httpd(3,5);啟動序號(S61);關閉序號(K61)。注意:以上兩行缺一不可
執行chkconfig --add httpd後就在rc3.d、rc5.d路徑中將來就會出現S61httpd的連結,其他運行層級路徑中會出現K61httpd的連結
2.php安裝
wget http://cn2.php.net/get/php-5.3.29.tar.gz/from/this/mirrortar zxvf phpcd phpyum install gd*./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-apxs2=/usr/local/httpd/bin/apxs --with-gd --enable-mbstring
make && make install
cd /usr/local/php
cp /usr/local/src/php-5.3.29/php.ini-development ./lib/php.ini
apache的設定檔 311行左左右
AddType application/x-httpd-php .php .phtml
加上預設的index.php
centos apache php 安裝