linux下安装jdk
1、 下载jdk-6u21-linux-i586-rpm.bin
2、 上传到linux
3、 sh jdk-6u21-linux-i586-rpm.bin 直到安装完成
4、 默认安装在/usr/java目录下
5、 vi /etc/profile
添加下面的内容:
export JAVA_HOME=/usr/java/jdk1.6.0_21
export JAVA_BIN=/usr/java/jdk1.6.0_21/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
6、 进入 /usr/bin/目录
cd /usr/bin
ln -s -f /usr/java/jdk1.6.0_21/jre/bin/java
ln -s -f /usr/java/jdk1.6.0_21/bin/javac
7、 在命令行输入
java –version
输出
over,安装成功
linux下安装resin
1、 tar
2、 ./configure –prefix=/usr/local/resin
3、 Make && make install
4、 配置resin为系统服务
Vi /etc/rc.d/rc.local
===加入如下代码=====
sh /usr/local/resin/bin/resin.sh start
resin admin:
1、访问:http://192.168.1.107/resin-admin/index.php
即可进入admin的页面,首次使用需要注册,同时会在conf目录下生成一个类似admin-users.xml的文件,修改名字去掉后缀
2、vi resin.xml,修改为下图所示
3、从新访问页面,输入刚才注册的username and password即可进入
linux下安装nginx
1、 先安装pcre
Tar
./configure
Make && make install
2、 安装nginx
Tar
./configure --prefix=/usr/local/nginx
Make && make install
Vi /etc/rc.d/init.d/nginx
======粘贴如下代码,配置为自启动服务====
#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# this script create it by gcec at 2009.10.22.
# it is v.0.0.1 version.
# if you find any errors on this scripts,please contact gcec cyz.
# and send mail to support at gcec dot cc.
#
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /var/run/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/var/run/nginx.pid
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
if [ -e $nginx_pid ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/nginx
return $RETVAL
}
# Stop nginx daemons functions.
stop() {
echo -n $"Stopping $prog: "
killproc $nginxd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid
}
# reload nginx service functions.
reload() {
echo -n $"Reloading $prog: "
#kill -HUP `cat ${nginx_pid}`
killproc $nginxd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|status|help}"
exit 1
esac
exit $RETVAL
==========结束,退出vi=========
1、 让nginx有可执行的权限
chmod +x nginx
6、将nginx加入到服务当中
chkconfig --add nginx
配置nginx的运行级别,让其可以在系统启动的时候跟着启动
chkconfig --level 35 nginx on
7、我们可以通过以下命令来操作nginx
启动:service nginx start
关闭:service nginx stop
重起:service nginx restart
配置nginx转发请求给resin
修改nginx的配置文件nginx.conf(cd /usr/local/nginx/conf)
程序代码
server {
listen 80;
server_name localhost;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
access_log on;
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
}
}