日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux系统安装Apache 2.4.6

發布時間:2023/12/13 linux 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux系统安装Apache 2.4.6 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

http://www.cnblogs.com/kerrycode/p/3261101.html

Apache簡介

?

??????? Apache HTTP Server(簡稱Apache)是Apache軟件基金會的一個開放源碼的網頁服務器,可以在大多數計算機操作系統中運行,由于其多平臺和安全性被廣泛使用,是最流行的Web服務器端軟件之一。它快速、可靠并且可通過簡單的API擴展,將Perl/Python等解釋器編譯到服務器中。關于更多Apache的介紹,可以參考百科“http://baike.baidu.com/view/28283.htm或官網http://www.apache.org/?或?http://httpd.apache.org/的介紹

?

Apache軟件下載

??Apache的相關軟件包下載地址http://apr.apache.org/projects.html

1.?? Apache HTTP Server

????截止目前為止,Apache HTTP Server 目前最新的版本是 Apache httpd 2.4.6 Released, 下載地址:http://httpd.apache.org/download.cgi#apache24

2.?? APR and APR-Util包

??? 截止目前為止,APR and APR-Util的最新版本如下,下載地址:http://apr.apache.org/download.cgi

  • APR 1.4.8, released June 21, 2013
  • APR-util 1.5.2, released April 4, 2013
  • APR-iconv 1.2.1, released November 26, 2007

3.?? PCRE包

???截止目前為止,PCRE最新的包為8.33,下載地址如下

  • https://sourceforge.net/projects/pcre/files/pcre/

?

? 可以下載了相關安裝包,上傳到/root/kerry這個臨時目錄。也可以直接通過wget下載

Apache安裝要求

下面是官方文檔的要求,必須安裝APR、APR-Util、PCRE,gcc-c++等包,文檔URL地址http://httpd.apache.org/docs/2.4/install.html

?

Requirements

The following requirements exist for building Apache httpd:

APR and APR-Util

Make sure you have APR and APR-Util already installed on your system. If you don't, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from?Apache APR, unpack them into ./srclib/apr and ./srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution must be under ./srclib/apr/) and use ./configure's --with-included-apr option. On some platforms, you may have to install the corresponding -dev packages to allow httpd to build against your installed copy of APR and APR-Util.

Perl-Compatible Regular Expressions Library (PCRE)

This library is required but not longer bundled with httpd. Download the source code from?http://www.pcre.org, or install a Port or Package. If your build system can't find the pcre-config script installed by the PCRE build, point to it using the --with-pcre parameter. On some platforms, you may have to install the corresponding -dev package to allow httpd to build against your installed copy of PCRE.

Disk Space

Make sure you have at least 50 MB of temporary free disk space available. After installation the server occupies approximately 10 MB of disk space. The actual disk space requirements will vary considerably based on your chosen configuration options, any third-party modules, and, of course, the size of the web site or sites that you have on the server.

ANSI-C Compiler and Build System

Make sure you have an ANSI-C compiler installed. The?GNU C compiler (GCC)?from the?Free Software Foundation (FSF)is recommended. If you don't have GCC then at least make sure your vendor's compiler is ANSI compliant. In addition, your PATH must contain basic build tools such as make.

Accurate time keeping

Elements of the HTTP protocol are expressed as the time of day. So, it's time to investigate setting some time synchronization facility on your system. Usually thentpdate or xntpd programs are used for this purpose which are based on the Network Time Protocol (NTP). See the?NTP homepage?for more details about NTP software and public time servers.

Perl 5?[OPTIONAL]

For some of the support scripts like?apxs?or?dbmmanage?(which are written in Perl) the Perl 5 interpreter is required (versions 5.003 or newer are sufficient). If you have multiple Perl interpreters (for example, a systemwide install of Perl 4, and your own install of Perl 5), you are advised to use the --with-perl option (see below) to make sure the correct one is used by?configure. If no Perl 5 interpreter is found by the?configure?script, you will not be able to use the affected support scripts. Of course, you will still be able to build and use Apache httpd.

