linux+apache+php+mysql+resin+JDK+cgi
准备: mysql-debug-5.0.0-alpha-pc-linux-i686.tar.gz j2sdk-1_4_2_05-linux-i586.bin apache_1.3.31.tar.gz php-4.3.9.tar.bz2 resin-2.1.13.tgz 可能需要Zlib:zlib-1.2.1.tar.gz tar zcvf zlib-1.2.1.tar.gz cd zlib-1.2.1 ./configure --prefix=/usr/zlib make make install 以上都可以去官方网站下载。
1.安装mysql groupadd mysql useradd -g mysql mysql cd /usr/local gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - ln -s full-path-to-mysql-VERSION-OS mysql cd mysql scripts/mysql_install_db chown -R root . chown -R mysql data chgrp -R mysql . bin/mysqld_safe --user=mysql & bin/mysql bin/mysqladmin -u root -p password 'nespassword'
2.安装apache+php tar zxvf apache_1.3.31.tar.gz cd /apacheXXXXXpath ./configure --prefix=/usr/local/apache_1.3.31 --enable-shared=max
--enable-module=so
cd /phpXXXpath ./configure --prefix=/usr/local/php
--with-apxs=/usr/local/src/apache_1.3.31/bin/apxs
--with-config-file-path=/usr/local/lib --enable-track-vars --with-xml
--with-zlib-dir=/usr/zlib --with-mysql=/usr/local/mysql make make install
cd /apacheXXXXXpath make make install
3.安装resin+JDK ./j2sdk-1_4_2_05-linux-i586.bin 安装到/usr/local/j2sdk1.4.2_05
解压resin到/usr/local/resin-2.1.13
修改resin的http.sh找到如下 #JAVA_HOME=/usr/local/j2sdk1.4.2_05 #export JAVA_HOME #RESIN_HOME=/usr/local/resin-2.1.13 #export RESIN_HOME 把注释去掉
4.apache,php,mysql,resin,cgi结合 配置resin cp resin模块 cp mod_caucho.so /usr/local/src/apache_1.3.31/libexec
修改resin vi resin.conf 配置
/usr/local/apache_1.3.31/htdocs/ 启动resin /usr/local/resin/bin/http.sh start
配置php cp /php/php.ini-dist /usr/local/lib cd /usr/local/lib mv php.ini-dist php.ini vi php.ini 修改 register_globals=On :wq cd /usr/local/apache/conf vi httpd.conf
配置cgi环境: 寻找到#ScriptAlias /cgi-bin/ "/usr/local/apache_1.3.31/cgi-bin/"删除前面
的#
AllowOverride All Options All Order allow,deny Allow from all
更改Options、Allow Override的参数为All。 寻找到#AddHandler cgi-script .cgi。删除前面的#,在后面加上 .pl .pm
配置php环境: 找到DirectoryIndex index.html 改为DirectoryIndex index.php index.jsp index.cgi index.html 找到Options Indexes FollowSymLinks MultiViews 改为Options FollowSymLinks MultiViews 合适的地方加入 AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
配置jsp环境: LoadModule caucho_module /usr/local/apache/libexec/mod_caucho.so #AddModule mod_caucho.c # CauchoConfigFile /usr/local/resin-2.1.13/conf/resin.conf
SetHandler caucho-status
# :wq cd ../bin
apachectl restart
cgi的mysql DBI DBA的安装:
shell> perl -MCPAN -e shell cpan> install DBI cpan> install DBD::mysql
4.测试 写cgi,php,jsp测试脚本。网上各种探针很多故一下略若干行......
5.写入启动脚本/etc/rc.local
/usr/local/mysql/bin/mysqld_safe --user=mysql &
/usr/local/resin-2.1.13/bin/httpd.sh start /usr/local/apache_1.3.31/bin/apachectl start
要想增大apache的最大连接线程
修改src/include/httpd.h 默认是256
#define HARD_SERVER_LIMIT 256
改成
#define HARD_SERVER_LIMIT 2560
|