<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
下面通過編譯安裝httpd來深入理解原始碼包安裝(httpd-2.4.54)
//原始碼包建議到官方網站下載
[root@lnh ~]# mkdir xbz [root@lnh ~]# cd xbz/ [root@lnh xbz]# dnf -y install gcc gcc-c++ make wget [root@lnh xbz]# wget https://mirrors.aliyun.com/apache/httpd/httpd-2.4.54.tar.gz [root@lnh xbz]# wget https://mirrors.aliyun.com/apache/apr/apr-1.7.0.tar.gz [root@lnh xbz]# wget https://mirrors.aliyun.com/apache/apr/apr-util-1.6.1.tar.gz [root@lnh xbz]# ls apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.54.tar.gz
[root@lnh xbz]# ls apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.54.tar.gz [root@lnh xbz]# tar -xf apr-1.7.0.tar.gz [root@lnh xbz]# ls apr-1.7.0 apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.54.tar.gz //將apr解壓到當前目錄 [root@lnh xbz]# cd apr-1.7.0/ [root@lnh apr-1.7.0]# ls apr-config.in build-outputs.mk helpers misc strings apr.dep CHANGES include mmap support apr.dsp CMakeLists.txt libapr.dep network_io tables apr.dsw config.layout libapr.dsp NOTICE test apr.mak configure libapr.mak NWGNUmakefile threadproc apr.pc.in configure.in libapr.rc passwd time apr.spec docs LICENSE poll tools atomic dso locks random user build emacs-mode Makefile.in README build.conf encoding Makefile.win README.cmake buildconf file_io memory shmem //進入這個原始碼包可以看見裡面被解壓出來的東西 [root@lnh apr-1.7.0]# ./configure --prefix=/usr/local/src/apr ... configure: creating ./config.status config.status: creating Makefile config.status: creating include/apr.h config.status: creating build/apr_rules.mk config.status: creating build/pkg/pkginfo config.status: creating apr-1-config config.status: creating apr.pc config.status: creating test/Makefile config.status: creating test/internal/Makefile config.status: creating include/arch/unix/apr_private.h config.status: executing libtool commands rm: cannot remove 'libtoolT': No such file or directory config.status: executing default commands //生成Makefile 一般常用的有 --prefix=PREFIX 這個選項的意思是定義軟體包安裝到哪裡 建議,原始碼包都是安裝在/opt/目錄下或者/usr/local/src目錄下面 [root@lnh apr-1.7.0]# make ... gcc -E -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I./include -I/root/xbz/apr-1.7.0/include/arch/unix -I./include/arch/unix -I/root/xbz/apr-1.7.0/include/arch/unix -I/root/xbz/apr-1.7.0/include -I/root/xbz/apr-1.7.0/include/private -I/root/xbz/apr-1.7.0/include/private export_vars.c | sed -e 's/^#[^!]*//' | sed -e '/^$/d' >> apr.exp sed 's,^(location=).*$,1installed,' < apr-1-config > apr-config.out sed -e 's,^(apr_build.*=).*$,1/usr/local/src/apr/build-1,' -e 's,^(top_build.*=).*$,1/usr/local/src/apr/build-1,' < build/apr_rules.mk > build/apr_rules.out make[1]: Leaving directory '/root/xbz/apr-1.7.0' //編譯生成Makefile,此處雖然出現了make[1]: Leaving directory '/root/xbz/apr-1.7.0',但是沒關係可以繼續進行下一步安裝 [root@lnh apr-1.7.0]# make install ... /usr/bin/install -c -m 755 /root/xbz/apr-1.7.0/build/mkdir.sh /usr/local/src/apr/build-1 for f in make_exports.awk make_var_export.awk; do /usr/bin/install -c -m 644 /root/xbz/apr-1.7.0/build/${f} /usr/local/src/apr/build-1; done /usr/bin/install -c -m 644 build/apr_rules.out /usr/local/src/apr/build-1/apr_rules.mk /usr/bin/install -c -m 755 apr-config.out /usr/local/src/apr/bin/apr-1-config //進行安裝 [root@lnh apr-1.7.0]# cd /usr/local/src/apr/ [root@lnh apr]# ls bin build-1 include lib //進入apr的路徑進行檢視,預設情況下,系統搜尋庫檔案的路徑只有/lib,/usr/lib,我們需要進行修改在/etc/ld.so.conf.d/中建立以.conf為字尾名的檔案,而後把要增添的路徑直接寫至此檔案中。此時庫檔案增添的搜尋路徑重啟後有效,若要使用增添的路徑立即生效則要使用ldconfig命令 [root@lnh apr]# cd /etc/ld.so.conf.d/ [root@lnh ld.so.conf.d]# echo /usr/local/src/apr/lib/ >apr.conf [root@lnh ld.so.conf.d]# cd - /usr/local/src/apr //切換到前一個工作目錄 [root@lnh apr]# ldconfig //使命令生效 [root@lnh apr]# ln -s /usr/local/src/apr/include/ /usr/include/apr [root@lnh apr]# ll /usr/include/apr/ total 4 drwxr-xr-x. 2 root root 4096 Jul 12 20:18 apr-1 lrwxrwxrwx. 1 root root 27 Jul 12 20:44 include -> /usr/local/src/apr/include/ 將標頭檔案軟連結到/usr/include目錄下
摺疊
[root@lnh xbz]# dnf -y install expat-devel libxml2-devel pcre-devel //需要先安裝這個依賴 [root@lnh xbz]# ls apr-1.7.0 apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.54.tar.gz [root@lnh xbz]# tar -xf apr-util-1.6.1.tar.gz [root@lnh xbz]# ls apr-1.7.0 apr-util-1.6.1 httpd-2.4.54.tar.gz apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz //解壓到當前目錄 [root@lnh xbz]# cd apr-util-1.6.1/ [root@lnh apr-util-1.6.1]# ls aprutil.dep CHANGES include NWGNUmakefile aprutil.dsp CMakeLists.txt ldap README aprutil.dsw config.layout libaprutil.dep README.cmake aprutil.mak configure libaprutil.dsp README.FREETDS apr-util.pc.in configure.in libaprutil.mak redis apr-util.spec crypto libaprutil.rc renames_pending apu-config.in dbd LICENSE strmatch buckets dbm Makefile.in test build docs Makefile.win uri build.conf encoding memcache xlate buildconf export_vars.sh.in misc xml build-outputs.mk hooks NOTICE //進入原始碼包檢視被解壓出來的東西 [root@lnh apr-util-1.6.1]# ./configure --prefix=/usr/local/src/apr-util --with-apr=/usr/local/src/apr ... configure: creating ./config.status config.status: creating Makefile config.status: creating export_vars.sh config.status: creating build/pkg/pkginfo config.status: creating apr-util.pc config.status: creating apu-1-config config.status: creating include/private/apu_select_dbm.h config.status: creating include/apr_ldap.h config.status: creating include/apu.h config.status: creating include/apu_want.h config.status: creating test/Makefile config.status: creating include/private/apu_config.h config.status: executing default commands //生成Makefile檔案,需要伴隨著上一個指定的依賴 [root@lnh apr-util-1.6.1]# make ... gcc -E -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/root/xbz/apr-util-1.6.1/include -I/root/xbz/apr-util-1.6.1/include/private -I/usr/local/src/apr/include/apr-1 exports.c | grep "ap_hack_" | sed -e 's/^.*[)](.*);$/1/' >> aprutil.exp gcc -E -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/root/xbz/apr-util-1.6.1/include -I/root/xbz/apr-util-1.6.1/include/private -I/usr/local/src/apr/include/apr-1 export_vars.c | sed -e 's/^#[^!]*//' | sed -e '/^$/d' >> aprutil.exp sed 's,^(location=).*$,1installed,' < apu-1-config > apu-config.out make[1]: Leaving directory '/root/xbz/apr-util-1.6.1' //編譯生成的Makefile檔案,出現make[1]: Leaving directory '/root/xbz/apr-util-1.6.1'這個沒有關係可以繼續進行下一步安裝 [root@lnh apr-util-1.6.1]# make install ... See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- /usr/bin/install -c -m 644 aprutil.exp /usr/local/src/apr-util/lib /usr/bin/install -c -m 755 apu-config.out /usr/local/src/apr-util/bin/apu-1-config //進行安裝 [root@lnh apr-util-1.6.1]# cd /usr/local/src/apr-util/ [root@lnh apr-util]# ls bin include lib //切換到apr-util安裝目錄進行檢視,預設情況下,系統搜尋庫檔案的路徑只有/lib,/usr/lib,我們需要進行修改在/etc/ld.so.conf.d/中建立以.conf為字尾名的檔案,而後把要增添的路徑直接寫至此檔案中。此時庫檔案增添的搜尋路徑重啟後有效,若要使用增添的路徑立即生效則要使用ldconfig命令 [root@lnh apr-util]# cd /etc/ld.so.conf.d/ [root@lnh ld.so.conf.d]# echo /usr/local/src/apr-util/ >apr-util.conf [root@lnh ld.so.conf.d]# cd - /usr/local/src/apr-util //切換到上一個工作目錄 [root@lnh apr-util]# ln -s /usr/local/src/apr-util/include/ /usr/include/apr -util //將標頭檔案軟連結到/usr/include目錄下
摺疊
[root@lnh xbz]# tar -xf httpd-2.4.54.tar.gz [root@lnh xbz]# ls apr-1.7.0 apr-util-1.6.1 httpd-2.4.54 apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.54.tar.gz //解壓到當前目錄 [root@lnh xbz]# cd httpd-2.4.54/ [root@lnh httpd-2.4.54]# ls ABOUT_APACHE CMakeLists.txt InstallBin.dsp README acinclude.m4 config.layout LAYOUT README.CHANGES Apache-apr2.dsw configure libhttpd.dep README.cmake Apache.dsw configure.in libhttpd.dsp README.platforms apache_probes.d docs libhttpd.mak ROADMAP ap.d emacs-style LICENSE server build httpd.dep Makefile.in srclib BuildAll.dsp httpd.dsp Makefile.win support BuildBin.dsp httpd.mak modules test buildconf httpd.spec NOTICE VERSIONING CHANGES include NWGNUmakefile changes-entries INSTALL os //檢視被解壓出來的東西 [root@lnh httpd-2.4.54]# ./configure --prefix=/usr/local/src/httpd --with-apr=/usr/local/src/apr --with-apr-util=/usr/local/src/apr-util ... config.status: creating build/config_vars.sh config.status: creating include/ap_config_auto.h config.status: executing default commands configure: summary of build options: Server Version: 2.4.54 Install prefix: /usr/local/src/httpd C compiler: gcc CFLAGS: -g -O2 -pthread CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE LDFLAGS: LIBS: C preprocessor: gcc -E //生成Makefile檔案 [root@lnh httpd-2.4.54]# make ... /usr/local/src/apr/build-1/libtool --silent --mode=link gcc -g -O2 -pthread -o mod_rewrite.la -rpath /usr/local/src/httpd/modules -module -avoid-version mod_rewrite.lo make[4]: Leaving directory '/root/xbz/httpd-2.4.54/modules/mappers' make[3]: Leaving directory '/root/xbz/httpd-2.4.54/modules/mappers' make[2]: Leaving directory '/root/xbz/httpd-2.4.54/modules' make[2]: Entering directory '/root/xbz/httpd-2.4.54/support' make[2]: Leaving directory '/root/xbz/httpd-2.4.54/support' make[1]: Leaving directory '/root/xbz/httpd-2.4.54' //編譯生成Makefile檔案,出現的一些沒有讀取到的問題沒有關係,繼續進行下一步 [root@lnh httpd-2.4.54]# make install ... Installing man pages and online manual mkdir /usr/local/src/httpd/man mkdir /usr/local/src/httpd/man/man1 mkdir /usr/local/src/httpd/man/man8 mkdir /usr/local/src/httpd/manual make[1]: Leaving directory '/root/xbz/httpd-2.4.54' //進行安裝 [root@lnh httpd-2.4.54]# cd /usr/local/src/httpd/ [root@lnh httpd]# ls bin cgi-bin error icons logs manual build conf htdocs include man modules //切換到httpd的安裝目錄進行檢視,預設情況下,系統搜尋庫檔案的路徑只有/lib,/usr/lib [root@lnh httpd]# ln -s /usr/local/src/httpd/include/ /usr/include/httpd [root@lnh httpd]# ll /usr/include/httpd lrwxrwxrwx. 1 root root 29 Jul 12 21:23 /usr/include/httpd -> /usr/local/src/httpd/include/ //將標頭檔案軟連結到/usr/include目錄下 [root@lnh httpd]# echo "export PATH=$PATH:/usr/local/src/httpd/bin" > /etc/profile.d/httpd.sh [root@lnh httpd]# source /etc/profile.d/httpd.sh //設定httpd的全域性環境變數,並生成效果 [root@lnh httpd]# which httpd /usr/local/src/httpd/bin/httpd [root@lnh httpd]# vim /etc/man_db.conf MANDATORY_MANPATH /usr/man MANDATORY_MANPATH /usr/share/man MANDATORY_MANPATH /usr/local/share/man MANDATORY_MANPATH /usr/local/src/httpd/man //新增後面這一行 [root@lnh ~]# httpd AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:fe57:f6f5%ens33. Set the 'ServerName' directive globally to suppress this message httpd (pid 35719) already running //啟動服務 [root@lnh ~]# ss -antl State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 128 *:80 *:* LISTEN 0 128 [::]:22 [::]:* //檢視埠 [root@lnh ~]# systemctl stop firewalld.service //關閉防火牆
摺疊
服務80埠
checking for APR... no configure: error: APR not found. Please read the documentation. //解決方案 [root@lnh xbz]# wget https://mirrors.aliyun.com/apache/apr/apr-1.7.0.tar.gz [root@lnh xbz]# wget https://mirrors.aliyun.com/apache/apr/apr-util-1.6.1.tar.gz 提前把這兩個依賴包安裝好才可以進行生成Makefile檔案 無法進行生成兩個依賴包的Makefile檔案 //解決方案 [root@lnh xbz]# dnf -y install gcc gcc-c++ make wget 提前下載編譯工具
SysV⻛格特點:
Upstart風格特點:
Systemd風格特點:
到此這篇關於apache編譯安裝httpd-2.4.54以及三種風格的init程式特點和區別的文章就介紹到這了,更多相關apache編譯安裝httpd-2.4.54內容請搜尋it145.com以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援it145.com!
相關文章
<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
综合看Anker超能充系列的性价比很高,并且与不仅和iPhone12/苹果<em>Mac</em>Book很配,而且适合多设备充电需求的日常使用或差旅场景,不管是安卓还是Switch同样也能用得上它,希望这次分享能给准备购入充电器的小伙伴们有所
2021-06-01 09:31:42
除了L4WUDU与吴亦凡已经多次共事,成为了明面上的厂牌成员,吴亦凡还曾带领20XXCLUB全队参加2020年的一场音乐节,这也是20XXCLUB首次全员合照,王嗣尧Turbo、陈彦希Regi、<em>Mac</em> Ova Seas、林渝植等人全部出场。然而让
2021-06-01 09:31:34
目前应用IPFS的机构:1 谷歌<em>浏览器</em>支持IPFS分布式协议 2 万维网 (历史档案博物馆)数据库 3 火狐<em>浏览器</em>支持 IPFS分布式协议 4 EOS 等数字货币数据存储 5 美国国会图书馆,历史资料永久保存在 IPFS 6 加
2021-06-01 09:31:24
开拓者的车机是兼容苹果和<em>安卓</em>,虽然我不怎么用,但确实兼顾了我家人的很多需求:副驾的门板还配有解锁开关,有的时候老婆开车,下车的时候偶尔会忘记解锁,我在副驾驶可以自己开门:第二排设计很好,不仅配置了一个很大的
2021-06-01 09:30:48
不仅是<em>安卓</em>手机,苹果手机的降价力度也是前所未有了,iPhone12也“跳水价”了,发布价是6799元,如今已经跌至5308元,降价幅度超过1400元,最新定价确认了。iPhone12是苹果首款5G手机,同时也是全球首款5nm芯片的智能机,它
2021-06-01 09:30:45