时间:2021-07-01 10:21:17 帮助过:78人阅读
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
upstream tomcat_server {
server 127.0.0.1:8080;
}
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 ~ \.(jsp|jspx|do)?$
{
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://tomcat_server;
}
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;
}
作者:yuangang_love
http://www.bkjia.com/PHPjc/478122.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478122.htmlTechArticle1、安装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/ 配置环...