**系統搭建

whyun1984發表於2013-11-08


1、總體架構nginx+tomcat

mkdir -pv /home/source/img0.bbbb.com/
mkdir -pv /home/source/img1.bbbb.com/
mkdir -pv /home/source/img2.bbbb.com/
mkdir -pv /home/source/img3.bbbb.com/
mkdir -pv /home/source/img4.bbbb.com/
mkdir -pv /home/source/img5.bbbb.com/
mkdir -pv /home/source/js.bbbb.com/
mkdir -pv /home/source/css.bbbb.com/
mkdir -pv /home/source/html.bbbb.com/
mkdir -pv /home/source/trailer/
?
img0.aaaa.com 指向目錄路徑: /home/source/img0.bbbb.com/
img1.aaaa.com 指向目錄路徑: /home/source/img1.bbbb.com/
img2.aaaa.com 指向目錄路徑: /home/source/img2.bbbb.com/
img3.aaaa.com 指向目錄路徑: /home/source/img3.bbbb.com/
img4.aaaa.com 指向目錄路徑: /home/source/img4.bbbb.com/
img5.aaaa.com 指向目錄路徑: /home/source/img5.bbbb.com/
js.aaaa.com 指向目錄路徑: /home/source/js.bbbb.com/
css.aaaa.com 指向目錄路徑: /home/source/css.bbbb.com/
html.aaaa.com 指向目錄路徑: /home/source/html.bbbb.com/
v.aaaa.com 指向目錄路徑: /home/source/trailer/
cd /usr/local/nginx/conf
tail nginx.conf
include conf.d/*.conf;

cd conf.d
ls
css.bbbb.conf       image.bbbb.com.conf  img3.bbbb.com.conf  proxy.conf
bbbb.com.conf       img0.bbbb.com.conf   img4.bbbb.com.conf  v.bbbb.conf
bbbbinema.com.conf  img1.bbbb.com.conf   img5.bbbb.com.conf  web.conf
html.bbbb.com.conf  img2.bbbb.com.conf   js.bbbb.conf
cat bbbbinema.com.conf
server
{
        listen 8084;
        server_name www.bbbbinema.com www.aaaa.com.cn;
        index index.html index.jsp index.htm;
        root  /home/tomcatRoot/www.bbbbinema.com;

        charset utf-8;

        location ~* "\.(jsp|do)$" {
        proxy_pass http://192.168.0.37:8083;
        }

        location ~* {
        proxy_pass http://192.168.0.37:8083;
        }

        location ~* "\.(jpg|jpeg|png|gif|html|css)$" {
        expires 30d;
        }

}
cat img0.bbbb.com.conf
server
{
        listen 8084;
        server_name img0.aaaa.com;
        root  /home/source/img0.bbbb.com;
        location ~* "\.(jpg|jpeg|png|gif|html|css)$" {
        expires 30d;
        }
}

cat v.bbbb.conf
server
{
        listen 8084;
        server_name v.aaaa.com;
        root  /home/source/trailer;
        location ~* "\.(js|css|flv)$" {
        expires 30d;
        }
}

1、nginx
tar -xvf pcre-8.33.tar.gz
cd pcre-8.33
./configure
make && make install
tar -xvf nginx-1.5.4.tar.gz
cd nginx-1.5.4
./configure --with-http_stub_status_module --with-http_ssl_module
make && make install


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26972107/viewspace-776103/,如需轉載,請註明出處,否則將追究法律責任。

相關文章