特殊:Badtitle/NS100:ApacheHTTPServerUpgrade
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/ApacheHTTPServerUpgrade }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/af | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Afrikaans| [[::ApacheHTTPServerUpgrade/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ar | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|العربية| [[::ApacheHTTPServerUpgrade/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/az | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|azərbaycanca| [[::ApacheHTTPServerUpgrade/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/bcc | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|جهلسری بلوچی| [[::ApacheHTTPServerUpgrade/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/bg | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|български| [[::ApacheHTTPServerUpgrade/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/br | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|brezhoneg| [[::ApacheHTTPServerUpgrade/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ca | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|català| [[::ApacheHTTPServerUpgrade/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/cs | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|čeština| [[::ApacheHTTPServerUpgrade/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/de | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Deutsch| [[::ApacheHTTPServerUpgrade/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/el | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Ελληνικά| [[::ApacheHTTPServerUpgrade/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/es | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|español| [[::ApacheHTTPServerUpgrade/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/fa | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|فارسی| [[::ApacheHTTPServerUpgrade/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/fi | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|suomi| [[::ApacheHTTPServerUpgrade/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/fr | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|français| [[::ApacheHTTPServerUpgrade/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/gu | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|ગુજરાતી| [[::ApacheHTTPServerUpgrade/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/he | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|עברית| [[::ApacheHTTPServerUpgrade/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/hu | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|magyar| [[::ApacheHTTPServerUpgrade/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/id | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Bahasa Indonesia| [[::ApacheHTTPServerUpgrade/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/it | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|italiano| [[::ApacheHTTPServerUpgrade/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ja | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|日本語| [[::ApacheHTTPServerUpgrade/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ko | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|한국어| [[::ApacheHTTPServerUpgrade/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ksh | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Ripoarisch| [[::ApacheHTTPServerUpgrade/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/mr | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|मराठी| [[::ApacheHTTPServerUpgrade/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ms | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Bahasa Melayu| [[::ApacheHTTPServerUpgrade/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/nl | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Nederlands| [[::ApacheHTTPServerUpgrade/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/no | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|norsk| [[::ApacheHTTPServerUpgrade/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/oc | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|occitan| [[::ApacheHTTPServerUpgrade/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/pl | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|polski| [[::ApacheHTTPServerUpgrade/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/pt | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|português| [[::ApacheHTTPServerUpgrade/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ro | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|română| [[::ApacheHTTPServerUpgrade/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/ru | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|русский| [[::ApacheHTTPServerUpgrade/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/si | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|සිංහල| [[::ApacheHTTPServerUpgrade/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/sq | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|shqip| [[::ApacheHTTPServerUpgrade/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/sr | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|српски / srpski| [[::ApacheHTTPServerUpgrade/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/sv | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|svenska| [[::ApacheHTTPServerUpgrade/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/th | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|ไทย| [[::ApacheHTTPServerUpgrade/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/tr | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Türkçe| [[::ApacheHTTPServerUpgrade/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/vi | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|Tiếng Việt| [[::ApacheHTTPServerUpgrade/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/yue | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|粵語| [[::ApacheHTTPServerUpgrade/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/zh | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|中文| [[::ApacheHTTPServerUpgrade/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/zh-hans | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|中文(简体)| [[::ApacheHTTPServerUpgrade/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:ApacheHTTPServerUpgrade | UbuntuHelp:ApacheHTTPServerUpgrade | {{#if: | :}}ApacheHTTPServerUpgrade}}/zh-hant | • {{#if: UbuntuHelp:ApacheHTTPServerUpgrade|中文(繁體)| [[::ApacheHTTPServerUpgrade/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:ApacheHTTPServerUpgrade|:ApacheHTTPServerUpgrade|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :ApacheHTTPServerUpgrade/zh | | {{#ifexist: ApacheHTTPServerUpgrade/zh | | {{#ifeq: {{#titleparts:ApacheHTTPServerUpgrade|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:ApacheHTTPServerUpgrade|1|-1|}} | zh | | }}
Upgrade Apache HTTP Server
In Ubuntu 8.04, the apt-get install apache2 will install 2.2.8 version of the Apache server. However, this version of Apache server contains big memory leak issue especially when used with SSL. The goal is to upgrade Apache to any version downloaded, compile it, while maintain your configuration files in /etc/apache2 directory. This is an IN-PLACE upgrade.
Quick Install using Direct Deploy
You can read the rest of the wiki page for details on the upgrade process. To do a quick upgrade, go to Emergence Software and you can do this upgrade by downloading a deb package.
Manual Steps
Use apt-get to get the required packages:
apt-get install build-essential apache2 libpcre3-dev
Download the latest version from http://archive.apache.org
http://archive.apache.org/dist/httpd/httpd-2.2.11.tar.gz for example.
Run ./configure, make, make install
The goal is the build apache to over-ride existing versions and keep all configuration files in the standard /etc/apache2 directory. To do so, we need to ./configure using specific options.
./configure --with-pcre=/usr --enable-layout=Debian --with-program-name=apache2 --enable-logio --disable-actions --disable-authn-file --disable-authn-default --disable-authz-groupfile --disable-authz-host --disable-authz-user --disable-authz-default --disable-auth-basic --disable-include --disable-filter --disable-env --disable-setenvif --disable-mime --disable-status --disable-autoindex --disable-asis --disable-cgi --disable-negotiation --disable-dir --disable-userdir --disable-alias;
This will build apache2 with the same module options as the original apache2 from Ubuntu repository. We also use the debian layout, with program name apache2. That way, it will over-ride existing /usr/sbin/apache2 file, which is our goal of an in-place upgrade. Now, you can do:
make sudo make install
SSLMutex Issue
If you use SSL or have mod_ssl enabled, you will need to specify the SSLMutex directory to avoid Apache2 startup problems. The easiest way to do this create ssl.conf file in the /etc/apache2/conf.d directory. The content of the file is below:
<IfModule mod_ssl.c> SSLMutex file:/etc/apache2/logs/ssl_mutex </IfModule>
Modify /usr/bin/apachectl file
We need to point the envvars to /etc/apache2/envvars. To do so, find and replace the path in apachectl to /etc/apache2/envvars. Once you finish editing and save it. Copy this file to /etc/init.d/apache2. This will be the new /etc/init.d/apache2 script.
Restart your Apache Server
sudo /etc/init.d/apache2 restart