实验
本周小編我學會了如何在Centos 7上安裝apache2.4源碼包,并啟動此服務。該實驗在Centos 7和Centos 6的安裝上有細微的差別,現在聽小編我一一道來。
1、首先準備工作:查看是否有相同的軟件包
2、 安裝開發包組
yum grouplist (列出所有包組)
yum groupinstall "Development tools" (安裝一部分包組)
2 下載源碼并解包
http://httpd.apache.org/(下載地址)使用rz上傳
解壓打包,壓縮的文件到/app/
3、配置configure環境
配置環境之前要列出可用倉庫。
進入cd ?/app/httpd-2.4.27/,開始配置環境。
--prefix=/app/httpd24(最好指定個目錄,默認是/usr/local/src) --sysconfdir=/etc/httpd24(編譯文件指定到此目錄下,獨立出來) --enable-ssl(啟用某些命令:啟用加密文件)
執行完此命令后,會提示缺少東西,這時就缺什么就裝什么。
如:yum search apr -->yum install -y apr-devel 安裝apr。
4、查看說明,根據模板安裝
5、生成Makefile(步驟:make 項目管理器 configure腳本 --> Makefile.in --> Makefile)
make(編譯)
make install(只有root能做,建立apache22 [cd /app/apache22-->ls 查看是否有apache22])
6、準備環境變量(在app下進行),該圖表示環境變量生成。
7、編寫網頁內容
8、要想顯示網頁內容,需要開啟服務
在Centos7中關閉服務:/app/apache24/apachectl stop
在Centos6中關閉服務:/app/apache22/bin/service iptables stop或chkconfig iptables off (開機禁用)
9、man幫助(更新man_db,才會有man幫助)
10、關閉服務操作:1、apachectl stop (停止服務)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2、rm -rf httpd24
3、rm /etc/httpd24/ -rf
4、vim /etc/profile.d
5、rm -f /etc/profile.d/httpd24.sh
6、vim /etc/man.config 刪除加入的那行
7、刪除源碼:rm -rf /app
本文轉自 優果馥思 51CTO博客,原文鏈接:http://blog.51cto.com/youguofusi/1965689
總結
- 上一篇: (转载)把syslog接收的远程日志从/
- 下一篇: Leetcode 141. Linked