硬件要求
至少3台虚机(besim一台,server一台,client和primeclient共用一台)
软件要求
JDK1.5版本(1.5以上不识别)
SPECweb2005安装软件
1. SPECweb2005安装
安装jdk1.5(ps:本实验中安装版本为jdk-1_5_0_22-linux-amd64.bin)
上传jdk-1_5_0_22-linux-amd64.bin到/root目录下;
chmod +x /root/jdk-1_5_0_22-linux-amd64.bin
cd /root
./jdk-1_5_0_22-linux-amd64.bin;
配置java环境变量,在/root/.bashrc和/root/.bash_profile添加
JAVA_HOME=/usr/java/jdk1.5.0_22
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH;
安装SPECweb2005
上传SPECweb2005.zip到/root目录下;
cd /root
unzip /root/SPECweb2005.zip
cd /root/SPECweb2005
java –jar setup.jar –console(ps:选择完全安装,此外皆选择默认);
2. besim安装
先执行SPECweb2005安装;
yum install gcc httpd httpd-devel –y;
编译FASTCGI
cd /opt/SPECweb2005/besim/fcgi-2.4.0/
sed -i '28a #include <cstdio>' include/fcgio.h
./configure --libdir=/lib64
make
make install
编译 BeSim
mkdir /var/www/html/fcgi-bin
cd /opt/SPECweb2005/besim
make fcgi TARGET='clean all install' DEST=/var/www/html/fcgi-bin/
安装 mod_fastcgi
下载mod_fastcgi-2.4.6.tar.gz并上传到/root目录下;
tar –xzvf mod_fastcgi-2.4.6.tar.gz
cd /root/ mod_fastcgi-2.4.6.tar.gz
cp Makefile.AP2 Makefile
make top_dir=/usr/lib64/httpd
make top_dir=/usr/lib64/httpd install
mkdir -p /etc/httpd/fastcgi
chmod 777 /etc/httpd/fastcgi
修改 /etc/httpd/conf/httpd.conf
将 listen 80 修改为 listen 81
在“Dynamic Shared Object (DSO) Support”添加一行:
LoadModule fastcgi_module modules/mod_fastcgi.so
在ScriptAlias /cgi-bin/行后添加两行:
ScriptAlias /fcgi-bin/ "/var/www/html/fcgi-bin/"
FastCgiIpcDir /etc/httpd/fastcgi
在<Directory "/var/www/cgi-bin">部分后面加上:
<Directory "/var/www/html/fcgi-bin">
AllowOverride None
Options +ExecCGI -Includes
SetHandler fastcgi-script
Order allow,deny
Allow from all
</Directory>
AddHandler fastcgi-script fcgi
修改/etc/sysconfig/selinux,修改: SELINUX=disabled
重启虚机
service httpd restart
测试:
tail –f /etc/httpd/logs/error_log
出现[Wed Sep 21 10:36:39 2005] [notice]FastCGI: process manager initialized (pid 25700),即为 FastCGI 安装成功。
bash /opt/SPECweb2005/besim/test_besim_bank.sh http://127.0.0.1:81/fcgi-bin/besim_fcgi.fcgi
出现如下图情况即成功。
3. server安装
先执行SPECweb2005安装;
yum install php mod_ssl –y
配置 webserver
cp -ar /opt/SPECweb2005/scripts/php/* /var/www/html/
chmod 777 /var/www/html/* -R
vi /etc/php.ini
display_errors = On
display_startup_errors = On
error_reporting = E_ALL
data.timezone = “Asia/Chongqing”
修改/opt/specweb2005/wafgen/unix下的rc文件,SIMULTANEOUS_SESSIONS和 DOCROOT修改为合适的值。(SIMULTANEOUS_SESSIONS 应该大于等于 client 端此设置;DOCROOT 一般为/var/www/html)
用/opt/specweb2005/wafgen/Wafgen执行上面修改过的rc文件。
service httpd restart
4. client安装
cd /opt/SPECweb2005
cp SPECweb_Banking.Unix-PHP.config SPECweb_Banking.config
cp SPECweb_Ecommerce.Unix-PHP.config SPECweb_Ecommerce.config
cp SPECweb_Support.Unix-PHP.config SPECweb_Support.config
cp Test.Unix-PHP.config Test.config
修改配置文件
vi Test.config
CLIENTS = "192.168.1.203"
BESIM_INIT_SCRIPT = "/fcgi-bin/besim_fcgi.fcgi"
SMARTY_DIR = "/var/www/html/Smarty-2.6.7/libs/"
SMARTY_BANK_DIR = "/var/www/html/bank/"
SMARTY_ECOMMERCE_DIR = "/var/www/html/ecommerce/"
SMARTY_SUPPORT_DIR = "/var/www/html/support/"
WEB_SERVER = 192.168.1.202
BESIM_SERVER = 192.168.1.201
vi SPECweb_Banking.config
PADDING_DIR = "/var/www/html/bank/dynamic_padding/"
CHECK_IMAGE_DIR = "/var/www/html/bank/images"
LG_BUF_SIZE = 102400
vi SPECweb_Ecommerce.config
PADDING_DIR = "/var/www/html/ecommerce/dynamic_padding/"
LG_BUF_SIZE = 102400
vi SPECweb_Support.config
PADDING_DIR = "/var/www/html/support/dynamic_padding/"
5. 测试
在client端,执行java -Xms512m -Xmx512m -jar specwebclient.jar
在primeclient端,执行java -Xms512m -Xmx512m -jar specweb.jar