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
- Centos6.4編譯安裝mysql 8.0.0 詳細教程CentOS編譯MySql
- Centos7編譯安裝Apache教程。CentOS編譯Apache
- apache編譯安裝Apache編譯
- CentOS 下編譯安裝 PHP7.2(apache 版)CentOS編譯PHPApache
- Centos7下原始碼編譯安裝apacheCentOS原始碼編譯Apache
- Centos8 stream系統編譯安裝Apache教程。CentOS編譯Apache
- centos PHP 編譯安裝CentOSPHP編譯
- CentOS 下編譯安裝 NginxCentOS編譯Nginx
- Centos8編譯安裝核心CentOS編譯
- Centos7編譯安裝OpenRestyCentOS編譯REST
- Centos 編譯安裝 PHP7.4.7CentOS編譯PHP
- 如何進行Apache的編譯安裝Apache編譯
- 如何在CentOS7安裝Node?(編譯安裝)CentOS編譯
- CentOS6.8安裝配置sonarqube6.4CentOS
- Centos7編譯安裝Memcached教程。CentOS編譯
- Centos7編譯安裝Docker教程。CentOS編譯Docker
- Centos7編譯安裝Tomcat教程。CentOS編譯Tomcat
- CentOS 全新編譯安裝 Python3.8CentOS編譯Python
- CentOS 下編譯安裝 PHP7.2CentOS編譯PHP
- Ubuntu 18.04系統編譯安裝Apache教程。Ubuntu編譯Apache
- Ubuntu 20.04系統編譯安裝Apache教程。Ubuntu編譯Apache
- CDH impala for Apache HADOOP 安裝編譯步驟.ApacheHadoop編譯
- CentOS:spark-project專案的CentOS 6.4安裝配置CentOSSparkProject
- 在 CentOS 6.4(64位) 安裝 docker.ioCentOSDocker
- httpd-2.4 編譯安裝(centos6)httpd編譯CentOS
- centos7 編譯安裝imagemagick7.1CentOS編譯
- centos7編譯安裝python3CentOS編譯Python
- Centos 7.6 下Mysql8.0.16編譯安裝CentOSMySql編譯
- CentOS下編譯安裝Python3教程CentOS編譯Python
- CentOS 7下編譯安裝Python3CentOS編譯Python
- Debian11系統編譯安裝Apache教程。編譯Apache
- Ubuntu 16.04原始碼編譯安裝Apache 2.4.25教程Ubuntu原始碼編譯Apache
- Centos7編譯安裝Pure-Ftpd教程。CentOS編譯FTP
- CentOS 下編譯安裝 PHP7.2(nginx 版)CentOS編譯PHPNginx
- CentOS7編譯和安裝GCC7.5CentOS編譯GC
- Centos7編譯安裝kafka-manager教程CentOS編譯Kafka
- Centos下Ambari2.7.5的編譯和安裝CentOS編譯