Spec Web 2009 web服务器测试

        由于客户有Web服务器需求,客户需要用SPEC WEB 2009 评估送测的服务器。于是,我在自己实验室也搭建了SPEC WEB 2009测试环境,由于其官方的User Guide 没有详细的步骤,软件版本。互联网也没有详细的步骤,故把自己详细建立过程分享一下。

一.软件环境

Web Server  192.168.0.3 Port 80
Linux Red Hat 6.2
Apache Web Server 2.2.14 shipped with OS
PHP script 5.3 shipped with OS
Smarty 2.2.26 shipped with OS
Perl
Test PHP page
JDK   jdk-7u9-linux-i586.rpm 
 
Besim 192.168.0.2 Port 80
Linux Red Hat 6.2
Apache Web Server 2.2.22  Compiled from the source
PHP script engine 5.3  nice to have
Perl required for test 
Fcgi  2.4.0  
Mod_fcgi 2.4.6  
JDK jdk-7u9-linux-i586.rpm
 
Prime client  192.168.0.10
Windows XP
JDK    jdk-6u24-windows-i586.exe
 
Client  192.168.0.20
Windows XP
JDK    jdk-6u24-windows-i586.exe
 

二.设置 

 

所有机器

安装 JDK
Linux :  JDK jdk-7u9-linux-i586.rpm
Besim Web server 安装RPM
Windows: jdk-6u24-windows-i586.exe
Prime Client/Client 双击安装
 

服务器设置

 

Besim  配置 192.168.0.2 Port 80

 
Install Linux Red Hat 6.2  选择基本服务器
 
1.Copy related software to /usr/local
   a.httpd-2.2.22.tar.gz
   b. fcgi-2.4.0.tar.gz
   c. mod_fastcgi-2.4.6.tar.gz
2.Build and install Apache 2
   Tar –zxvf httpd-2.2.22.tar.gz
   ./configure –prefix=/usr/local/apache2 –enable-so –with-mpm=worker
   Make  & Make install
   Test web site:  Http://192.168.0.2/
 
3. FastCgi  代码编译
   a. tar  -zxvf  fcgi-2.4.0.tar.gz
   b. cd fcgi-2.4.0
   c. 修改   /include/fcgio.h  with #include
   d.  ./configure --libdir=/lib
   c. make & make install
   e. mkdir /usr/local/appache2/htdocs/fcgi-bin/
   f. make fcgi TARGET='clean all install' DEST=/usr/local/appache2/htdocs/fcgi-bin/
     you should see besim_fcgi.fcgi  under folder /usr/local/appache2/htdocs/fcgi-bin/
   g. chmod 777 /usr/local/appache2/htdocs/fcgi-bin
 
4. Mod_fastcgi 代码编译
   a. tar  -zxvf mod_fastcgi-2.4.6.tar.gz
   b. cd mod_fastcgi-2.4.6
   c. cp Makefile.AP2 Makefile
   d.  Modify Makefile
         1. top_dir=/usr/local/apache2
         2. APXS=/usr/local/apache2/bin/apxs
         3.APACHECTL=/usr/local/apache2/bin/apachectl
  e. Make & Make install
   f. 查看 ls –l  /usr/local/apache2/modules/mod_fastcgi.so 
 
 
 
 
 
5. 服务器配置
 mkdir -p /usr/local/apache2/fastcgi
 chmod 777 /usr/local/apache2/fastcgi
 Modify configure file  for  /usr/local/conf/httpd.conf):
1.      Add this line in the "Dynamic Shared Object (DSO) Support" section:
         LoadModule fastcgi_module modules/mod_fastcgi.so
2.      Add the following lines just after theScriptAlias /cgi-bin/ line:
         ScriptAlias /fcgi-bin/ "/var/www/fcgi-bin/"
         FastCgiIpcDir /usr/local/apache2/fastcgi
