日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
CentOS7.3環(huán)境下源碼安裝httpd2.4

本文在centos7.3下,源碼安裝apache服務(wù)httpd2.4。

成都創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括神池網(wǎng)站建設(shè)、神池網(wǎng)站制作、神池網(wǎng)頁(yè)制作以及神池網(wǎng)絡(luò)營(yíng)銷策劃等。多年來(lái),我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,神池網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到神池省份的部分城市,未來(lái)相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!

1.下載好源碼安裝包

  [root@localhost ~]#ll   total 6252   -rw-r--r--. 1 root root 6398218 Apr 7 22:25 httpd-2.4.25.tar.bz2

2.解壓安裝包

  [root@localhost ~]#tar xvf httpd-2.4.25.tar.bz2

3.安裝編譯相關(guān)的工具

  yum -y groupinstall "Development and Creative Workstation"

這是在安裝一個(gè)應(yīng)用包組,即一組應(yīng)用包,編譯源碼相關(guān)的工具命令包含在這個(gè)包組中。實(shí)際生產(chǎn)中,可根據(jù)具體情況最小化安裝應(yīng)用包。

另外還需要安裝如下包

  yum install -y apr-devel   yum install -y apr-util-devel   yum install -y pcre-devel

4.配置編譯參數(shù)

  [root@localhost httpd-2.4.25]#pwd   /root/httpd-2.4.25   [root@localhost httpd-2.4.25]#./configure --prefix=/app/http24 --sysconfdir=/etc/httpd24

--prefix參數(shù)是設(shè)置安裝目錄,--sysconfdir參數(shù)是設(shè)置配置文件路徑

  • 如果出現(xiàn)ERROR的字樣,可能的原因是執(zhí)行configure命令所需的包沒(méi)安裝,可見參照第三步,安裝相關(guān)的工具

  • 實(shí)際生產(chǎn)可能根據(jù)具體配置詳細(xì)參數(shù),這里只是為了示范安裝,只設(shè)置了兩個(gè)必要的參數(shù)

配置成功之后,出現(xiàn)以下字樣:

  configure: summary of build options:   Server Version: 2.4.25    Install prefix: /app/http24    C compiler: gcc -std=gnu99     CFLAGS: -pthread    LDFLAGS:    LIBS:    CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE   C preprocessor: gcc -E

5.編譯

  make

根據(jù)參數(shù)編譯源碼,生成特點(diǎn)文件,比如二進(jìn)制文件httpd。這個(gè)過(guò)程花費(fèi)的時(shí)間可能比較長(zhǎng)。

成功之后,目錄如下:

  make[2]: Entering directory `/root/httpd-2.4.25/support'   make[2]: Leaving directory `/root/httpd-2.4.25/support'   make[1]: Leaving directory `/root/httpd-2.4.25'   [root@localhost httpd-2.4.25]#ls   ABOUT_APACHE BuildBin.dsp config.status httpd.mak libhttpd.mak modules.o server   acinclude.m4 buildconf configure httpd.spec LICENSE NOTICE srclib   Apache-apr2.dsw buildmark.o configure.in include Makefile NWGNUmakefile support   Apache.dsw CHANGES docs INSTALL Makefile.in os test   apache_probes.d CMakeLists.txt emacs-style InstallBin.dsp Makefile.win README VERSIONING   ap.d config.layout httpd LAYOUT modules README.cmake   build config.log httpd.dep libhttpd.dep modules.c README.platforms   BuildAll.dsp config.nice httpd.dsp libhttpd.dsp modules.lo ROADMAP

6.安裝

make install

這一步實(shí)則是將編譯之后生成的文件移動(dòng)到指定的目錄

7.將/app/http24/bin目錄配置到環(huán)境變量

  • 在/etc/profile.d/目錄下新建httpd.sh
[root@localhost profile.d]#pwd /etc/profile.d [root@localhost profile.d]#vim httpd.sh
  • 在httpd.sh中添加httpd應(yīng)用的/bin目錄的全路徑
PATH=$PATH:/app/httpd24/bin
  • 讓httpd.sh文件生效
source httpd.sh

啟用httpd服務(wù)

apachectl start

檢查啟用是否成功

[root@vathe ~]#netstat -tan | grep 80 tcp6 0 0 :::80 :::* LISTEN

訪問(wèn)

  • 查看主機(jī)ip
[root@vathe ~]#ip a 2: ens33:  mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:dc:18:55 brd ff:ff:ff:ff:ff:ff inet 172.16.251.215/16 brd 172.16.255.255 scope global dynamic ens33 valid_lft 86034sec preferred_lft 86034sec inet6 fe80::83d2:113b:e29b:1a03/64 scope link valid_lft forever preferred_lft forever

主機(jī)ip為172.16.251.215

  • 使用瀏覽器直接訪問(wèn)172.16.251.215
  • 訪問(wèn)不成功,可能的原因:1.selinux沒(méi)關(guān)閉;2.防火墻沒(méi)關(guān)閉

新聞標(biāo)題:CentOS7.3環(huán)境下源碼安裝httpd2.4
文章網(wǎng)址:http://www.5511xx.com/article/dhosspd.html