去评论
海欣资源

linux系统配置tomcat教程

werother
2022/05/15 10:10:04
1.閫氳繃杩滅▼閾炬帴杞欢杩炴帴涓婃垜浠殑linux鏈嶅姟鍣紝涓嬭浇linux鐗堟湰鐨刯dk鍜宼omcat鍘嬬缉鍖呭苟涓婁紶鍒版垜浠殑鏈嶅姟鍣ㄤ腑锛屽涓嬶細

2.鍒嗗埆杩涜瑙e帇缂╋細
tar -zxv -f jdk-8u231-linux-x64.tar.gz 鍥炶溅
tar -zxv -f apache-tomcat-8.5.49.tar.gz 鍥炶溅


瑙e帇鎴愬姛鍚庯細

3.閰嶇疆JDK鐜鍙橀噺锛屽懡浠 锛歷im /etc/profile锛岃繘鍏ヤ互鍚庯紝闇鍔犱笂
JAVA_HOME=/java_source/jdk1.8.0_231(杩欓噷濉啓浣犵殑璺緞锛屽悗闈笉鍙)
             PATH=$JAVA_HOME/binPATH
             CLASSPATH=$JAVA_HOME/jre/lib/extJAVA_HOME/lib/tools.jar
             export PATH JAVA_HOME CLASSPATH


鐒跺悗淇濆瓨閫鍑猴細鍏堟寜ESC 锛岀劧鍚庤緭鍏":wq!" 鍐嶆寜鍥炶溅
瀹屾垚鍚庢墽琛宻ource /etc/profile鍛戒护浣夸慨鏀圭珛鍗崇敓鏁堬紝濡傚浘javac鍚庢樉绀哄涓嬶紝琛ㄧず閰嶇疆鎴愬姛


4.鍚姩闃茬伀澧 systemctl start firewalld,鏌ョ湅闃茬伀澧欑姸鎬 systemctl status firewalld

寮鏀80鍜8080绔彛锛歠irewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent


鐒跺悗鏇存柊闃茬伀澧欒鍒欙細firewall-cmd --reload

鍙互鎵цfirewall-cmd --zone=public --list-ports鏉ユ煡鐪嬫墍鏈夌鍙

5.鎵惧埌jdk1.8.0_231/jre/lib/security鐩綍涓嬬殑java.security鏂囦欢锛岀敤璁颁簨鏈墦寮
鎵惧埌securerandom.source=file:/dev/random杩欎竴琛岋紝鍦╮andom鍓嶉潰鍔犱釜u


绱ф帴鐫鎵惧埌tomcat閲岄潰bin鐩綍閲岄潰鐨剆etclasspath.bat鏂囦欢锛岃浜嬫湰鎵撳紑
鍔犲叆jdk鍜宩re鐨勪綅缃細 export JAVA_HOME=/tomcat/jdk1.8.0_231
鈥 export JRE_HOME=/tomcat/jdk1.8.0_231/jre


淇濆瓨鍚庨鍑猴紱
6.鍚姩tomcat 锛屽湪bin鐩綍涓嬫墽琛屽懡浠 ./startup.sh


鍚姩鎴愬姛锛屾帴涓嬫潵鐧诲綍涓涓嬩拱鎴戜滑涔版湇鍔″櫒瀹樼綉锛屽啀鎶婃垜浠殑绔彛鍙锋斁琛岋紙鎴戣繖閲屾槸8080锛 濡傚浘

7.鏈鍚庝竴姝ワ紝鎴戜滑鍦ㄦ祻瑙堝櫒杈撳嚭鎴戜滑鐨勫湴鍧鍔犵鍙e彿杩涜璁块棶