欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到夢飛科技

服務器租用

當前優惠活動:

Linux下Tomcat+Nginx處事器情況安裝設置的簡明教程

一、安裝
1.安裝JDK
下載的jdk文件為:jdk-6u45-linux-x64.bin,執行如下呼吁舉辦安裝:

#./jdk-6u12-linux-i586.bin

2.安裝tomcat:

#tar zxvf apache-tomcat-6.0.18.tar.gz
#mv apache-tomcat-6.0.29 tomcat

這里我將解壓后的apache-tomcat-6.0.29重定名為了tomcat利便操縱。

3.設置情況變量:
編輯/etc下的profile文件,加上如下內容:

JAVA_HOME="/opt/app/jdk1.6.0_45"
CLASS_PATH="$JAVA_HOME/lib:$JAVA_HOME/jre/lib"
PATH=".:$PATH:$JAVA_HOME/bin"
CATALINA_HOME="/opt/app/tomcat"
export JAVA_HOME CATALINA_HOME

執行下面呼吁使改觀生效:

啟動tomcat并輸入http://domain:8080,假如看到貓的頁面即tomcat和jdk安裝樂成
新建文件目次/home/www為網站存放目次,置server.xml文件,在Host name=”localhost”處將appBase=的指向路徑改為/home/www/web
建設index.jsp至/home/www/web/ROOT,內容為:“hello!”  從頭啟動tomcat,從頭會見,假如看到index.jsp文件內容hello!暗示置樂成。

4.安裝Nginx
執行如下呼吁解壓nginx:

# tar zxvf nginx-1.4.4.tar.gz
# mv nginx-1.4.4 nginx

同樣重定名了一下。
安裝nginx:

# ./configure --prefix=/opt/app/nginx

功效呈現了錯誤:error: C compiler cc is not found,按網上所說安裝編譯源碼所需的東西和庫:

#yum install gcc gcc-c++ ncurses-devel perl

再次安裝,發明尚有錯誤:the HTTP rewrite module requires the PCRE library.
執行

# yum -y install pcre-devel openssl openssl-devel

終于樂成,

# ./configure --prefix=/opt/app/nginx
# make # make install

nginx安裝樂成后的安裝目次為/opt/app/nginx

二、Nginx方面的設置
在/usr/local/目次下別離安裝nginx和tomcat
為nginx添加conf.d目次,用于各項目標設置,好比新建renhetoutiao.conf文件

server {
  listen   80;
  server_name devtoutiao.renhe.cn;
  root    /home/renhetoutiao/renhetoutiao/htdocs;
  access_log /home/renhetoutiao/renhetoutiao/logs/access_log.log;
  location = / {
    rewrite ^/$ /index.shtml last;
  }
  location ~ .shtml {
    proxy_pass http://localhost:8081;
    proxy_set_header  Host  $host;
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
  }
  location ~ .*.(js|css)?$ {
    expires 1h;
  }
}
server {
  listen   80;
  server_name devtoutiao.renhe.cn;
  root    /home/renhetoutiao/renhetoutiao/htdocs;
  access_log /home/renhetoutiao/renhetoutiao/logs/access_log.log;
  location = / {
    rewrite ^/$ /index.shtml last;
  }
  location ~ .shtml {
    proxy_pass http://localhost:8081;
    proxy_set_header  Host  $host;
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
  }
  location ~ .*.(js|css)?$ {
    expires 1h;
  }
}

對nginx的conf/nginx.conf修改,第二行 user root,賦予nginx root權限,在http中添加 include /usr/local/nginx/conf.d/*.conf;
選擇一個項目如renhetoutiao, 目次/home/renhetoutiao/renhetoutiao/

三、Tomcat方面的設置
catalina.policy catalina.properties context.xml tomcat-users.xml server.xml web.xml
這5個設置文件就可以啟動一個tomcat實例,個中server.xml是必需設置的。
catalina.policy catalina.properties web.xml 可以利用默認的,可以從安裝路徑copy,context.xml tomcat-users.xml可以不消。
所以每個項目我們只需要設置server.xml, 如renhetoutiao項目標設置

<?xml version='1.0' encoding='utf-8'?>
<Server port="8015" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
    SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Service name="Catalina">
    <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
        <Context docBase="/home/renhetoutiao/renhetoutiao/web" path="" />
      </Host>
    </Engine>
  </Service>
</Server>
<?xml version='1.0' encoding='utf-8'?>
<Server port="8015" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
    SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Service name="Catalina">
    <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
        <Context docBase="/home/renhetoutiao/renhetoutiao/web" path="" />
      </Host>
    </Engine>
  </Service>
</Server>

夢飛科技 - 全球數據中心基礎服務領先供應商

Copyright © 2003-2019 MFISP.COM. 國外服務器租用 IDC公司 版權所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 长汀县| 巫山县| 凤台县| 钟山县| 阿坝| 辽中县| 中牟县| 睢宁县| 博客| 上思县| 泗洪县| 启东市| 马关县| 南靖县| 琼中| 宝丰县| 奇台县| 巨野县| 嵩明县| 崇明县| 湛江市| 南投市| 磴口县| 晋宁县| 镇沅| 农安县| 寻乌县| 新宁县| 新兴县| 九江县| 云阳县| 美姑县| 镇巴县| 昌都县| 名山县| 九寨沟县| 大埔区| 乐昌市| 安远县| 日喀则市| 郁南县|