この内容は古いバージョンです。最新バージョンを表示するには、戻るボタンを押してください。
バージョン:1
ページ更新者:T
更新日時:2019-01-31 01:59:41

タイトル: CentOSにおけるポート開放方法
SEOタイトル: CentOSにおけるTomcatのポート開放方法

前提

・CentOSバージョン: 7

 

tomcat.xmlの作成

以下のコマンドを実行する。

vi /usr/lib/firewalld/services/tomcat.xml

 

tomcat.xmlに以下の記述をする。

<?xml version="1.0" encoding="utf-8"?>
<service>
<short>Tomcat</short>
<description>Open Tomcat port</description>
<port protocol="tcp" port="8080"/>
</service>

 

ポートの解放

以下のコマンドを実行する。

firewall-cmd --zone=public --permanent --add-service=tomcat

 

以下のコマンドを実行して設定を反映させる。

systemctl restart firewalld.service