linux下部署項目
『壹』 linux閮ㄧ講鏈嶅姟鍣╨inux閮ㄧ講鏈嶅姟
linux鎬庝箞閮ㄧ講springboot錛
Linux閮ㄧ講springboot欏圭洰錛屼袱縐嶆柟寮
閮ㄧ講jar鍖咃紙瀹樻柟鎺ㄨ崘錛
鍦╨inux鏈嶅姟鍣ㄤ笂榪愯孞ar鏂囦歡鏃墮氬父鐨勬柟娉曟槸錛
$java-jartest.jar
榪欑嶆柟寮忕壒鐐規槸ssh紿楀彛鍏抽棴鏃訛紝紼嬪簭涓姝㈣繍琛.鎴栬呮槸榪愯屾椂娌℃硶鍒囧嚭鍘繪墽琛屽叾浠栦換鍔★紝鏈夋病鏈夊姙娉曡㎎ar鍦ㄥ悗鍙拌繍琛屽憿錛
鏂規硶涓錛
$nohupjava-jartest.jar
//nohup鎰忔濇槸涓嶆寕鏂榪愯屽懡浠,褰撹處鎴烽鍑烘垨緇堢鍏抽棴鏃,紼嬪簭浠嶇劧榪愯
//褰撶敤nohup鍛戒護鎵ц屼綔涓氭椂錛岀己鐪佹儏鍐典笅璇ヤ綔涓氱殑鎵鏈夎緭鍑鴻閲嶅畾鍚戝埌nohup.out鐨勬枃浠朵腑
//闄ら潪鍙﹀栨寚瀹氫簡杈撳嚭鏂囦歡銆
鏂規硶浜岋細
$nohupjava-jartest.jar>temp.txt
//榪欑嶆柟娉曚細鎶婃棩蹇楁枃浠惰緭鍏ュ埌浣犳寚瀹氱殑鏂囦歡涓錛屾病鏈夊垯浼氳嚜鍔ㄥ壋寤
jobs鍛戒護鍜宖g鍛戒護錛
$jobs
//閭d箞灝變細鍒楀嚭鎵鏈夊悗鍙版墽琛岀殑浣滀笟錛屽苟涓旀瘡涓浣滀笟鍓嶉潰閮芥湁涓緙栧彿銆
//濡傛灉鎯沖皢鏌愪釜浣滀笟璋冨洖鍓嶅彴鎺у埗錛屽彧闇瑕乫g+緙栧彿鍗沖彲銆
$fg2
鏌ョ湅鏌愮鍙e崰鐢ㄧ殑綰跨▼鐨刾id
netstat-nlp|grep:8080
鏈嶅姟鍣ㄩ泦緹ゆ庝箞鎼寤猴紵Linux騫沖彴鐨勶紵
linux鏈嶅姟鍣ㄩ泦緹ゅ鉤鍙扮殑鎼寤烘瘮杈冪畝鍗曪紝鏈変笓闂ㄧ殑鍧囪杞浠訛紝姣斿俵vs錛宭vs鏄涓涓闆嗙兢緋葷粺錛岀敱寰堝氭湇鍔″櫒緇勬垚錛屽彲浠ユ牴鎹闇瑕侊紝鎶婂畠闂ㄥ垎涓轟笁灞傦紝涓灞傛槸鍓嶇鏈猴紝鐢ㄤ簬鍧囪錛岀浉褰撲簬鍏騫充負緋葷粺鍒嗛厤宸ヤ綔錛屼簩灞傛槸鏈嶅姟鍣ㄧ兢錛屾瘮濡倃eb鏈嶅姟鍣ㄧ兢錛孌NS錛宮ail緹ょ瓑錛岃繖浜涘氨鏄鎺ュ緟鍛橈紝鎶婂潎琛″櫒鍒嗛厤鐨勫伐浣滆繘琛屽勭悊錛岀涓夊眰鏄瀛樺偍璁懼囷紝鐢ㄤ簬瀛樺偍鏁版嵁錛岀浉褰撲簬妗f堝簱銆傜煡閬撹繖浜涘悗錛岃佹惌寤哄氨闈炲父瀹規槗錛屾湁鐜版垚鐨勮蔣浠訛紝姣斿傛垜鏈夊洓鍙皐eb鏈嶅姟鍣錛2鍙版暟鎹搴擄紝1鍙板墠緗鏈猴紝瀹夎卨inux緋葷粺錛屽畨瑁卨vs杞浠訛紝姣斿俬eartbeat-2.1.4-9.el5.i386.rpmheartbeat-ldirectord-2.1.4-9.el5.i386.rpmlibnet-1.1.4-3.el5.i386.rpmheartbeat-devel-2.1.4-9.el5.i386.rpmheartbeat-pils-2.1.4-10.el5.i386.rpmperl-MailTools-1.77-1.el5.noarch.rpmheartbeat-gui-2.1.4-9.el5.i386.rpmheartbeat-stonith-2.1.4-10.el5.i386.rpm褰撶劧榪橀渶瑕侀厤緗錛屼綘鍙浠ヨ嚜宸辯櫨搴︽湁鍏砽vs闆嗙兢鐨勮︾粏瀹夎呰存槑銆傚笇鏈涜兘甯鍔╀綘銆
涓姝ヤ竴姝ユ暀浣犳灦鏋刲inux鏈嶅姟鍣錛
Linux鏈嶅姟鍣ㄧ殑閮ㄧ講錛岄厤緗錛屾惌寤烘ラわ細
1.鍑嗗囷細
1.1.jdk1.8錛歫dk-8u11-linux-x64.tar.gz銆
tomcat錛歛pache-tomcat-8.0.39-windows-x64.zip銆
1.2.鍏堝畨瑁呬釜1.8鐨刯dk錛屾敞鎰忔槸linuxforjdk錛岃佷笉鐒跺彲涓嶈屻
鐒跺悗鏂板緩涓涓猨ava鏂囦歡澶瑰湪鏍圭洰褰曠殑錛堣繖閲岀殑鏍圭洰褰曡侀氳繃cd鍐嶆帴/usr/榪涘叆錛岃屼笉鏄痟ome/xxx錛屽彲浠ラ氳繃pwd鏌ョ湅褰撳墠鎵鍦ㄨ礬寰勶級/usr/涓嬶紝鐢ㄦ潵鏀劇疆瑙e帇鍚庣殑jdk鏂囦歡錛岃繖閲屽洜涓哄悗緙鍚嶆槸tar.gz鎵浠ョ洿鎺ョ敤tar-xf鍛戒護瑙e帇銆
2.閰嶇疆錛
2.1.閰嶇疆JDK鐨勭幆澧冨彉閲忥細鍒/etc/鏂囦歡澶規壘鍒皃rofile鏂囦歡錛岄氳繃鏂囦歡緙栬緫鍛戒護viprofile鍦ㄦ枃浠剁殑鏈灝懼姞涓婂彉閲忓弬鏁幫細
JAVA_HOME=/usr/java/jdk1.8.0_11
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
2.2.鎶婁笅濂界殑tomcat瑙e帇鍒拌嚜瀹氫箟鐨勪竴涓鏂囦歡澶歸噷浜嗭紝鎴戠殑鏄痟ome/pengyy/tomcat/涓嬶紝鍒癱onfig鏂囦歡閲屼慨鏀逛竴涓嬬鍙e彿,vi鍛戒護緙栬緫server.xml錛岄噷闈㈠悗鏉ュ惎鍔ㄧ殑鏃跺8005閭d釜絝鍙f湁鍐茬獊錛屾垜鐩存帴鏀逛簡8088錛岀劧鍚庡張鎶奾ttp璇鋒眰鐨勭鍙f敼鎴愪簡8001錛孫K錛宼omcat閰嶇疆瀹屾垚錛屾病浠涔堣繃澶氱殑姝ラゃ
2.3.灝嗕竴涓瀹屾垚鐨剋eb欏圭洰鎵撴垚war鍖咃紝鏀懼湪tomcat涓嬬殑webapps閲岃В鍘嬨
2.4.榪涘叆鍒皌omcat涓嬬殑bin鐩褰曪紝杈撳叆鍛戒護鍚鍔錛./start.sh錛岀粓姝㈠懡浠./shutdown.sh銆
鍙浠ユ煡鐪嬫棩蹇楋紝鍘籺omcat鐨刲ogs鐩褰曞簳涓嬫煡鐪媍atalina.out鏃ュ織鏂囦歡錛屽彲浠ラ氳繃cat鏌ョ湅鏂囦歡鍛戒護錛屼篃鍙浠tail-f(鍊掓暟澶氬皯琛屽彲浠ヤ負鏁板瓧)catalina.out鏉ユ煡鐪嬨
濡傛灉絝鍙e彿琚鍗犵敤錛屽彲浠ョ敤鍛戒護lsof-i:絝鍙e彿鏉ユ煡鐪嬬鍙e彿琚鍗犵敤鐨勮繘紼嬪彿錛屾垨鑰呭仠姝㈣ヨ繘紼嬶紝鎴栬呬慨鏀箃omcat鐨勭鍙e彿閮藉彲浠ャ
鑰屽綋浣犱笉紜瀹氭槸鍚︾粓姝浜嗗摢涓欏圭洰鐨勬椂鍊欙紝鍙浠ラ氳繃杈撳叆鍛戒護ps-ef|grepjava鏉ユ煡鐪嬩竴涓嬫槸鍚︽湁鍦ㄨ繍琛岀殑欏圭洰錛岄氳繃kill-9榪涚▼鍙峰氨鍙浠ュ共鎺夊摢涓姝e湪榪愯岀殑欏圭洰浜嗐
鏈鍚庨氳繃ifconfig鎴栬卛p鍛戒護鑾峰彇鉶氭嫙鏈虹殑Ip鍦板潃錛屽湪涓繪満涓婇氳繃ip+絝鍙e彿+欏圭洰鏍硅礬寰勭殑鏂瑰紡璁塊棶鍗沖彲銆
linux鎬庝箞鎼寤簑eb鏈嶅姟鍣錛
web鏈嶅姟鍣ㄧ殑綆鍗曟惌寤1銆佸畨瑁呬竴涓鍙浠ユ彁渚泈eb鏈嶅姟鐨勮蔣浠秠um-yinstallhttpd2銆佸惎鍔╤ttpd鏈嶅姟systemctlstarthttpd3銆佽繘鍏ヤ富閰嶇疆鏂囦歡vim/etc/httpd/conf/httpd.conf鍦ㄦよ寖鍥村唴娣誨姞鎴栧垹闄よ劇疆錛屼負浜嗘柟渚跨紪鍐欙紝緙栬緫浜嗕竴涓瀛愰厤緗鏂囦歡/etc/httpd/conf.d/httpd-vhosts.conf4銆佺紪杈戝瓙閰嶇疆鏂囦歡vim/etc/httpd/conf.d/httpd-vhosts.conf姝よ礬寰勫繀涓篶onf.d/*.conf(鎰忥細涓.conf鍚庣紑鍛藉悕)systemctlrestarthttpd閲嶅惎鏈嶅姟5銆佺紪杈戦〉闈㈡祴璇曟枃浠跺湪web鏈嶅姟涓榛樿ゅ瓨鏀劇綉欏墊枃浠剁殑璺寰勶細/var/chaodiquan.com/html榛樿ょ綉欏墊枃浠跺悕瀛楋細index.html6銆佹祻瑙堝櫒嫻嬭瘯ifconfigens33鏌ョ湅ens33緗戝崱鐨勫湴鍧鍦ㄦ祻瑙堝櫒閲岄潰杈撳叆浣犵殑IP灝卞彲浠ョ湅鍒版祴璇曟枃浠墮噷甯屾湜鍙浠ュ府鍔╁埌鐨勫搱錛
『貳』 如何在Linux下使用Tomcat部署Web應用
一般都在windows下開發的,現在部署到linux下:1,將項目達成war包(用eclipse,項目右鍵--Export--選擇warfile)2,將tomcat(用winSCP當然你也可以用secureCRT,用securCRT需要建立sftp(即上傳文件的目錄),用puttomcat命令)考到ilunx對應的目錄下3,然後將項目的war包放到tomcat的webapps目錄下4,啟動tomcat(命令:./startup.sh(linux下啟動tomcat是.sh文件而非.bat文件))遇到問題如下:運行./startup.sh是報錯-bash:./startup.sh:Permissiondenied原因:沒有運行.sh的許可權解決:chmod777*.sh755代表用戶對該文件擁有讀,寫,執行的許可權,同組其他人員擁有執行和讀的許可權,沒有寫的許可權,其他用戶的許可權和同組人員許可權一樣。777代表,user,group,others,都有讀寫和可執行許可權。獲得許可權後再運行./startup.sh命令時報錯:原因:該文件需要一個運行環境(即配置jdk環境變數)解決:JAVA_HOME=/usr/java/jdk1.6.0_25/(當然這個目錄根據自己的jdk安裝目錄)然後在運行./startup.sh提示:UsingCATALINA_BASE:/usr/local/sarft/apache/apache-tomcat-6.0.29UsingCATALINA_HOME:/usr/local/sarft/apache/apache-tomcat-6.0.29UsingCATALINA_TMPDIR:/usr/local/sarft/apache/apache-tomcat-6.0.29/tempUsingJRE_HOME:/usr/java/jdk1.6.0_25/UsingCLASSPATH:/usr/local/sarft/apache/apache-tomcat-6.0.29/bin/bootstrap.jar如果提示以上信息表明tomcat啟動成功!大功告成,運行項目,正常跑起!PS:這個應該屬於很初級的,不過對於本人來說,畢竟是第一次,從發現問題,到解決問題也許到了一些。
『叄』 Linux涓嬪皢python鐨凞jango欏圭洰閮ㄧ講鍒癆pache鏈嶅姟鍣
榪欏嚑澶╄姳浜嗙偣鏃墮棿,灝嗘妸django寮鍙戝ソ鐨剋eb欏圭洰閮ㄧ講鍒癆pache涓婏紝鍙傝冧簡瀹樻柟鐨勪竴浜涙枃妗e拰浜掕仈緗戜笂鐨勬枃妗o紝榪樻槸鑺變簡姣旇緝澶氱殑鏃墮棿錛岃繖閲屾妸閰嶇疆鐨勮繃紼嬭翠竴涓嬨
鏂逛究鏈夐渶瑕佺殑鏈嬪弸錛屽彲浠ュ弬鑰冿紝灝戣蛋寮璺!
1. django欏圭洰閮ㄧ講鐜澧冭存槑
鎿嶄綔緋葷粺 : Red Hat Enterprise Linux Server release 5.3 (Tikanga) x86_64
apache鐗堟湰 : httpd-2.2.3-22.el5
mod_wsgi鐗堟湰 : mod_wsgi-3.2-1.el5 fedora epel鍙浠ヤ笅杞
Django鐗堟湰 : 1.2.3
python 鐗堟湰 : 2.5
榪欓噷鍋囧畾Django鍜孉pache宸茬粡瀹夎呭ソ錛屽苟涓擠jango鐨勯」鐩宸茬粡寮鍙戝ソ銆
浠ヤ笂杞浠跺寘閮芥槸閫氳繃yum鍖呭畨瑁,杞浠跺寘閮芥槸緋葷粺鏍囧噯鐩褰曠粨鏋!
django寮鍙戝ソ鐨勯」鐩鐩褰曟槸 /var/www/html/server,欏圭洰鐩褰曠粨鏋勫備笅(鏍囧噯django欏圭洰鐩褰曠粨鏋)
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#tree -d server/
server/
|-- __init__.py
|-- manage.py
|-- settings.py
|-- backend
|-- static
| |-- images
| |-- locale
| |-- plugins
| `-- themes
| |-- default
| | `-- images
| |-- gray
| | `-- images
| `-- icons
|-- template
`-- view
2. Apache鍜宮od_wsgi閰嶇疆
淇鏀箇sgi閰嶇疆(/etc/httpd/conf.d/wsgi.conf)
?
1
2
3
4
5
6
7
8
#cat /etc/httpd/conf.d/wsgi.conf
LoadMole wsgi_mole moles/mod_wsgi.so
WSGIScriptAlias / "/var/www/html/server/django.wsgi"
Directory "/var/www/html/server"
Order Deny,Allow
Allow from all
/Directory
欏圭洰鐩褰曚腑鐨刣jango.wsgi榪欎釜鏂囦歡鏄闇瑕佹柊寤虹殑錛屽悗闈浼氳村埌濡備綍鏂板緩榪欎釜鏂囦歡銆
apache浣跨敤鐨勬爣鍑嗛厤緗,Apache鐨凞ocumentRoot 鎸囧悜鐨勬槸 /var/www/html 鐩褰
3. 鏂板緩django.wsgi鏂囦歡
鍦ㄩ」鐩鐩褰/var/www/html/server涓嬫柊寤轟竴涓猟jango.wsgi錛屾枃浠跺唴瀹瑰備笅:
?
1
2
3
4
5
6
7
8
9
10
#cat /var/www/html/server/django.wsgi
# -*- coding: utf-8 -*-
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
os.environ['PYTHON_EGG_CACHE'] = '/tmp/.python-eggs'
current_dir = os.path.dirname(__file__)
if current_dir not in sys.path: sys.path.append(current_dir)
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
絎涓夎 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' 錛岃繖涓猻ettings灝辨槸鎸囬」鐩鐩褰曚笅鐨剆etting.py鏂囦歡.
絎鍥涜 os.environ['PYTHON_EGG_CACHE'] = '/tmp/.python-eggs' 錛屾寚瀹氳В鍘媏gg鏂囦歡鐨刢ache鐩褰曪紝紜淇濊繍琛宎pache鐨勭敤鎴鳳紝鑳藉熷規ょ洰褰曟湁璇誨啓鏉冮檺.
絎浜旓紝鍏琛 灝嗗綋鍓嶇洰褰曡嚜鍔ㄥ姞鍏ュ埌python鐨勬悳緔㈣礬寰,濡傛灉欏圭洰涓鏈夎嚜宸卞啓鐨勬ā鍧楋紝鏂逛究浣跨敤鍜屽彂甯
鏈鍚庯紝榪欎釜django.wsgi鏂囦歡鍚嶅彲浠ラ殢渚垮彇錛屼緥濡倀est.wsgi銆乤pp.wsgi絳夌瓑錛屼絾鏄涓瀹氳佷笌/etc/httpd/conf.d/wsgi.conf閰嶇疆鏂囦歡涓閰嶇疆淇濇寔涓鑷淬
濡傛灉鎮ㄨ繖閲屾柊寤虹殑鏂囦歡鍚嶄笉鏄痙jango.wsgi鑰屾槸test.wsgi錛岄偅涔/etc/httpd/conf.d/wsgi.conf涓鐨勯厤緗灝卞簲璇ヤ慨鏀逛負
?
1
WSGIScriptAlias / "/var/www/html/server/test.wsgi"
4. 淇鏀筪jango欏圭洰涓鐨剆etting.py鏂囦歡
鎵懼埌欏圭洰鐩褰曚笅鐨剆etting.py錛屽逛簬榪欓噷灝辨槸/var/www/html/server/setting.py銆傛壘鍒板叾涓鐨凾EMPLATE_DIRS錛屼慨鏀逛負錛
?
1
TEMPLATE_DIRS = ("/var/www/html/server/template",)
娉ㄦ剰: 妯℃澘鐩褰曞湪榪欓噷涓瀹氳佺敤緇濆硅礬鍔詫紝鑰屼笉鑳界敤鐩稿硅礬寰,褰撶劧涔熸湁鏂規硶鍔ㄦ佽劇疆妯℃澘璺鍔
PS錛氬叧浜巑od_wsgi
鐩鍓峬od_wsgi鏈変袱縐嶅伐浣滄ā寮忥細
絎涓縐嶆槸宓屽叆妯″紡錛岀被浼間簬mod_python錛岀洿鎺ュ湪apache榪涚▼涓榪愯岋紝榪欐牱鐨勫ソ澶勬槸涓嶉渶瑕佸彟澶栧炲姞榪涚▼錛屼絾鏄鍧忓勪篃寰堟槑鏄撅紝鎵鏈夊唴瀛橀兘鍜宎pache鍏變韓錛屽傛灉鍜宮od_python涓鏍烽犳垚鍐呭瓨婕忔礊鐨勮瘽錛屽氨浼氬嵄瀹蟲暣涓猘pache銆傝屼笖濡傛灉apache鏄鐢╳orker mpm錛宮od_wsgi涔熷氨寮哄埗榪涘叆浜嗙嚎紼嬫ā寮忥紝榪欐牱瀛愬逛簬闈炵嚎紼嬪畨鍏ㄧ殑紼嬪簭鏉ヨ村氨娌℃硶鐢ㄤ簡銆
榪欑嶆ā寮忎笅闇瑕佸湪apache鐨剉host涓濡備笅璁劇疆錛
?
1
span style="font-family: 'times new roman', times;"WSGIScriptAlias /path /path-to-wsgi/span
鍗沖彲鐢熸晥錛屽逛簬灝忓瀷鑴氭湰鐨勮瘽錛岀洿鎺ョ敤榪欑嶆ā寮忓嵆鍙銆
絎浜岀嶆槸鍚庡彴妯″紡錛岀被浼間簬FastCGI鐨勫悗鍙幫紝mod_wsgi浼氬焌pache鐨勫栧3錛屽彟澶栧惎鍔ㄤ竴涓鎴栧氫釜榪涚▼錛岀劧鍚庨氳繃socket閫氫俊鍜宎pache鐨勮繘紼嬭仈緋匯
榪欑嶆柟寮忓彧瑕佷嬌鐢ㄤ互涓嬮厤緗鍗沖彲錛
?
1
2
3
4
5
6
7
8
9
10
#鍚鍔╓SGI鍚庡彴錛宻ite1鏄鍚庡彴鍚嶅瓧
WSGIDaemonProcess site1 processes=1 threads=15 display-name=%{GROUP}
#鍒嗛厤褰撳墠涓婁笅鏂囧簲璇ヤ嬌鐢ㄥ摢涓猈SGI鍚庡彴錛屽彲浠ユ斁鍦↙ocation閲岄潰鎸囧畾
WSGIProcessGroup site1
#鏍規嵁褰撳墠涓婁笅鏂囩殑ProcessGroup鍒嗛厤鍒板瑰簲鐨勫悗鍙
WSGIScriptAlias /path /path-to-wsgi
鍦ㄨ繖縐嶆ā寮忎笅錛屾垜浠鍙浠ラ氳繃璋冭妭processes鍜宼hreads鐨勫兼潵璁劇疆涓夌峂PM鐨勬ā寮忥細prefork', 'worker', 'winnt'銆
winnt妯″紡
?
1
2
3
WSGIDaemonProcess example threads=25
wsgi.multithread True
wsgi.multiprocess False
姝ゆ椂processes=1錛屼絾鏄痬ultiprocess涓篺alse
濡傛灉鏄懼紡鍦版寚鍑簆rocesses涓1閭d箞錛
?
1
2
3
WSGIDaemonProcess example processes=1 threads=25
wsgi.multithread True
wsgi.multiprocess True
worker妯″紡
?
1
2
3
4
WSGIDaemonProcess example processes=2 threads=25
wsgi.multithread True
wsgi.multiprocess True
preforker妯″紡
?
1
2
3
WSGIDaemonProcess example processes=5 threads=1
wsgi.multithread False
wsgi.multiprocess True
鍚庡彴妯″紡鐢變簬鏄涓巃pache榪涚▼鍒嗙諱簡錛屽唴瀛樼嫭絝嬶紝鑰屼笖鍙浠ョ嫭絝嬮噸鍚錛屼笉浼氬獎鍝峚pache鐨勮繘紼嬶紝濡傛灉浣犳湁澶氫釜欏圭洰(django)錛屽彲浠ラ夋嫨寤虹珛澶氫釜鍚庡彴鎴栬呭叡鍚屼嬌鐢ㄤ竴涓鍚庡彴銆
姣斿傚湪鍚屼竴涓猇irtualHost閲岄潰錛屼笉鍚岀殑path瀵瑰簲涓嶅悓鐨刣jango欏圭洰錛屽彲浠ュ悓鏃朵嬌鐢ㄤ竴涓狣aemon錛
?
1
2
3
4
5
6
7
span style="font-family: 'times new roman', times;"WSGIDaemonProcess default processes=1 threads=1 display-name=%{GROUP}
WSGIProcessGroup default
WSGIScriptAlias /project1 鈥/home/website/project1.wsgi鈥
WSGIScriptAlias /project2 鈥/home/website/project2.wsgi鈥/span
榪欐牱瀛愪袱涓猟jango閮戒嬌鐢ㄥ悓涓涓猈SGI鍚庡彴銆
涔熷彲浠ユ妸涓嶅悓鐨勯」鐩鍒嗗紑錛屽垎寮浣跨敤涓嶅悓鐨勫悗鍙幫紝榪欐牱寮閿姣旇緝澶э紝浣嗗氨涓嶄細鑰﹀悎鍦ㄤ竴璧蜂簡銆
display-name鏄鍚庡彴榪涚▼鐨勫悕瀛楋紝榪欐牱鏂逛究閲嶅惎瀵瑰簲鐨勮繘紼嬶紝鑰屼笉闇瑕佸叏閮ㄦ潃鎺夈
?
1
2
3
4
5
6
7
8
9
10
11
12
13
span style="font-family: 'times new roman', times;"WSGIDaemonProcess site1 processes=1 threads=1 display-name=%{GROUP}
WSGIDaemonProcess site2 processes=1 threads=1 display-name=%{GROUP}
Location 鈥/project1鈥
WSGIProcessGroup site1
/Location
WSGIScriptAlias /project1 鈥/home/website/project1.wsgi鈥
Location 鈥/project1鈥
WSGIProcessGroup site2
/Location
WSGIScriptAlias /project2 鈥/home/website/project2.wsgi鈥/span
瀵逛簬django 1.0浠ヤ笅鐨勭増鏈錛岀敱浜庡畼鏂硅ゅ畾涓嶆槸綰跨▼瀹夊叏鐨勶紝鎵浠ュ緩璁浣跨敤澶氳繘紼嬪崟綰跨▼妯″紡
?
1
processes=n threads=1
瀵逛簬django 1.0浠ュ悗錛屽氨鍙浠ユ斁蹇冪殑浣跨敤澶氳繘紼嬪氱嚎紼嬫ā寮忥細
?
1
processes=2 threads=64
榪欐牱瀛愭ц兘浼氭洿濂姐