1:tar -xzvf httpd-2.2.6.tar.gz
./configure --prefix=/usr/local/apache2 --enable-so --with-mpm=worker --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
--with-pcre=/usr/local/pcre/bin/pcre
make
make install
2:
mod_fcgid.2.2.gz的安装:
tar -xvzf mod_fcgid.2.2.tgz
make
make install
3:httpd.conf 配置:
添加:
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
ScriptAlias /fcgi-bin/ /usr/web3/fcgi-bin/
SocketPath /tmp/fcgid.sock
IdleTimeout 600
ProcessLifeTime 3600
MaxProcessCount 30
DefaultMinClassProcessCount 3
DefaultMaxClassProcessCount 100
IPCConnectTimeout 20
IPCCommTimeout 48
</IfModule>
DocumentRoot "/usr/web3"
<Directory "/usr/web3/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/web3">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/web3/cgi-bin/"
</IfModule>
4:
tar xzvf fcgi-2.4.0.tar.gz
./configure
make
make install
建立连接文件:
ln -s /usr/local/lib/libfcgi.so.0 /usr/lib/libfcgi.so.0
ln -s /usr/local/lib/libfcgi.so /usr/lib/libfcgi.so
5:测试环境:
将/home/fcgi-2.4.0/examples/echo.c
拷贝到/usr/web3/fcgi-bin
编译:gcc -o echo.fcgi echo.c -I/usr/local/lib -lfcgi
启动apache:
/usr/local/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf
在IE输入:
http://192.168.1.18/fcgi-bin/echo.fcgi
有内容则正常。
OK
2:
mod_fcgid.2.2.gz的安装:
tar -xvzf mod_fcgid.2.2.tgz
make
make install
3:httpd.conf 配置:
添加:
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
ScriptAlias /fcgi-bin/ /usr/web3/fcgi-bin/
SocketPath /tmp/fcgid.sock
IdleTimeout 600
ProcessLifeTime 3600
MaxProcessCount 30
DefaultMinClassProcessCount 3
DefaultMaxClassProcessCount 100
IPCConnectTimeout 20
IPCCommTimeout 48
</IfModule>
DocumentRoot "/usr/web3"
<Directory "/usr/web3/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/web3">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/web3/cgi-bin/"
</IfModule>
4:
tar xzvf fcgi-2.4.0.tar.gz
./configure
make
make install
建立连接文件:
ln -s /usr/local/lib/libfcgi.so.0 /usr/lib/libfcgi.so.0
ln -s /usr/local/lib/libfcgi.so /usr/lib/libfcgi.so
5:测试环境:
将/home/fcgi-2.4.0/examples/echo.c
拷贝到/usr/web3/fcgi-bin
编译:gcc -o echo.fcgi echo.c -I/usr/local/lib -lfcgi
启动apache:
/usr/local/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf
在IE输入:
http://192.168.1.18/fcgi-bin/echo.fcgi
有内容则正常。
OK