?

Apache安裝過程

?

Step 1:安裝包gccgcc-c++

[root@getlnx05 pcre-8.33]# yum list gcc-c++

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Available Packages

gcc-c++.x86_64?????????????????????????????????????????????????????????????? 4.1.2-51.el5??????????????????????????????????????????????????????????????? rhel-debuginfo

[root@getlnx05 pcre-8.33]# yum list gcc

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Installed Packages

gcc.x86_64??????????????????????????????????????????????????????????????????? 4.1.2-51.el5??????????????????????????????????????????????????????????????????? installed

[root@getlnx05 pcre-8.33]# rpm -q gcc

gcc-4.1.2-51.el5

從上面可見gcc包已經安裝,缺少gcc-c++包,那么接下來安裝包gcc-c++,如果此處不安裝該包,后面安裝過程中會報錯

[root@getlnx05 pcre-8.33]#yum install? gcc-c++

?

Step 2:安裝包APRAPR-Util

[root@getlnx05 kerry]# ls apr*

apr-1.4.8.tar.gz? apr-util-1.5.2.tar.gz

[root@getlnx05 kerry]#

[root@getlnx05 kerry]# tar -zxf apr-1.4.8.tar.gz

[root@getlnx05 kerry]# cd apr-1.4.8

[root@getlnx05 apr-1.4.8]# ls

新建目錄/usr/local/apr,用作安裝目錄:

[root@getlnx05 apr-1.4.8]# mkdir /usr/local/apr

[root@getlnx05 apr-1.4.8]# ./configure --prefix=/usr/local/apr

[root@getlnx05 apr-1.4.8]# make

[root@getlnx05 apr-1.4.8]# make install

安裝完成后,可以驗證一下

[ root@getlnx05 apr]# ls -lrt

total 32

drwxr-xr-x 3 root root 4096 Aug 15 06:57 include

drwxr-xr-x 3 root root 4096 Aug 15 06:57 lib

drwxr-xr-x 2 root root 4096 Aug 15 06:57 build-1

drwxr-xr-x 2 root root 4096 Aug 15 06:57 bin

[root@getlnx05 kerry]# mkdir /usr/local/apr-util

[root@getlnx05 kerry]# tar -zxf apr-util-1.5.2.tar.gz

[root@getlnx05 kerry]# cd apr-util-1.5.2

[root@getlnx05 apr-util-1.5.2]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

[root@getlnx05 apr-util-1.5.2]# make

[root@getlnx05 apr-util-1.5.2]# make install

?

Step 3:安裝包PRCE

[root@getlnx05 kerry]# unzip pcre-8.33.zip

[root@getlnx05 kerry]# cd pcre-8.33

[root@getlnx05 kerry]#mkdir /usr/local/pcre

[root@getlnx05 pcre-8.33]# ./configure --prefix= /usr/local/pcre--with-apr=/usr/local/apr/bin/apr-1-config

[root@getlnx05 pcre-8.33]# make

[root@getlnx05 pcre-8.33]# make install

?

Step 4:安裝Apache Http Server

[root@getlnx05 kerry]# tar zxvf httpd-2.4.6.tar.gz

[root@getlnx05? kerry]#cd httpd-2.4.6

[root@getlnx05 httpd-2.4.6]# ./configure --prefix=/usr/local/apache --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

[root@getlnx05 httpd-2.4.6]#make

[root@getlnx05 httpd-2.4.6]#make install

Step 5:啟動Apache服務

[root@getlnx05 httpd-2.4.6]#? /usr/local/apache/bin/apachectl start

用瀏覽器訪問http://localhost時提示It works!

?

?

Apache安裝問題錦集

?

問題1:缺少包gcc-c++導致安裝包apr-util不通過

?

