Apache

Apache 1.3 启用 Mod_fastcgi

1. 下载:

Apache 1.3:

[http://labs.xiaonei.com/apache-mirror/httpd/apache_1.3.41.tar.gz]

Fastcgi (Apache Mod):

[http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz]

2. 编译:

# 解压缩 Apaache

tar zxvf apache_1.3.41.tar.gz

# 解压缩 mod_fastcgi

tar zxvf mod_fastcgi-2.4.6.tar.gz

# 移动 mod_fastcgi 到 Apache 的 Modules 目录

mv mod_fastcgi-2.4.6 apache_1.3.41/src/modules/fastcgi

# 开始编译安装

./configure –prefix=/home/apache \
–enable-module=so \
–enable-module=rewrite \
–activate-module=src/modules/fastcgi/libfastcgi.a

make

make install

3. 配置:

# 复制 apachectl 文件到系统启动目录.

cp /home/apache/bin/apachectl /etc/init.d/httpd

# 编辑 /etc/init.d/httpd 文件. 添加 chkconfig 自动启动参数

vi /etc/init.d/httpd

#!/bin/sh
#
# chkconfig: – 85 15
# description: Apache 1.3.41 World Wide Web Server

4. 测试:

# 启动 Apache 服务

services httpd restart

# 查看 Fastcgi 进程

ps -eLf | grep “fcgi” | grep -v “grep”

nobody /home/apache/bin/fcgi-

# 查看 Apache 编译模块

/home/apache/bin/httpd -l

mod_fastcgi.c

Apache 1.3 启用 Mod_Rewrite

1. 编译:

./configure –prefix=/home/apache \
–enable-module=so \
–enable-module=rewrite \
–activate-module=src/modules/fastcgi/libfastcgi.a

2. 配置:

vi /home/apache/conf/httpd.conf

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteLog /home/apache/logs/rewrite_log
RewriteLogLevel 0

</IfModule>

3. 测试:

# 重新启动Apache

/etc/init.d/httpd restart

# 检查Apache静态编译模块

/home/apache/bin/httpd -l

相关链接: [Ubuntu Server 启用 Apache Mod_Rewrite]

Ubuntu Server 启用 Apache Mod_Rewrite

sudo a2enmod rewrite

Enabling module rewrite.
Run ‘/etc/init.d/apache2 restart’ to activate new configuration!

sudo vim /etc/apache2/sites-enabled/default

AllowOverride All

Debian Linux Apache+PHP+MySQL

1. Debian 3.1下安装Deb包(Apache.MySQL.PHP).如图.

2. 安装成功后配置文件如下修改:

==================================
Apache 1.3.3 Debian Sarge Config
==================================

vim /etc/apache/httpd.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

AddDefaultCharset UTF-8

<IfModule mod_dir.c>
DirectoryIndex index.htm index.html index.cgi index.php
</IfModule>

vim /etc/apache/modules.conf

LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

==================================
MySQL 4.0.24 Debian Sarge Config
==================================

vim /etc/mysql/my.cnf

#skip-external-locking
bind-address 172.16.1.254

==================================
PHP Version 4.3.10 Debian Config
==================================

vim /etc/php4/apache/php.ini

display_errors = Off
default_charset = “UTF-8″
extension=gd.so
extension=mysql.so