Apache手工编译安装(内附软件包)
生活随笔
收集整理的這篇文章主要介紹了
Apache手工编译安装(内附软件包)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Apache http server 是開源軟件的杰出代表,基于標(biāo)準(zhǔn)的HTTP網(wǎng)絡(luò)協(xié)議提供網(wǎng)頁瀏覽服務(wù),apache服務(wù)器可以運行在Linux UNIX Windows等多種操作系統(tǒng)平臺。
Apache的主要特點
- 開放源代碼
- 跨平臺應(yīng)用
- 支持各種Web編程語言
- 模塊化設(shè)計
- 運行非常穩(wěn)定
- 良好的安全性
環(huán)境部署
- redhat6.5系統(tǒng)
- ip地址:192.168.100.101
- 相關(guān)軟件包:百度云
1.查看系統(tǒng)是否安裝httpd服務(wù),如有卸載。
# rpm -q httpd httpd-2.2.15-29.el6_4.x86_64 # yum remove httpd -y2.創(chuàng)建一個目錄,掛載宿主機上的共享出來的apache軟件包
# mkdir /abc # mount.cifs //192.168.100.3/linux /abc # ls /abc/LAMP apr-1.4.6.tar.gz apr-util-1.4.1.tar.gz httpd-2.4.2.tar.gz3.解壓Apache壓縮包到/opt下
# tar zxvf httpd-2.4.2.tar.gz -C /opt # tar zxvf apr-1.4.6.tar.gz -C /opt # tar zxvf apr-util-1.4.1.tar.gz -C /opt4.將解壓后的包復(fù)制到/opt/httpd-2.4.2/srclib下分別改名為apr和apr-util
# cp -R apr-1.4.6/ httpd-2.4.2/srclib/apr # cp -R apr-util-1.4.1/ httpd-2.4.2/srclib/apr-util5.yum安裝相關(guān)環(huán)境包
# yum install gcc gcc-c++ make perl pcre-devel expat-devel libxml2-devel -y6.配置軟件模塊
cd /opt/httpd-2.4.2./configure \ --prefix=/usr/local/apache \ --enable-so \ --enable-rewrite \ --enable-mods-shared=most \ --with-mpm=worker \ --disable-cgid \ --disable-cgi配置信息
./configure \ --prefix=/usr/local/apache \ 安裝路徑 --enable-so \ 啟動內(nèi)核 --enable-rewrite \ 啟動重寫功能 --enable-mods-shared=most \ 模塊共享 --with-mpm=worker \ 用戶多進程 --disable-cgid \ 通用網(wǎng)關(guān)接口 --disable-cgi7.編譯安裝
# make && make install8.過濾apachectl的# 重定向保存到/etc/init.d/httpd中 (啟動腳本)
# grep -v "#" /usr/local/apache/bin/apachectl > /etc/init.d/httpd# vi /etc/init.d/httpd在開頭插入下面#!/bin/sh# chkconfig:2345 85 15# description:Apache is a World Wide Web server.9.給httpd腳本開啟執(zhí)行權(quán)限、添加服務(wù)
# chmod +x /etc/init.d/httpd //給httpd開啟執(zhí)行權(quán)限 # chkconfig --add httpd //添加httpd服務(wù) # chkconfig --list httpd //查看httpd服務(wù) # chkconfig --level 35 httpd on //把httpd服務(wù)的3 5開啟10.給httpd.conf 創(chuàng)建一個軟連接 方便管理
# ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf # vim /etc/httpd.conf Listen:192.168.100.101:80 //修改監(jiān)聽IP #Listen:80 #ipv6的需要關(guān)閉 ServerName www.benet.com:80 //修改域名11.重啟httpd服務(wù)、關(guān)閉防火墻
# service httpd stop # service httpd star # service iptables stop # setenforce 012.修改首頁內(nèi)容測試
echo "<h1>this is web</h1>" > /usr/local/apache/htdocs/index.html轉(zhuǎn)載于:https://blog.51cto.com/13777111/2165719
新人創(chuàng)作打卡挑戰(zhàn)賽發(fā)博客就能抽獎!定制產(chǎn)品紅包拿不停!總結(jié)
以上是生活随笔為你收集整理的Apache手工编译安装(内附软件包)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 下拉刷新
- 下一篇: linux 终端控制-- 多彩输出 格式