[root@getlnx05 kerry]# unzip pcre-8.33.zip

[root@getlnx05 kerry]# cd pcre-8.33

[root@getlnx05 pcre-8.33]# ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config

一般出現這個錯誤是因為沒有安裝包gcc-c++,可以通過如下命令檢查,

[root@getlnx05 pcre-8.33]# yum list gcc-c++

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Available Packages

gcc-c++.x86_64?????????????????????????????????????????????????????????????? 4.1.2-51.el5??????????????????????????????????????????????????????????????? rhel-debuginfo

[root@getlnx05 pcre-8.33]# yum list gcc

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Installed Packages

gcc.x86_64??????????????????????????????????????????????????????????????????? 4.1.2-51.el5??????????????????????????????????????????????????????????????????? installed

[root@getlnx05 pcre-8.33]# rpm -q gcc

gcc-4.1.2-51.el5

[root@getlnx05 pcre-8.33]# rpm -q gcc-c++

?

問題2:checking for APR-util... configure: error: the --with-apr-util parameter is incorrect

[root@getlnx05 httpd-2.4.6]#? ./configure --prefix=/usr/local/apache? --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

configure:

configure: Configuring Apache Portable Runtime library...

configure:

checking for APR... yes

? setting CC to "gcc"

? setting CPP to "gcc -E"

? setting CFLAGS to " -g -O2 -pthread"

? setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"

? setting LDFLAGS to " "

configure:

configure: Configuring Apache Portable Runtime Utility library...

configure:

checking for APR-util... configure: error: the --with-apr-util parameter is incorrect. It must specify an install prefix, a build directory, or an apu-config file.

[root@getlnx05 httpd-2.4.6]#

一般是由于APR-util沒有安裝成功,可以通過驗證該目錄是否為空來判斷,因為你有時候執行了make,忘了執行make isntall命令有可能導致這個錯誤。

[root@getlnx05 apr]# cd /usr/local/apr-util

[root@getlnx05 apr-util]# ls

?

問題3:沒有指定PCRE參數

[root@getlnx05 httpd-2.4.6]#? ./configure --prefix=/usr/local/apache? --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

configure:

configure: Configuring Apache Portable Runtime library...

configure:

checking for APR... yes

? setting CC to "gcc"

? setting CPP to "gcc -E"

? setting CFLAGS to " -g -O2 -pthread"

? setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"

? setting LDFLAGS to " "

configure:

configure: Configuring Apache Portable Runtime Utility library...

configure:

checking for APR-util... yes

checking for gcc... gcc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking how to run the C preprocessor... gcc -E

checking for gcc option to accept ISO C99... -std=gnu99

checking for pcre-config... false

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

[root@getlnx05 httpd-2.4.6]#

?

問題4:安裝前忘了先安裝APR相關包

[root@getlnx05 httpd-2.4.6]#? ./configure --prefix=/usr/local/appache/

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

configure:

configure: Configuring Apache Portable Runtime library...

configure:

checking for APR... no

configure: error: APR not found.? Please read the documentation.

[root@getlnx05 httpd-2.4.6]#

?

問題5:啟動服務時報錯

[root@getlnx05 httpd-2.4.6]#? /usr/local/apache/bin/apachectl start

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using getlnx05.gfg1.esquel.com. Set the 'ServerName' directive globally to suppress this message

這個時候需要編輯httpd.conf配置文件,添加SeraverName的具體IP地址。如下所示

[root@getlnx05 conf]# cd /usr/local/apache/conf/

[root@getlnx05 conf]# ls

extra? httpd.conf? magic? mime.types? original

[root@getlnx05 conf]# vi httpd.conf

ServerAdmin you@example.com

#

# 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 www.example.com:80

ServerName 192.168.9.122: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.

#

"httpd.conf" 502L, 18179C written

[root@getlnx05 conf]# /usr/local/apache/bin/apachectl restart

httpd not running, trying to start

