Thursday, February 10, 2022

How To install GlassFish Application Server with Apache on Rocky Linux 8.5

 in This Tutorial you will Learn " How To install GlassFish Application Server with Apache Web Server on Rocky Linux 8.5"

GlassFish is an open-source and Java-supported application server through which users can run Java-based applications. It supports the latest Java platforms such as Enterprise JavaBeans, JavaServer Faces, JPA, JavaServer Pages, JMS, RMI and servlets, etc. Glassfish allows developers to build enterprise applications that are scalable and portable and can integrate with legacy technologies.

Apache is the most widely used web server software.
Homepage - https://javaee.github.io/glassfish/
__________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      | IP -192.168.1.60        |Hostname - server.yourdomain.com
__________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install java-11-openjdk-devel -y
java -version
useradd -s /sbin/nologin glassfish
wget http://download.oracle.com/glassfish/5.0/release/glassfish-5.0.zip
unzip -d /opt/ glassfish-5.0.zip ; chown -R glassfish:glassfish /opt/glassfish5/


nano /usr/lib/systemd/system/glassfish.service
[Unit]
Description = GlassFish Server v5.0
After = syslog.target network.target
[Service]
User = glassfish
ExecStart = /usr/bin/java -jar /opt/glassfish5/glassfish/lib/client/appserver-cli.jar start-domain
ExecStop = /usr/bin/java -jar /opt/glassfish5/glassfish/lib/client/appserver-cli.jar stop-domain
ExecReload = /usr/bin/java -jar /opt/glassfish5/glassfish/lib/client/appserver-cli.jar restart-domain
Type = forking
[Install]
WantedBy = multi-user.target
systemctl start glassfish.service ; systemctl enable glassfish.service ; systemctl status glassfish.service

http://127.0.0.1:8080 Or http://127.0.0.1:4848
dnf update ; dnf install httpd -y
nano /etc/httpd/conf.d/example.conf
<VirtualHost *:80>
        ServerAdmin admin@example.com
        ServerName www.example.com    
        ErrorLog /var/log/httpd/error.log
        CustomLog /var/log/httpd/access.log combined
        ProxyRequests On
        ProxyPass / http://127.0.0.1:4848/
        ProxyPassReverse / http://127.0.0.1:4848/
</VirtualHost>

firewall-cmd --permanent --add-service={http,https} ; firewall-cmd --reload
firewall-cmd --add-port={4848,8080,8181}/tcp --permanent ; firewall-cmd --reload
systemctl daemon-reload ; systemctl start httpd ; systemctl enable httpd
echo "192.168.1.60 www.example.com" >> /etc/hosts
http://www.example.com
__________________________________________________________________________________________


No comments:

Post a Comment