您好,登錄后才能下訂單哦!
一、創建LAMP環境 Apache+MySQL+PHP for CentOS
(一)、Apache安裝(使用yum安裝或者官網下載軟件包安裝)
1、到Apache官網下載httpd軟件包。網址:http://httpd.apache.org/解壓到本地的httpd包
[root@info lamp]# tar -zxvf httpd-2.0.64.tar.gz (注意名稱以你下載的軟件包型號為準)
[root@info lamp]# cd httpd-2.0.64 (切換入目錄)
完成解壓后,對httpd進行編譯安裝,--enable-module=so:加載modul動態模塊。
\\
編譯安裝出現如下問題及解決方法
#./configure --prefix……檢查編輯環境時出現:
checking for APR... no
configure: error: APR not found . Please read the documentation
解決辦法:
1.下載所需軟件包:
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
2.編譯安裝:
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
具體步驟如下:
a:解決apr not found問題>>>>>>
[root@xt test]# tar -zxf apr-1.4.5.tar.gz
[root@xt test]# cd apr-1.4.5
[root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr
[root@xt apr-1.4.5]# make && make install
[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz
[root@xt test]# cd apr-util-1.3.12
[root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
[root@xt apr-util-1.3.12]# make && make install
c:解決pcre問題>>>>>>>>>
[root@xt test]#unzip -o pcre-8.10.zip
[root@xt test]#cd pcre-8.10
[root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre
[root@xt pcre-8.10]#make && make install
4.最后編譯Apache時加上:
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util/ \
--with-pcre=/usr/local/pcre
成功編譯完成~
\\
[root@info httpd-2.0.64]#make
[root@info httpd-2.0.64]#make install
[root@info httpd-2.0.64]/usr/local/apache/bin/apchectl –t (檢查語法)
[root@info httpd-2.0.64]/usr/local/apache/bin/apchectl start (啟動)
\\
服務啟動過程遇到端口占用的情況及解決方法
# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
1.netstat -lnp|grep 80
tcp 0 0 192.168.180.68:61027 0.0.0.0:* LISTEN 6289/oproxyd
tcp 0 0 :::80 :::* LISTEN 846/httpd
tcp 0 0 ::ffff:192.168.180.68:7001 :::* LISTEN 32015/java
找到pid 846
#ps 846
查看
#kill -9 846
殺掉
#./apachectl start
\\
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。