将文件都下载到/mnt下
# ls
jboss-5.1.0.GA-jdk6.zip
jdk-6u27-linux-x64-rpm.bin
MySQL-client-community-5.1.51-1.rhel5.x86_64.rpm
MySQL-server-community-5.1.51-1.rhel5.x86_64.rpm
nginx-1.0.8.tar.gz
# sh jdk-6u27-linux-x64-rpm.bin
# unzip jboss-5.1.0.GA-jdk6.zip
# mv jboss-5.1.0.GA /usr/local/jboss
# vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.6.0_27/
export CLASSPATH=$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:/usr/local/nginx/sbin
export JBOSS_HOME=/usr/local/jboss
# source /etc/profile
# yum -y install pcre-devel gcc openssl-devel zlib-devel make
# tar xf nginx-1.0.8.tar.gz
# cd nginx-1.0.8
注释掉此文件的以下两行,编译出来会很小
# vim auto/cc/gcc
# debug
#CFLAGS="$CFLAGS -g"
# useradd -M -s /sbin/nologin
# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
# make && make install
以下是nginx.conf 里的有效配置文件
# egrep -v "^$|#" /usr/local/nginx/conf/nginx.conf
- user www www;
- worker_processes 4;
- events {
- worker_connections 65535;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- tcp_nopush on;
- keepalive_timeout 65;
- server {
- listen 80;
- server_name 192.168.1.6;
- root /usr/local/nginx/html/;
- location ~* \.(jpg|gif|png|swf|flv|wma|wmv|asf|mp3|mmf|zip|rar)$ {
- root /usr/local/nginx/html/;
- expires 30d;
- }
- location ~ (\.jsp)|(\.do)$ {
- proxy_pass
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 10m;
- client_body_buffer_size 128k;
- proxy_connect_timeout 90;
- proxy_send_timeout 90;
- proxy_read_timeout 90;
- proxy_buffer_size 4k;
- proxy_buffers 4 32k;
- proxy_busy_buffers_size 64k;
- proxy_temp_file_write_size 64k;
- }
- }
- server
- {
- listen 8081;
- server_name 192.168.1.6:8081;
- location / {
- stub_status on;
- access_log off;
- }
- }
- }
# vim /usr/local/jboss/server/web/deploy/jbossweb.sar/server.xml
connectionTimeout="20000" redirectPort="8443" />
# cd /usr/local/jboss/server/web/deploy/ROOT.war/
# vim index.jsp
s: <%= new java.util.Date() %>
依次启动jboss 和 nginx 即可
# /usr/local/jboss/bin/run.sh -c web &
# nginx
ps:
这里写几条nginx的常见命令,避免忘记!
nginx -t 检测配置文件的正确性,如果不是在默认目录,需要加 -c 指定文件
nginx -v 查看nginx版本
nginx -V 看看nginx版本及编译参数
参考此书
阅读(3297) | 评论(0) | 转发(0) |