tomcat+nginx+mysql+jdk 環境搭建

來源:互聯網
上載者:User

標籤:

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 環境搭建

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.