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
杩欐牱瀛愭ц兘浼氭洿濂姐