標籤:
1、安裝JDK
zrsz 上傳到伺服器安裝 jdk 7u55
2、安裝tomcat
下載tomcat 7
3、安裝nginx
nginx 安裝依賴一下三個包
3.1 openssl-1.0.1c.tar.gz
3.2 pcre-8.36.tar.gz
3.3 zlib-1.2.8.tar.gz
3.4 yum install mhash
3.5 ./configure /configure --prefix=/usr/local/nginx/ --with-http_stub_status_module --with-http_ssl_module --with-openssl=/usr/local/nginx/soft/openssl-1.0.1c (指定openssl 庫的路徑) --with-pcre=../soft/pcre-8.21 --with-zlib=../soft/zlib-1.2.8
groupadd -r nginxuseradd -r -g nginx -s /bin/false -M nginx#注意 \ 前面至少一個有空格./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.21 \ #指向解壓的源碼目錄--with-zlib=../zlib-1.2.8 \ #指向解壓的源碼目錄--with-openssl=../openssl-1.0.1 \ #指向解壓的源碼目錄--with-http_stub_status_module \#啟用 nginx 的 NginxStatus 功能,用來監控 Nginx 的目前狀態--user=nginx --group=nginx
make && make install
3.6 啟動nginx 服務 /usr/local/nginx/nginx/sbin/nginx -c /usr/loacl/nginx/nginx/conf/nginx.conf (/usr/local/nginx/nginx 是nginx的安裝目錄)
重新載入nginx 服務 /usr/local/nginx/nginx/sbin/nginx -s reload
------------------------------------------------------------------------------------
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/local/tomcat/apache-tomcat-7.0.59/webapps/ROOT;(tomcat web存放檔案夾)
index index.html index.htm index.jsp;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
location ~ \.jsp$ {
proxy_pass http://127.0.0.1:8080;(nginx 代理tomcat 8080 連接埠)
}
---------------------------------------------------------------
/usr/local/nginx/sbin/nginx -t 檢查 nginx.conf 設定檔是否正確
4、安裝mysql
安裝rpm Mysql-server 5.5 ; Mysql-client 5.5
/etc/init.d/mysql start (啟動mysql)
/usr/bin/mysqladmin -u root password ‘create password‘ 建立root 密碼
/usr/bin/mysqladmin -u root -p ‘old password‘ password ‘create new password‘ 更改新密碼;
mysql 資料庫初始化 mysql_install_db
tomcat+nginx+mysql+jdk 環境搭建