1、安装jdk

   #chmod u+x jdk-6u4-linux-x64.bin
   #./jdk-6u4-linux-x64.bin
   按‘q’键,输入yes在当前目录下会产生一个jdk1.6.0_04的目录
   #mv jdk1.6.0_04 /usr/local/
   配置环境变量
   #vim /etc/profile
   加入
   JAVA_HOME=/usr/local/jdk1.6.0_04
   export JAVA_HOME
   CLASSPATH=/usr/local/jdk1.6.0_04/lib:/usr/local/jdk1.6.0_04/jre/lib  
   export CLASSPATH 
   PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin  
   export PATH  
   JRE=/usr/local/jdk1.6.0_04/jre  
   export JRE 
   #source /etc/profile
   查看
   #java -vejava 
   version "1.6.0_04"
   Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
   Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)
   表示成功!

2、安装apache-tomcat

   #wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.16/bin/apache-tomcat-6.0.16.tar.gz
   #tar xzvf apache-tomcat-6.0.16.tar.gz
   #mv apache-tomcat-6.0.16 /usr/local/
   配置环境变量
   #vim /etc/profile
   TOMCAT_HOME=/usr/local/apache-tomcat-6.0.16
   export TOMCAT_HOME 
   #source /etc/profile
   启动
   #/usr/local/apache-tomcat-6.0.16/bin/startup.sh
   默认启动端口在8080上

3、配置nginx实现同时解析jsp和php文件

   #cat /usr/local/nginx/conf/vhosts/www.test.com.conf
   server
   {
    listen 80;
    server_name www.test.com;
    index index.html index.htm index.php;
    root  /data/httpd/channel.metromall.com.cn;
    if (!-e $request_filename) {
               rewrite ^/(.+\.(html|xml|json|htm|php|asp|shtml))$ /index.php?$1 last;
    }location ~ .*\.php.*
    {
        include php_fcgi.conf;
        include pathinfo.conf;
    }
    
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }
        
    location ~ .*\.(js|css)?$
    {
        expires      1h;
    }
    access_log /var/log/nginx/access.log;
    #access_log off;
   }

 

爱慕尔商城欢迎您的光临!
穿衣打扮  
城市物语