? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 如何在CentOS 7上安裝源碼Apache包并啟用該服務(wù)
企業(yè)建站必須是能夠以充分展現(xiàn)企業(yè)形象為主要目的,是企業(yè)文化與產(chǎn)品對外擴(kuò)展宣傳的重要窗口,一個合格的網(wǎng)站不僅僅能為公司帶來巨大的互聯(lián)網(wǎng)上的收集和信息發(fā)布平臺,成都創(chuàng)新互聯(lián)公司面向各種領(lǐng)域:成都封陽臺等網(wǎng)站設(shè)計、成都全網(wǎng)營銷推廣解決方案、網(wǎng)站設(shè)計等建站排名服務(wù)。
? ? ? ?第1步:先從Apache官網(wǎng)下載最新的Apache包,然后通過WinSCP上傳到遠(yuǎn)程的Centos 7上
并掛載VMware的 iso?CentOS 7鏡像后部署好本地的yum源-----
使VMware 12中的DVD自動掛載,添加如下語句到/etc/fstab
[root@Franklin13 ~]# cat /etc/fstab|grep cdrom
/dev/cdrom /media/cdrom auto defaults 0 0
--------編譯安裝過程如下 -------------
? ? ?第2步:?查看源碼包里的INSTALL或readme文件并用yum命令查看Development Tools組合包是否已安裝
(因./configure編譯時要調(diào)用?Development Tools安裝后的某個軟件,比如GCC )
[root@Franklin13 httpd-2.4.41]# ls -l|grep IN*
-rw-r--r--.? 1 root dip? ? 3782 May 18? 2016 INSTALL
有時,yum groupinstall "Development tools"會出現(xiàn)如下報錯,且用yum clean all; yum makecache后仍舊出現(xiàn)這種報錯
經(jīng)Google后發(fā)現(xiàn)需要用如下方式安裝才能進(jìn)行:
yum groupinstall "Development Tools" --setopt=group_package_types=mandatory,default,optional
這種情況的原因很多,見如下網(wǎng)址
?https://access.redhat.com/solutions/1310043
第3步:進(jìn)入解壓后的httpd目錄中,運(yùn)行編譯的3部曲 ./configure --prefix=...&make&make install:
但有時會出現(xiàn)報錯,比如我遇到的 “?checking for APR... no ”
[root@Franklin13 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2.4.41 --sysconfdir=/etc/httpd2
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure:?
configure: Configuring Apache Portable Runtime library...
configure:?
checking for APR... no
經(jīng)百度后發(fā)現(xiàn)是如下原因:?
參考文章----?https://www.cnblogs.com/yewandemty/p/5396338.html
? ? ? 先將這些模塊(apr和apr-util?安裝,再進(jìn)行httpd的安裝 )
Apr的下載網(wǎng)址:?http://archive.apache.org/dist/
Apr-util的下載:?http://archive.apache.org/dist/apr/
(注意:要先安裝 apr,再安裝?apr-uti,且安裝apr-uti時要添加??--with-apr=后面跟之前編譯apr的安裝路徑 )
下圖為如何右擊來下載?apr-util模塊
然后再編譯安裝 httpd時必須添加如下兩個 with參數(shù),也是醉了:
[root@Franklin13 httpd-2.4.41]#./configure --prefix=/usr/local/apache2.4.41 --sysconfdir=/etc/httpd2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
[root@Franklin13 httpd-2.4.41]#
但出現(xiàn)了如下新的報錯 “?pcre-config for libpcre not found"
故不得不下載 pcre模塊,然后編譯安裝
之后,httpd源碼包才能安裝成功
[root@Franklin13 httpd-2.4.41]# history 5
502 ?./configure --prefix=/usr/local/apache2.4.41 --sysconfdir=/etc/httpd2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
503 ?make
504 ?history 5
505 ?make install
506 ?history 5
安裝成功后到安裝路徑目錄下 /bin下運(yùn)行 apachectl start即可
[root@Franklin13 bin]# pwd
/usr/local/apache2.4.41/bin
[root@Franklin13 bin]# apachectl start
[root@Franklin13 bin]#?
[root@Franklin13 bin]# netstat -tan|grep 80
tcp6? ? ? ?0? ? ? 0 :::80? ? ? ? ? ? ? ? ? ?:::*? ? ? ? ? ? ? ? ? ? LISTEN? ? ?
[root@Franklin13 bin]#?
[root@Franklin13 bin]#?
[root@Franklin13 bin]# ps -ef|grep httpd
root? ? ? 59193? ? ? 1? 0 16:27 ?? ? ? ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache? ? 59199? 59193? 0 16:27 ?? ? ? ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache? ? 59201? 59193? 0 16:27 ?? ? ? ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache? ? 59203? 59193? 0 16:27 ?? ? ? ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache? ? 59204? 59193? 0 16:27 ?? ? ? ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache? ? 59205? 59193? 0 16:27 ?? ? ? ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
root? ? ? 63802? 19545? 0 17:46 pts/5? ? 00:00:00 grep --color=auto httpd
[root@Franklin13 bin]#?
--------------------? ?全文完 ----------------------------------------------------------
網(wǎng)頁標(biāo)題:CentOS7上安裝源碼Apache包并啟用該服務(wù),含解決
文章出自:http://aaarwkj.com/article2/gojpic.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計、App設(shè)計、建站公司、網(wǎng)站收錄、關(guān)鍵詞優(yōu)化、標(biāo)簽優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)