久し振りに、構築してみた(^^; 忘れないうちにφ(..)メモメモ
OS
# cat /etc/redhat-release
Rocky Linux release 8.7 (Green Obsidian)
Temurin Java Development Kit 11インストール
# wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.18_10.tar.gz
環境変数設定
# echo "JAVA_HOME=/usr/local/java/jdk-11.0.18+10" >> /root/.bash_profile
# echo "PATH=\$JAVA_HOME/bin:\$PATH" >> /root/.bash_profile
# echo "export PATH" >> /root/.bash_profile
# source /root/.bash_profile
# java -version
openjdk version "11.0.18" 2023-01-17
OpenJDK Runtime Environment Temurin-11.0.18+10 (build 11.0.18+10)
OpenJDK 64-Bit Server VM Temurin-11.0.18+10 (build 11.0.18+10, mixed mode)
Tomcatインストール
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.71/bin/apache-tomcat-9.0.71.tar.gz
# tar -zxvf apache-tomcat-9.0.71.tar.gz
環境変数設定
# echo "CATALINA_HOME=/usr/local/java/apache-tomcat-9.0.71" >> /root/.bash_profile
# echo "PATH=\$CATALINA_HOME/bin:\$PATH" >> /root/.bash_profile
# echo "export PATH" >> /root/.bash_profile
# source /root/.bash_profile
Tomcat起動
# /usr/local/java/apache-tomcat-9.0.71/bin/startup.sh
Nginxインストールして、Let’s Encrypt利用して常時SSL化するためにcertbotもインストール
起動して確認
# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor prese>
Active: active (running) since Fri 2023-02-17 19:50:58 JST; 30min ago
Process: 42238 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 42235 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 42234 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, statu>
Main PID: 42239 (nginx)
Tasks: 5 (limit: 23664)
Memory: 8.7M
CGroup: /system.slice/nginx.service
tq42239 nginx: master process /usr/sbin/nginx
tq42240 nginx: worker process
tq42241 nginx: worker process
tq42242 nginx: worker process
mq42243 nginx: worker process
/etc/nginx/nginx.confのlocation
proxy_pass を指定して、Tomcatのポート:8080からhttpsでアクセス可能に設定。
Tomcatのドキュメントルート変更を試みたが、xmlの指定が良くわからん(*_*)ので保留中。
コメント