准备工作
1. 下载Apache2.2 地址:http://httpd.apache.org/download.cgi
2. 安装依赖包 apt-get build-dep apache
开始安装
1. 解包源文件
tar xvf httpd-2.2.11.tar.bz2
2. 安装apr
cd httpd-2.2.11/srclib/apr
./configure –prefix=/usr/local/apr
make
make install
3. 安装apr-util
cd ../apr-util
./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr
make
make install
4. 正式安装apache2
./configure –prefix=/usr/local/apache2 –enable-so –enable-cache –enable-disk-cache –enable-mem-cache –enable-file-cache –enable-mods-shared=most –enable-ssl –enable-http –enable-rewrite –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util –with-mpm=worker
make
make install
5. 设置自动启动
ln -s /usr/local/apache2/bin/apachectl /etc/init.d/apachectl
chmod +x /usr/local/apache2/bin/apachectl
sysv-rc-conf
(实际上是将apachectl添加为服务,sysv-rc-conf为服务管理器)
找到apachectl 将其2,3,4,5都选中
q退出
所使用到的参数的一些说明
参数
说明
–enable-so
如果希望核心能够装载 DSO,而不实际编译任何动态模块,则要明确指定 –enable-modules=so 或者 –enable-so”,所以前面的顺序不能交换顺序。
–enable-cache
Apache 的缓存方式有两种,一种是基于硬盘文件的缓存,由 mod_disk_cache 实现,另一种是使用内存缓存,由 mod_mem_cache 实现,不过它们都是依赖 mod_cache 模块的,mod_cache 模块提供了一些缓存配置的指令供它们使用,而 [...]
Recent Comments