Translation(s): English - Italiano - Português Brasileiro - 简体中文 - Русский
WebServers > Apache
Apache 服务器
Debian 下安装 Apache 服务器
Debian 下安装 apache2 很容易,只需运行命令: apt-get install apache2 即可。
APT 将自动选择一个引擎,通常为 apache2-mpm-prefork 或 apache2-mpm-worker (apache2-mpm-event 和 apache2-mpm-itk 不推荐).。
脚本 / 动态内容
Apache 可以通过 CGI 或 FastCgi (libapache2-mod-fcgid)使用任意的外部程序和脚本语言。
Apache 也内嵌了很多脚本解释器或连接到一个应用服务器来生成动态内容:
PHP : libapache2-mod-php5
Perl : libapache2-mod-perl2
Python : libapache2-mod-python, libapache2-mod-wsgi (see ?ApachePython).
Java/Jsp : Apache's mod_proxy_ajp (a2enmod proxy_ajp), or libapache2-mod-jk
Ruby : libapache2-mod-ruby
Lisp : libapache2-mod-lisp.
模块
Debian 中有很多 Apache 的模块,这些模块软件包名称通常有个前缀:libapache2-mod
安装完毕后,模块可通过命令 a2enmod 和 a2dismod 来启用/禁用。
其他事项
apt-cache search apache | less
- 该命令会列出 Debian 仓库中与 Apache 相关的软件列表。带有 “apache” 字眼的软件包通常都是与相应软件包有关的,如 -doc, -dev, -common, -perl …
常见问题
- Apache user (www-data)
- Debian's Apache packages come configured to run as user 'www-data'. This is potentially confusing: files to be served by apache should not be owned by 'www-data', as apache should not normally be allowed to modify them (i.e. as long as you're not running a wiki).
- Apache v1.3
Apache.org is officially encouraging users to switch to apache v2.2. DebianLenny and later releases, don't ship Apache v1.x.
(apache 1.3 release notes: "We strongly recommend that users of all earlier versions, including 1.3 family release, upgrade to to the current 2.2 version as soon as possible.")- 升级
- See /usr/share/doc/apache2.2-common/NEWS.Debian.gz
- 功能增强
- 打包模块
另见
WebServers - Debian 中的其他网络服务器
README.Debian, NEWS.Debian in the apache2.2-common package.
- 当然,还包括其他常用帮助手册、README 文件。