CentOS 6.4 編譯安裝 apache
Apache [阿帕奇] 是世界使用排名第一的Web伺服器軟體。
它可以執行在幾乎所有廣泛使用的計算機平臺上, 由於其跨平臺和安全性被廣泛使用,是最流行的Web伺服器端軟體之一。
它快速、可靠並且可透過簡單的API擴充,將Perl/Python等直譯器編譯到伺服器中。
1、apache推薦的2種安裝方式
1)yum安裝
yum install httpd
2)原始碼編譯安裝
[root@shell ~]# [root@shell ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.4 (Santiago) [root@shell ~]# [root@shell ~]# yum repolist [root@shell ~]# [root@shell ~]# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:15:0e:12 brd ff:ff:ff:ff:ff:ff inet 192.168.64.133/24 brd 192.168.64.255 scope global eth0 inet6 fe80::20c:29ff:fe15:e12/64 scope link valid_lft forever preferred_lft forever [root@shell ~]# [root@shell ~]# yum grouplist "Development Tools" [root@shell ~]# yum groupinstall "Development Tools" #安裝開發工具包 [root@shell ~]# rpm -qa httpd [root@shell ~]# [root@shell ~]# wget 下載apache包 [root@shell ~]# tar zxf httpd-2.4.46.tar.gz -C /usr/local/src/ #解壓 [root@shell ~]# cd /usr/local/src/ [root@shell src]# cd httpd-2.4.46 [root@shell httpd-2.4.46]# ./configure --prefix=/usr/local/httpd #編譯 此時發現如下報錯: checking for APR... no configure: error: APR not found . Please read the documentation …… 去網上查詢解決方案得知,是apache在編譯過程中缺少若干依賴導致的報錯 解決方案如下: 需要安裝三個依賴包,即可進行apache的安裝 >[root@shell httpd-2.4.46]# wget [root@shell httpd-2.4.46]# wget [root@shell httpd-2.4.46]# wget ftp://ftp.pcre.org/pub/pcre/pcre-8.10.zip # tar -zxf apr-1.4.5.tar.gz # cd apr-1.4.5 # ./configure --prefix=/usr/local/apr # make && make install # cd .. # tar -zxf apr-util-1.3.12.tar.gz # cd apr-util-1.3.12 # ./configure --prefix=/usr/local/apr-until --with-apr=/usr/local/apr/bin/apr-1-config # make && make install # cd .. # cd apr-util-1.3.12 # unzip -o pcre-8.10.zip # cd pcre-8.10 # ./configure --prefix=/usr/local/pcre # make && make install # cd .. 接下來再次進行編譯apache: [root@shell httpd-2.4.46]# ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-until --with-pcre=/usr/local/pcre # make # make install #安裝 # ln -s /usr/local/httpd/bin/apachectl /etc/init.d/httpd #將啟動命令連結到/etc/init.d中,方便啟動服務 # vi /usr/local/httpd/conf/httpd.conf #按照紅框處指導進行修改 找到下面的程式碼部分,進行修改 # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # #ServerName ServerName 192.168.64.133:80 #修改此處為自己的伺服器地址即可 # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory /> AllowOverride none Require all denied </Directory> # # /etc/init.d/httpd restart #重啟apache # yum install links #安裝瀏覽器 # links 192.168.64.133 #訪問web [root@shell ~]# curl 192.168.64.133 #訪問web <html><body><h1>It works!</h1></body></html> [root@shell ~]#
2、apache 安裝後的驗證
使用谷歌瀏覽器進行訪問:
3、結論
原始碼編譯apache,圓滿成功,奧耶
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69980869/viewspace-2721178/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS 下編譯安裝 apacheCentOS編譯Apache
- CentOS 6.4下編譯安裝MySQL 5.6.14CentOS編譯MySql
- CentOS 6.4 x64 zabbix 2.2.2 編譯安裝CentOS編譯
- Centos7編譯安裝Apache教程。CentOS編譯Apache
- Centos6.4編譯安裝mysql 8.0.0 詳細教程CentOS編譯MySql
- centos手動編譯安裝apache、php、mysqlCentOS編譯ApachePHPMySql
- apache編譯安裝Apache編譯
- MySQL 5.6 for REHL 6.4編譯安裝MySql編譯
- CentOS 下編譯安裝 PHP7.2(apache 版)CentOS編譯PHPApache
- Centos7下原始碼編譯安裝apacheCentOS原始碼編譯Apache
- CentOS 6.4 編譯安裝LLVM3.3,Clang和Libc++CentOS編譯LVMC++
- Centos8 stream系統編譯安裝Apache教程。CentOS編譯Apache
- centos PHP 編譯安裝CentOSPHP編譯
- centos6.4安裝TokudbCentOS
- CentOS6.4安裝PHPCentOSPHP
- CentOS 下編譯安裝 NginxCentOS編譯Nginx
- Centos 下編譯安裝RedisCentOS編譯Redis
- Centos7編譯安裝OpenRestyCentOS編譯REST
- Centos 編譯安裝 PHP7.4.7CentOS編譯PHP
- Centos8編譯安裝核心CentOS編譯
- 如何進行Apache的編譯安裝Apache編譯
- [LAMP]Apache-2.2.31編譯安裝LAMPApache編譯
- MySQL在CentOS 6.4 原始碼安裝MySqlCentOS原始碼
- Linux(CentOs6.4)安裝GitLinuxCentOSGit
- 如何在CentOS7安裝Node?(編譯安裝)CentOS編譯
- CentOS 下編譯安裝 PHP7.2CentOS編譯PHP
- Centos7編譯安裝Memcached教程。CentOS編譯
- Centos7編譯安裝Docker教程。CentOS編譯Docker
- Linux Centos下編譯安裝RedisLinuxCentOS編譯Redis
- centos7下編譯安裝lnmpCentOS編譯LNMP
- CentOS6.8安裝配置sonarqube6.4CentOS
- ElasticSearch(二)CentOs6.4下安裝ElasticSearchElasticsearchCentOS
- CentOS6.4安裝Oracle10.2.0.4CentOSOracle
- CentOS:spark-project專案的CentOS 6.4安裝配置CentOSSparkProject
- CentOS 全新編譯安裝 Python3.8CentOS編譯Python
- httpd-2.4 編譯安裝(centos6)httpd編譯CentOS
- Centos7編譯安裝Tomcat教程。CentOS編譯Tomcat
- CentOS6 編譯安裝 redis-3.2.3CentOS編譯Redis