3.      Add the following section, preferably after the/cgi-bin"> section:
           
                  AllowOverride None
                 Options +ExecCGI -Includes
                 SetHandler fastcgi-script
                Order allow,deny
                Allow from all
          
           AddHandler fastcgi-script fcgi
 
6. 测试 Besim
   
     perl    test_besim_bank.pl http://192.168.0.2/fcgi-bin/besim_fcgi.fcgi
 
7. Service iptables stop 去掉防火墙

 
 
 返回结果
 
 
 
 
 

SUT Web Server  配置  192.168.0.3 Port 80

Linux Red Hat 6.2
 
1.安装 RHEL6.2 ,并选择自带的网页服务器配置(Intall Web Server with RHEL6.2.It is ok to install native apache web server  and PHP engine)
2.Copy the contents of the SPECweb2009/Script/PHP/*  to  /usr/local/apache/htdocs/
3..tar –zxvf Smarty-2.6.26.tar.gz
4.复制 smarty 2.6.26 目录下libs 到 /var/www/html/  并改名为 smarty
5.Chmod 777  /var/www/html*
6.修改/etc/php.ini ,或者查看 error_log
       "display_errors   on
       "display_startup_errors  On 
        error_reporting = E_ALL",
7. 修改 spec web \wafgen\目录下 workload 文档
    确保  DOCROOT=/var/www/html
             SIMULTANEOUS_SESSIONS=合适值(1600)
            
   运行./wafgen.sh  /unix/bank_image_props.rc 等 文件
 
 

 

8. 测试 web server
 a. 在besim  服务器 /usr/local/apache2/htdocs/  目录下新建 a.txt
 b.把 test.php 文件放到 support 下,test.php 代码如下:
 
 c.新建  test.html 并放在 supports/templates/ 目录下
代码如下
       <{$test}>
 d. 如果显示”open remote web server ok”代表成功配置web server
 
9. Service iptables stop 去掉防火墙

 

 

Client设置 client 可以是Prime Client

 

Prime client/Client  192.168.0.10

1.安装Spec web 软件,修改 start_client.bat ,start_prime_client.bat
       set JAVA ="C:\Program Files\Java\jre6\bin\java.exe“
2.将SPECweb_Banking.Unix-PHP.config       更改为  SPECweb_Banking.config
          SPECweb_Ecommerce.Unix-PHP.config 更改为  SPECweb_Ecommerce. Config
          SPECweb_Power.Unix-PHP.config           更改为  SPECweb_Power. Config
          SPECweb_Support.Unix-PHP.config       更改为  SPECweb_Support. config
          Test.Unix-PHP.config  更改为  Test.config
3.修改 SPECweb_(X).config
PADDING_DIR = "/var/www/html/bank/dynamic_padding/“
PADDING_DIR = "/var/www/html/ecommerce/dynamic_padding/“
PADDING_DIR = "/var/www/html/support/dynamic_padding/“
4.修改 test.config
CLIENTS =192.168.0.10
SIMULTANEOUS_SESSIONS =1
WEB_SERVER =192.168.0.3
WEB_PORT =80
BESIM_SERVER =192.168.0.2
BESIM_PORT = "80“
BESIM_INIT_SCRIPT = "/fcgi-bin/besim_fcgi.fcgi" # FCGI
SMARTY_DIR =  "/var/www/html/Smarty/"
SMARTY_BANK_DIR = "/var/www/html/bank/"
SMARTY_ECOMMERCE_DIR = "/var/www/html/ecommerce/"
SMARTY_SUPPORT_DIR =  "/var/www/html/support/
5.配置完成运行测试
 start_client.bat
 start_prime_client.bat
 
 
运行效果如图,下例模拟600 Session 同时访问 ,测试需要根据系统配置,修改Test.Config 里面的SIMULTANEOUS_SESSIONS 值,使得跑出来的结果 Qos  Time_Good >95% Time_Tolerable >99%。
 
 

 

 

 

 

 

 

你可能感兴趣的:(Spec Web 2009 web服务器测试)