<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                首先,安裝uwsgi,命令`pip3 install uwsgi`; 在nginx.conf配置文件中,`http{}`的最后加上一行: ~~~ include vhost/*.conf; ~~~ 目的是引入vhost文件夾下的配置文件; 在**nginx.conf**同目錄下創建**vhost**文件夾,用來專門存放你的各種項目應用的配置文件。 * * * * * 假設你已經創建好了Django應用,名字叫‘djangoceshi’;在**vhost**文件夾下新建**djangoceshi.conf**文件,內容: ~~~ upstream djangoceshi { server unix:///tmp/djangoceshi.sock; } server { listen 80; server_name djangoceshi.xzwphp.com; access_log /data/wwwlogs/djangoceshi.xzwphp.com_nginx.log combined; index index.html index.htm index.py; #include /usr/local/nginx/conf/rewrite/djangoceshi.conf; charset utf-8; client_max_body_size 75M; location /media { alias /data/wwwroot/djangoceshi/media; } location /static { alias /data/wwwroot/djangoceshi/static; } location / { uwsgi_pass djangoceshi; include uwsgi_params; } } ~~~ * `#include /usr/local/nginx/conf/rewrite/djangoceshi.conf;`這一行引入的是你的**dangoceshi**的路由規則,我在這里注釋掉了。 * `server_name djangoceshi.xzwphp.com;`這一行是你解析到服務器ip的域名。 * `charset utf-8;`指定編碼。 * `client_max_body_size 75M;`指定最大上傳尺寸。 * `alias /data/wwwroot/djangoceshi/media;`指定你的媒體文件目錄。 * `alias /data/wwwroot/djangoceshi/static;`指定你的項目的靜態資源文件目錄,css,js等。 * * * * * 運行命令`nginx -t`,查看配置是否有語法錯誤;然后再輸入命令‘nginx -s reload’使修改的配置生效。 * * * * * 在你的項目所在文件夾,和**manage.py**同目錄,創建djangoceshi.ini文件,內容: ~~~ [uwsgi] chdir = /data/wwwroot/djangoceshi module = djangoceshi.wsgi master = true processes = 10 socket = /tmp/djangoceshi.sock chmod-socket = 664 vacuum = true daemonize=/data/nginx/wsgilogs/djangoceshi.log ~~~ * `module = djangoceshi.wsgi`引入你項目的wsgi.py文件。 * `chdir = /data/wwwroot/djangoceshi`這里寫上你項目的所在目錄。 * `daemonize=/data/nginx/wsgilogs/djangoceshi.log`記錄你項目的uwsgi的運行記錄,需要先建好文件夾,不然會報錯,找不到目錄,我的文件夾是**/data/nginx/wsgilogs/**。 * * * * * 啟動uwsgi: ~~~ uwsgi --ini /data/wwwroot/djangoceshi/djangoceshi.ini ~~~ 然后訪問域名**djangoceshi.xzwphp.com**,發現不成功,查看記錄文件**djangoceshi.log**發現,報了一個錯誤: ~~~ Sun Dec 4 12:57:43 2016 - *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** ~~~ * * * * * 解決辦法: 創建**www**用戶組和**www**用戶; ~~~ /usr/sbin/groupadd www /usr/sbin/useradd -g www www ~~~ 編輯Nginx的配置文件**nginx.conf**,將第一行修改為`user www www;` 去掉下面兩行注釋: ~~~ #error_log logs/error.log; #pid logs/nginx.pid; ~~~ 在**djangoceshi.ini**文件中添加兩行: ~~~ uid = www gid = www ~~~ 如: ~~~ [uwsgi] uid = www gid = www chdir = /data/wwwroot/djangoceshi ...... ~~~ 再輸入命令`nginx -s reload`使修改**nginx.conf**的配置生效; 啟動uwsgi,`uwsgi --ini /data/wwwroot/djangoceshi/djangoceshi.ini`.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看