[root@getlnx05 conf]# /usr/local/apache/bin/apachectl start

httpd (pid 7797) already running

如果從其它電腦連接訪問Apache時,輸入url地址:http://192.168.9.122頁面沒有顯示正常,而上面配置也OK,那么你必須關閉防火墻,有時候甚至需要重啟電腦才能OK,重啟Apache服務都無效。

[root@getlnx05 conf]# chkconfig iptables off

[root@getlnx05 conf]# chkconfig iptables off

[root@getlnx05 conf]# /usr/local/apache/bin/apachectl restart

[root@getlnx05 conf]# /usr/local/apache/bin/apachectl restart

[root@getlnx05 conf]#

轉載于:https://www.cnblogs.com/hyl8218/p/7543404.html

總結

以上是生活随笔為你收集整理的Linux系统安装Apache 2.4.6的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 国产精品无码一区二区三区在线看 | 欧美无极品 | 天天摸夜夜 | 日韩va在线观看 | 成年人小视频在线观看 | 欧美日韩人妻精品一区二区 | 夜色资源网 | 精品久久久免费 | 女生鸡鸡软件 | 一区二区三区视频免费看 | 国产日韩精品一区二区三区 | 黄色小网站入口 | 亚洲国产精品成人无久久精品 | 国产高清免费在线观看 | 日本做受 | 国产精品亚洲第一 | 免费无遮挡无码永久在线观看视频 | 亚洲琪琪| 女人天堂网站 | 国产精品第9页 | 国产成人精品午夜福利Av免费 | 亚洲AV无码片久久精品 | 亚洲一久久 | 久久国产精品免费看 | 日本一本视频 | 久久人人爽人人爽 | 白浆一区| 黄色欧美在线 | 91精品入口| 精品人妻一区二区三区换脸明星 | 蜜桃视频久久一区免费观看入口 | 尤物av无码色av无码 | 麻豆蜜臀 | 污污小说在线观看 | 亚洲美女视频在线观看 | 久久丫精品 | 亚洲精品黄 | 成人在线电影网站 | 长河落日电视连续剧免费观看01 | 特a级黄色片 | 99热一区 | 日韩有码中文字幕在线观看 | 99草| 亚洲男人天堂2024 | 四虎在线视频免费观看 | 亚洲综合激情另类小说区 | 国产情侣一区二区 | 久插网| xxxx日本高清 | 五月av综合av国产av | 国产精品传媒在线 | 欧美色综合网站 | 99在线播放 | 综合激情四射 | 国产精品爽爽久久久久久 | 一区视频在线播放 | 国产精品无码在线 | 97毛片| 国产成人精品片 | www.欧美在线观看 | 性生活网址 | 极品在线播放 | 最新av网站在线观看 | 最近2018年手机中文字幕版 | 国产成人午夜精品 | 999精品 | 成人免费视频国产 | 中文字幕在线观看一区二区 | 久草久 | 亚洲第一综合色 | 黄色一级淫片 | 男人的天堂视频在线观看 | 免费在线观看一区二区 | 激情天堂网 | 国产熟妇另类久久久久 | 手机免费看av片 | 国产一区在线视频观看 | 国产一区二区三区四区 | 成人免费激情视频 | 漂亮人妻洗澡被公强 日日躁 | 男女午夜爽爽爽 | 国产孕妇一区二区三区 | 奇米影视四色777 | 中文字幕在线观看一区二区三区 | 久久久精品影院 | 中文字幕乱码一二三区 | av五月 | 国产精品人八做人人女人a级刘 | 荷兰女人裸体性做爰 | 久草综合在线 | 国产18p| 亚洲精品一区中文字幕乱码 | 亚洲最大综合网 | 2021av在线| 99精品人妻少妇一区二区 | 私拍在线 | 日本一区二区成人 | 日韩一区二区三区久久 | 成年免费视频黄网站在线观看 |