apache重新編譯安裝
『壹』 編譯安裝apache 需要什麼環境
編譯Apache的要求如下:
磁碟空間
必須保證有50MB以上的自由臨時磁碟空間。Apache安裝完畢後會占據10MB左右的空間,實際的磁碟空間需求會因編譯設置和是否安裝第三方模塊而有所不同。
ANSI-C編譯器及編譯環境
必須裝有ANSI-C編譯器,推薦使用自由軟體基金會(FSF)的GCC。如果沒有GCC,那麼要確保使用的編譯器符合ANSI標准,而且PATH中必須包含指向基本編譯工具比如make的路徑。
確保准確的時間
由於HTTP協議的元素都會用到時間,有必要了解一下你的系統所使用的時間同步機制。在基於網路時間協議(NTP)的系統中,一般是用ntpdate或xntpd來同步時間。有關NTP軟體的資料請參見NTP主頁。
Perl 5 [可選]
有些用Perl寫的支持腳本,如apxs或dbmmanage ,需要Perl5解釋器(5.003或以上的版本就足夠了)。如果系統中存在多個Perl解釋器,比如有系統提供的Perl 4,還有你自己安裝的Perl 5,推薦你使用 --with-perl 選項來確保configure腳本使用正確的版本。如果configure沒有沒找到Perl 5也沒關系,這並不影響Apache httpd的編譯和安裝,只是相關的支持腳本不能使用而已。
apr/apr-util >= 1.2
apr和apr-util包含在Apache httpd的發行源代碼中,並且在絕大多數情況下使用都不會出現問題。當然,如果apr或apr-util的1.0或1.1版本已經安裝在你的系統中了,則必須將你的apr/apr-util升級到1.2版本,或者將httpd單獨分開編譯。要使用發行源代碼中自帶的apr/apr-util源代碼進行安裝,你必須手動完成:
# 編譯和安裝 apr 1.2
cd srclib/apr
./configure --prefix=/usr/local/apr-httpd/
make
make install
# 編譯和安裝 apr-util 1.2
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install
# 配置 httpd
cd ../../
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/
『貳』 為apache添加新的模塊支持必需重新編譯嗎
apache
偽靜態
需要在apache中添加偽靜態模塊,如果是yum安裝的apache,是自帶偽靜態模塊的,如果沒有,或者是源碼編譯,可以重新下載apache同版本的源碼包,重新編譯,
編譯方法
可參考下
www.rootop.org/pages/1152.html
然後在ap笭埂蒂忌酈渙墊惟叮隸ache中添加參數載入模塊,配置apache支持。添加偽靜態規則就行。
如果您認可我的答案,請採納。
您的採納,是我答題的動力,O(∩_∩)O謝謝!!
『叄』 編譯安裝apache時出現的問題
我是新手 不懂
『肆』 centos下編譯安裝apache
centos下編譯安裝apache安裝apache選擇性的安裝模塊,安裝語句如下:./configure
--prefix=/usr/local/apache
--enable-so
--enable-http
--enable-ssl
--enable-rewrite
--enable-expires
--enable-deflate出現錯誤:configure:
error:
APR
not
found.
Please
read
the
documentation安裝apr去http://apr.apache.org/download.cgi下載apr進行安裝繼續報錯:configure:
error:
APR-util
not
found.
Please
read
the
documentation安裝APR
去http://apr.apache.org/download.cgi下載apr-util-1.5.1.tar.gz編譯安裝它搞定收工
『伍』 為apache添加新的模塊支持必需重新編譯嗎
不用. 用apxs -a -c -i ****.so 就行了
『陸』 linux的APACHE伺服器的編譯安裝配置設置從頭到尾的步驟.個人主頁的建立細節.請高手詳細指點.
細節太多了,在這里無法一一列出
妨你看看apache的configure幫助
進入apache的源文件目錄後,執行
./configure --help
它會列出所有的東西,很多東西你都可以自定義。其中
--perfix=PATH 是設置安裝路徑
--bindir=DIR 是設置可執行文件的路徑
--libexecdir=DIR 是設置libexec路徑
--sysconfdir=DIR 是設置配置文件路徑
還有很多,在./configure --help里都有列出來
光碟軟體包裡面的apache是原來編譯好了的,具體的編譯方式在安裝以後可以可以執行strings /usr/sbin/httpd來查看,裡面有很多東西,我們只看我們需要的東西,我這里復制出來你可以看下
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/var/logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
-D HTTPD_ROOT="/etc/httpd"
僅作參考
『柒』 ubuntu 編譯安裝apache2怎麼重啟
步驟
首先,安裝Apache2,安裝命令:sudo apt-get install apache2
安裝完成後,進入到/etc/apache2中(根據自己的實際安裝目錄),這邊我配置文件在/etc/apache2中。
我們看到沒有想像中的httpd.conf配置文件,這里要說明的是apache2的配置文件是apache2.conf,而不是http.conf。
打開apache2.conf。寫入兩條語句
ServerName localhost
DirectoryIndex index.html index.htm index.php
這里的ServerName localhost是為了防止最後開啟apache2服務的時候會提示DNS出錯。
DirectoryIndex index.html index.htm index.php是默認目錄的寫法。保存退出。
可以在apache2.conf中加入 AddDefaultCharset GB2312
設置默認字元集,定義伺服器返回給客戶機默認字元集(由於西歐UTF-8是Apache默認字元集,因此當訪問有中文的網頁時會出現亂碼,這時只要將字元集改成GB2312,再重啟Apache服務即可)
Listen 192.168.1.1:80 設置監聽ip是192.168.1.1的地址和埠為80
Listen 192.168.1.2:8080 設置監聽ip是192.168.1.2的地址和埠為8080
Alias /down "/sofТWare /download"
創建虛擬目錄(創建名為down的虛擬目錄,它對應的物理路徑是:/sofТWare /download)
Alias /ftp "/var/ftp"
創建虛擬目錄(創建名為ftp的虛擬目錄,它對應的物理路徑是:/var/ftp)
<Directory "/var/www/html">
設置目錄許可權
(<Directory "目錄路徑">此次寫設置目錄許可權的語句</Directory>)
Options FollowSymLinks page:116
AllowOverride None
</Directory>
需要說明的是,在apache2中,根設置(默認主目錄)在 /etc/apache2/sites-АVailable/default中,我們打開default,進行配置。
如圖,這里我們的默認主目錄設置的路徑是/var/www,文檔最上方的VirtualHost後方的*代表通配符,即表示所有本機ip地址,監聽埠為80,ServerName填寫你注冊的域名,沒有可以不填。保存退出。
4
至此,基本配置已經全部完成,查看本機ip地址。輸入啟用apache2的命令:/etc/init.d/apache2 restart.並在瀏覽器中輸入本機ip地址。成功!
『捌』 linux下編譯安裝apache和常規rpm包安裝apache的問題,下面是遇到的情況
編譯的時候需要增加參數configure 的時候需要增加參數 --help看看參數的說明,沒有指定參數的話有很多模塊默認是不安裝的
『玖』 Apache的配置文件語法錯誤,問題所在怎麼修改
解決問題的辦法:
1.先看次文:
Full text of PR number 2312:
Received: (qmail 27406 invoked by uid 2012); 28 May 1998 19:08:53 -0000
Message-Id: <[email protected]>
Date: 28 May 1998 19:08:53 -0000
From: Tim Evans <[email protected]>
Reply-To: [email protected]
To: [email protected]
Subject: syntax error in distributed httpd.conf file
X-Send-Pr-Version: 3.2
>Number: 2312
>Category: os-aix
>Synopsis: syntax error in distributed httpd.conf file
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apache
>State: closed
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Thu May 28 12:10:00 PDT 1998
>Last-Modified: Thu May 27 12:42:51 PDT 1999
>Originator: [email protected]
>Organization:
>Release: 1.3b7
>Environment:
AIX 4.3; AIX cc
>Description:
After compiling and installing 1.3b7 in default location, I changed *only* the port number in
the distributed httpd.conf file. httpd fails to start with this error:
Syntax error on line 40 of /usr/local/apache/conf/access.conf:
Expected </Directory> but saw </Directory>
NOTE: "Expected </Directory> but saw </Directory>"
>How-To-Repeat:
>Fix:
>Audit-Trail:
State-Changed-From-To: open-analyzed
State-Changed-By: coar
State-Changed-When: Sun Sep 27 09:41:57 PDT 1998
State-Changed-Why:
This is a known problem with the AIX C compiler (see also
PRs 2534, 2664, 2853, and 3042). IBM are aware of the
problem. I'm putting this report into 'analyzed' so we
can notify you of the correction if and when we get one.
Category-Changed-From-To: general-os-aix
Category-Changed-By: coar
Category-Changed-When: Sun Sep 27 09:41:57 PDT 1998
State-Changed-From-To: analyzed-closed
State-Changed-By: [email protected]
State-Changed-When: Sun Dec 13 14:54:32 PST 1998
State-Changed-Why:
The AIX compiler problem which gave the error of
"on Expected </Files> but saw </Files>" has been fixed.
+ A set of PTF's which correct the problem are available from:
+ http://service.software.ibm.com/support/rs6000
+ The PTF's are: U462005, U462006, U462007, and U462023 through
+ U462030. The PTF's have been tested and do indeed fix the problem.
Thanks for using Apache
From: [email protected]
To: [email protected]
Cc: [email protected]
Subject: Re: os-aix/2312: syntax error in distributed httpd.conf file
Date: Wed, 16 Dec 1998 14:00:19 -0500
Yes, the listed PTF's are for the xlC 3.6.4 compiler.
Please talk with your IBM Service Rep. to see
if your compiler is effected.
> Synopsis: syntax error in distributed httpd.conf file
>
> State-Changed-From-To: analyzed-closed
> State-Changed-By: [email protected]
> State-Changed-When: Sun Dec 13 14:54:32 PST 1998
> State-Changed-Why:
> The AIX compiler problem which gave the error of
> "on Expected </Files> but saw </Files>" has been fixed.
> + A set of PTF's which correct the problem are available from:
> + http://service.software.ibm.com/support/rs6000
> + The PTF's are: U462005, U462006, U462007, and U462023 through
> + U462030. The PTF's have been tested and do indeed fix the problem.
>
These PTF's appear to be for the old AIX compiler, not the latest one
(i.e. "C for AIX Version 4.3").
Comment-Added-By: [email protected]
Comment-Added-When: Mon Feb 1 07:34:08 PST 1999
Comment-Added:
According to the IBM compiler people:
The AIX 4.3 compiler is old and out of support.
The AIX 3.6.4 C/C++ compiler problem is fixed with the PTF's
listed above
The only forthcoming comiler fix is for the AIX 4.4 C compiler
and this PTF's to fix this will be available in April 99.
Sorry for any confusion that IBM numbering scheme has caused.
Comment-Added-By: [email protected]
Comment-Added-When: Thu May 27 12:42:49 PDT 1999
Comment-Added:
IBM has released a fix their 4.4 C compiler.
The APAR number is IX87837, you can go to:
http://service.software.ibm.com/cgi-bin/support/rs6000.support/downloads
use the AIX Fix Distribution Service, and search on the APAR number above,
it will pull up the updated filesets with the fix.
Evidently this fix has been available for a while, but I just
got wind of the updated APAR. Shane
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[email protected]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]
2.針對自己編譯器的版本進行修改,我是在最後一種情況,所以我升級了aix的c 編譯器,升為4.4.0.3.
3.重新編譯安裝apache
4.問題解決了。