This site can’t be reached.

902 views
Skip to first unread message

Cezar Apulchro

unread,
Feb 5, 2024, 4:50:32 PM2/5/24
to WildFly
Environment on a VPS server:
. Centos 8
. Wildfly 30
. JAVA
. MySQL
I've configurated a server in my standalone.xml the following manner:
"/opt/wildfly/standalone/configuration/standalone.xml
................
<subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="default-host" default-servlet-container="default" default-server="default-server" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}" default-security-domain="other">
    484             <byte-buffer-pool name="default"/>
    485             <buffer-cache name="default"/>
    486             <!--<server name="default-server">
    487                 <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
    488                 <https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
    489                 <host name="default-host" alias="localhost">
    490                     <location name="/" handler="welcome-content"/>
    491                     <http-invoker http-authentication-factory="application-http-authentication"/>
    492                 </host>
    493             </server>-->
    494             <server name="itcmedbr.com">
    495                 <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
    496                 <https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
    497                 <host name="itcmedbr.com" alias="www.itcmedbr.com">
    498                     <location name="/" handler="welcome-content"/>
    499                     <http-invoker http-authentication-factory="application-http-authentication"/>
    500                 </host>
    501             </server>
    502             <servlet-container name="default">
    503                 <jsp-config/>
    504                 <websockets/>
    505             </servlet-container>
    506             <handlers>
    507                 <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
    508             </handlers>
    509             <application-security-domains>
    510                 <application-security-domain name="other" security-domain="ApplicationDomain"/>
    511             </application-security-domains>
    512         </subsystem>
............."
When I execute start of wildfly the server.log don't register any error but when I call my domain in the browser itcmedbr.com I received this error "This site can’t be reached" as response in my browser.
I appreciate any assistance.
Thanks.

Darran Lofthouse

unread,
Feb 6, 2024, 7:56:10 AM2/6/24
to WildFly
What steps have you taken to map the DNS name to the server hosting the application server?

What port numbers are your http and https socket bindings referencing?

Cezar Apulchro

unread,
Feb 8, 2024, 4:56:21 PM2/8/24
to WildFly
Hi Darran thank you,
First question:
If I understod your question after contracted the vps server I defined my domain in DNS zone in the IP address provided by my vps server.

Second question:
ss -tunelp | grep 9990
tcp   LISTEN 0      50            0.0.0.0:9990       0.0.0.0:*    users:(("java",pid=26788,fd=497)) uid:990 ino:383407 sk:52 <->

ss -tunelp | grep 8080
tcp   LISTEN 0      2048          0.0.0.0:8080       0.0.0.0:*    users:(("java",pid=26788,fd=494)) uid:990 ino:383389 sk:54 <->

Wildfly admin guide 6.2.2 say that the (Deployment content (for example, war, ear, jar, and sar files) can be placed in the standalone/deployments directory of the WildFly distribution, in order to be automatically deployed into the server runtime. For this to work the deployment-scanner subsystem must be present. The scanner periodically checks the contents of the deployments directory and reacts to changes by updating the server.) but this isn't happaning.  I transfer my war file to wildfly standalone deplyments directory by ftp.

vi /opt/wildfly/standalone/configuration/standalone.xml
........
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
    161             <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" auto-deploy-zip        ped="true" auto-deploy-exploded="true" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:fals        e}"/>
    162         </subsystem>

<subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="itcmedbr.com" default-servlet-container="de        fault" default-server="itcmedbr.com" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled        :false}}" default-security-domain="other">

    484             <byte-buffer-pool name="default"/>
    485             <buffer-cache name="default"/>
    486             <server name="itcmedbr.com">

    487                 <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
    488                 <https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
    489                 <host name="itcmedbr.com" alias="www.itcmedbr.com">

    490                     <location name="/" handler="welcome-content"/>
    491                     <http-invoker http-authentication-factory="application-http-authentication"/>
    492                 </host>
    493             </server>
    494             <servlet-container name="default">
    495                 <jsp-config/>
    496                 <websockets/>
    497             </servlet-container>
    498             <handlers>
    499                 <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
    500             </handlers>
    501             <application-security-domains>
    502                 <application-security-domain name="other" security-domain="ApplicationDomain"/>
    503             </application-security-domains>
    504         </subsystem>
........

Darran Lofthouse

unread,
Feb 9, 2024, 5:38:14 AM2/9/24
to WildFly
When trying to get things set up I would generally recommend work through things one step at a time and confirm the previous step is working before moving onto the next.

In this context by default WildFly already has some default content that will be available over the root context when accessed - in this case it would probably be better to ensure you can get a default WildFly installation installed and accessible first and then add the deployments second.

From your comment you have the application server listening on port 8080

When you enter a URL in your web browser in the form http://host-name/ this is a short hand way of specifying that the web browser should connect to port 80, if the web browser needs to connect to port 8080 the URL http://host-name:8080/ should be used instead.

In your set up however is there anything to forward traffic from port 80 to 8080?  Alternatively is port 8080 open so you can try and connect to that from your web browser?

Cezar Apulchro

unread,
Feb 9, 2024, 6:22:55 AM2/9/24
to WildFly
I understood, the problem is that wildfly is not deploying my war file.
Wildfly Getting Started Guide 6.4( If you are running a standalone WildFly server, the simplest way to deploy your application is to copy the application archive (war/ear/jar) into the $JBOSS_HOME/standalone/deployments directory in the server installation. The server’s deployment-scanner subsystem will detect the new file and deploy it.)

ls /opt/wildfly/standalone/deployments
itcmedbr.war

As you can see my war file isn't deployed.

Darran Lofthouse

unread,
Feb 9, 2024, 6:33:20 AM2/9/24
to WildFly
So you have confirmed that without the war file you can install a default WildFly installation and connect to it without any issues and see the welcome page?

Cezar Apulchro

unread,
Feb 9, 2024, 7:08:44 AM2/9/24
to WildFly
What is welcome page that you say?

Darran Lofthouse

unread,
Feb 9, 2024, 7:11:20 AM2/9/24
to WildFly
After installing WildFly when you connect your web browser to the root context e.g. http://host-name:8080/ the page you see will say "Welcome to WildFly"

Cezar Apulchro

unread,
Feb 9, 2024, 7:24:13 AM2/9/24
to WildFly
If you are saying that welcome page is of wildfly then you don't understood my problem, I've all access to wildfly console. What I want is put www.itcmedbr.com in the browser and my web page be loaded. For this is necessary to deploy my itcmedbr.war file.

Darran Lofthouse

unread,
Feb 9, 2024, 7:31:42 AM2/9/24
to WildFly
I do understand what you are trying to achieve but my recommendation here is to take it one step at a time.

Step 1 - Verify your infrastructure is set up correctly, can run WildFly and connect to WildFly.
Step 2 - Deploy your application and work through the issues related to deployment.

From the comments I am not confident you have achieved Step 1 which IMO means focusing on the deployment side is over complicating the trouble shooting needed when the infrastructure issues need to be solved first.

As an example you are showing me URLs which will lead to the web browser connecting to the application server on port 80, however you have showed me that the application server is listening on port 8080 - what measures have you put in place to map between port 80 and port 8080?  Within all of this the console for the application server listens on a different port, access to the port used to host the applications needs to be resolved first.

Jose Socola

unread,
Feb 9, 2024, 8:57:28 AM2/9/24
to Cezar Apulchro, WildFly
Hi Cezar,

Please send me this print screen or re-check conf

1. ifconfig or ip address of server
2. cat /etc/wildfly.conf inside you need to put the ip address local. 
3. systemctl status wildfly
4. "cat /etc/nginx/itcmedbr/wildfly.conf"
5. nginx -t
6. print standalone.xml only tag <socket-binding-group> and <subsystem xmlns="urn:jboss:domain:undertow:12.0" default-server="default-server">
7. print screen on folder /opt/wildfly/....deployments/
7. jboss-web.xml inside ur web-inf
8. port open on server inside firewall. 
"cat /etc/services"
"grep -w '80/tcp' /etc/services"
"grep -w '8080/tcp' /etc/services"
"grep -E -w '22/(tcp|udp)' /etc/services"


Regards,
JS

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/85168613-550b-4da5-bb53-eac618b04f37n%40googlegroups.com.

Cezar Apulchro

unread,
Feb 9, 2024, 5:35:37 PM2/9/24
to WildFly
Hi Jose thank you.
---------------
1. ifconfig or ip address of server
   xxx.xxx.xx.xxx
---------------

2. cat /etc/wildfly.conf inside you need to put the ip address local.
vi /etc/wildfly/wildfly.conf
# The configuration you want to run
      2 WILDFLY_CONFIG=standalone.xml
      3
      4 # The mode you want to run
      5 WILDFLY_MODE=standalone
      6
      7 # The address to bind to
      8 WILDFLY_BIND=xxx.xxx.xx.xxx
      9
     10 WILDFLY_CONSOLE_BIND=xxx.xxx.xx.xxx
--------------
3. systemctl status wildfly
ssystemctl status wildfly.service
● wildfly.service - The WildFly Application Server
   Loaded: loaded (/etc/systemd/system/wildfly.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2024-02-09 18:47:30 -03; 3min 56s ago
 Main PID: 79988 (launch.sh)
    Tasks: 55 (limit: 2372)
   Memory: 218.0M
   CGroup: /system.slice/wildfly.service
           ├─79988 /bin/bash /opt/wildfly/bin/launch.sh standalone standalone.xml xxx.xxx.xx.xxx xxx.xxx.xx.xxx
           ├─79989 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b xxx.xxx.xx.xxx -bmanagement=0.0.0.0 -bmanagement xxx.xxx.xx.xxx
           └─80104 java -D[Standalone] -Djdk.serialFilter=maxbytes=10485760;maxdepth=128;maxarray=100000;maxrefs=300000 -Xms64m -Xmx512m -XX:MetaspaceSize>

Feb 09 18:47:30 vps48786.publiccloud.com.br systemd[1]: Started The WildFly Application Server.
------------------
4. "cat /etc/nginx/itcmedbr/wildfly.conf"
ls /etc/nginx/
conf.d        fastcgi.conf.default    koi-utf     mime.types.default  nginx.conf.default   sites-available  uwsgi_params.default
default.d     fastcgi_params          koi-win     nginx.bkp.conf      scgi_params          sites-enabled    win-utf
fastcgi.conf  fastcgi_params.default  mime.types  nginx.conf          scgi_params.default  uwsgi_params

cat /etc/nginx/nginx.conf
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

##
# Virtual hosts configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
    include /etc/nginx/sites-enabled/*.*;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80;
        server_name  www.itcmedbr.com;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
            proxy_pass http://www.itcmedbr.com:8080;

        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2 default_server;
#        listen       [::]:443 ssl http2 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers PROFILE=SYSTEM;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }

}
--------------
5. nginx -t
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
---------------

6. print standalone.xml only tag <socket-binding-group> and <subsystem xmlns="urn:jboss:domain:undertow:12.0" default-server="default-server">
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    526         <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
    527         <socket-binding name="http" port="${jboss.http.port:8080}"/>
    528         <socket-binding name="https" port="${jboss.https.port:8443}"/>
    529         <socket-binding name="management-http" port="${jboss.management.http.port:9990}"/>
    530         <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
    531         <socket-binding name="txn-recovery-environment" port="4712"/>
    532         <socket-binding name="txn-status-manager" port="4713"/>
    533         <outbound-socket-binding name="mail-smtp">
    534             <remote-destination host="${jboss.mail.server.host:localhost}" port="${jboss.mail.server.port:25}"/>
    535         </outbound-socket-binding>
    536     </socket-binding-group>
---
<subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="itcmedbr.com" default-servlet-container="default" default-server="i        tcmedbr.com" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}" default-security-domain="other">

    484             <byte-buffer-pool name="default"/>
    485             <buffer-cache name="default"/>
    486             <server name="itcmedbr.com">
    487                 <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
    488                 <https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
    489                 <host name="itcmedbr.com" alias="www.itcmedbr.com">
    490                     <location name="/" handler="welcome-content"/>
    491                     <http-invoker http-authentication-factory="application-http-authentication"/>
    492                 </host>
    493             </server>
    494             <servlet-container name="default">
    495                 <jsp-config/>
    496                 <websockets/>
    497             </servlet-container>
    498             <handlers>
    499                 <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
    500             </handlers>
    501             <application-security-domains>
    502                 <application-security-domain name="other" security-domain="ApplicationDomain"/>
    503             </application-security-domains>
    504         </subsystem>
--------------

7. print screen on folder /opt/wildfly/....deployments/
ls /opt/wildfly/standalone/deployments
itcmedbr.war  README.txt
--------------

8. port open on server inside firewall.
 ss -tunelp
Netid  State   Recv-Q   Send-Q      Local Address:Port      Peer Address:Port  Process
udp    UNCONN  0        0               127.0.0.1:323            0.0.0.0:*      users:(("chronyd",pid=611,fd=5)) ino:24619 sk:4d <->
udp    UNCONN  0        0                   [::1]:323               [::]:*      users:(("chronyd",pid=611,fd=6)) ino:24620 sk:4e v6only:1 <->
tcp    LISTEN  0        32                0.0.0.0:21             0.0.0.0:*      users:(("vsftpd",pid=5334,fd=3)) ino:57844 sk:4f <->
tcp    LISTEN  0        128               0.0.0.0:22             0.0.0.0:*      users:(("sshd",pid=1347,fd=3)) ino:29802 sk:50 <->
tcp    LISTEN  0        2048       xxx.xxx.xx.xxx:8443           0.0.0.0:*      users:(("java",pid=80104,fd=497)) uid:990 ino:1333830 sk:5e <->
tcp    LISTEN  0        50         xxx.xxx.xx.xxx:9990           0.0.0.0:*      users:(("java",pid=80104,fd=498)) uid:990 ino:1333834 sk:5f <->
tcp    LISTEN  0        151        xxx.xxx.xx.xxx:3306           0.0.0.0:*      users:(("mysqld",pid=941,fd=33)) uid:27 ino:29102 sk:53 <->
tcp    LISTEN  0        2048       xxx.xxx.xx.xxx:8080           0.0.0.0:*      users:(("java",pid=80104,fd=495)) uid:990 ino:1333829 sk:60 <->
tcp    LISTEN  0        128               0.0.0.0:80             0.0.0.0:*      users:(("nginx",pid=882,fd=6),("nginx",pid=881,fd=6)) ino:27464 sk:55 <->
tcp    LISTEN  0        128                  [::]:22                [::]:*      users:(("sshd",pid=1347,fd=4)) ino:29804 sk:56 v6only:1 <->
tcp    LISTEN  0        70                      *:33060                *:*      users:(("mysqld",pid=941,fd=31)) uid:27 ino:29063 sk:57 v6only:0 <->
tcp    LISTEN  0        128                  [::]:80                [::]:*      users:(("nginx",pid=882,fd=7),("nginx",pid=881,fd=7)) ino:27465 sk:58 v6only:1 <->
--------------
"cat /etc/services"
very high
---------------
grep -w '80/tcp' /etc/services
http            80/tcp          www www-http    # WorldWideWeb HTTP
---------------
grep -w '8080/tcp' /etc/services
webcache        8080/tcp        http-alt        # WWW caching service
---------------

grep -E -w '22/(tcp|udp)' /etc/services
ssh             22/tcp                          # The Secure Shell (SSH) Protocol
ssh             22/udp                          # The Secure Shell (SSH) Protocol
------------

Jose Socola

unread,
Feb 10, 2024, 12:50:20 AM2/10/24
to Cezar Apulchro, WildFly
HI Cezar,

If you curl inside the server http://127.0.0.1 and http://127.0.0.1:8080 did u see any webpage?

Please follow these steps.

Step 4 : Nginx it's better create inside site-avaliable file wildfly.conf  but in your case just change this line for local ip or 127.0.0.1 and nginx -t and restart
 location / {
            proxy_pass http://www.itcmedbr.com:8080;
        }
for 
 location / {
            proxy_pass http://xxx.xxx.xxx.xxx:8080;
        }

Example :
vi /etc/nginx/sites-available/wildfly.conf and add this lines 

upstream wildfly {
  server 127.0.0.1:8080 weight=100 max_fails=5 fail_timeout=5;
}
server {
  listen          80;
  server_name     itcmedbr.com;
  location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://wildfly/;
  }
}

Step 6 : stop wildfly, change standalone.xml these lines and start

<?xml version="1.0"?>


<subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="default-host" default-servlet-container="default" default-server="default-server" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}" default-security-domain="other">

<byte-buffer-pool name="default"/>
<buffer-cache name="default"/>
<server name="default-server">


<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>

<https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>

<host name="default-host" alias="localhost,www.itcmedbr.com,itcmedbr.com">


<location name="/" handler="welcome-content"/>

<http-invoker http-authentication-factory="application-http-authentication"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>


<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>

</handlers>
<application-security-domains>


<application-security-domain name="other" security-domain="ApplicationDomain"/>

</application-security-domains>
</subsystem>

Step 7 : Inside war file web-inf/jboss-web.xml

<jboss-web>

     <context-root>/</context-root>

     <virtual-host>default-host</virtual-host>

</jboss-web>

Step 8 : Folder /opt/wildfly/....deployments/ I think u missing deploy war file but before this step we need to make sure if wildfly is show welcomepage and nginx redirect the port after that just create a file dodeploy 

> itcmedbr.war.dodeploy

i hope i don't miss any step


Regards,
JS

Cezar Apulchro

unread,
Feb 10, 2024, 6:36:51 AM2/10/24
to WildFly
If I curl inside the server http://127.0.0.1 and http://127.0.0.1:8080 did u see any webpage?
Google page is loaded.
------------

Step 8 : Folder /opt/wildfly/....deployments/ I think u missing deploy war file but before this step we need to make sure if wildfly is show welcomepage and nginx redirect the port after that just create a file dodeploy
ls /opt/wildfly/standalone/deployments
itcmedbr.war  README.txt

What is this that you wrote?
====> $ > itcmedbr.war.dodeploy
--------------
I executed all that of your list but problem still "This site can’t be reached".

Cezar Apulchro

unread,
Feb 10, 2024, 9:57:01 AM2/10/24
to WildFly
Now after made all changes I can't load http://myipaddress:9990 to access wildfly console, I am receiving "This site can’t be reached"

Cezar Apulchro

unread,
Feb 11, 2024, 9:30:16 AM2/11/24
to WildFly
Configuration of deployment-scanner:

<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
    161             <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" auto-deploy-zipped="true" auto-deploy-exploded="true" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
    162         </subsystem>
Server log error:
ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0042: Boot-time scan failed due to inaccessible deployment directory: /opt/wildfly/standalone/deployments

Jose Socola

unread,
Feb 11, 2024, 9:31:44 PM2/11/24
to Cezar Apulchro, WildFly
Hi Cezar, 


Did u run the curl on linux server/wildfy, can your share server.log file and in the step 8 u must have a file called itcmedbr.war.deployed or itcmedbr.war.failed just u have itcmedbr.war and readme.txt means your app dind'.

Wildfly is starting without errors?

Regards,
JS

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.

Cezar Apulchro

unread,
Feb 12, 2024, 6:37:37 AM2/12/24
to WildFly
Sorry, before making this contact I had deployed via the wildfly console and it was giving an error that already existed then I remove my war using wildfly console and I resolve the last error. Now the condition is :
 ls /opt/wildfly/standalone/deployments
itcmedbr.war  itcmedbr.war.dodeploy  itcmedbr.war.isdeploying  README.txt

I don't have any error in server.log but problem still the same "This site can't be reached"

Cezar Apulchro

unread,
Feb 12, 2024, 7:19:34 AM2/12/24
to WildFly
last condition:
ls /opt/wildfly/standalone/deployments
itcmedbr.war  itcmedbr.war.deployed  README.txt

and:  "This site can't be reached"

Cezar Apulchro

unread,
Feb 12, 2024, 9:24:48 AM2/12/24
to WildFly
 In the wildfly deployments screen I see in the Main Attributes sub-screen one line that show the following line "Enabled, Managed, Exploded: " next to this line are there two symbols of check mark for Enabled and Managed, to mark Exploded are there one X. What this signify.

Cezar Apulchro

unread,
Feb 12, 2024, 10:01:52 AM2/12/24
to WildFly
After setting auto-deploy-exploded="true" I am loading my web app by using my ip address:8080 in the browser.

Cezar Apulchro

unread,
Feb 12, 2024, 10:13:37 AM2/12/24
to WildFly
The same is happening for auto-deploy-exploded="false" 

Jose Socola

unread,
Feb 12, 2024, 11:09:30 AM2/12/24
to Cezar Apulchro, WildFly
Hi Cezar,

Now we know wildfly is running ok and your app is deployed ok, so you need to check other steps.

1. Public Ip is point to the correct server
2. Port is open to public access Firewalld
3. Could you open 8080 on fireward just for test propose.
4. Ngix check all configuration.

You can check public ip with and check the dns correct.
$ hostname -I
$ nmcli -p device show


Regards,
JS

Message has been deleted

Cezar Apulchro

unread,
Feb 12, 2024, 4:34:40 PM2/12/24
to WildFly
Hi Jose,
-----
hostname -I
xxx.xxx.xx.xxx my ip address

 firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services: http https ssh
  ports: 8080/tcp 9990/tcp
  protocols:
  forward: no
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:


nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
--------

Cezar Apulchro

unread,
Feb 12, 2024, 4:38:12 PM2/12/24
to WildFly
Hi Jose, what you want from this "nmcli -p device show"?

Cezar Apulchro

unread,
Feb 13, 2024, 9:52:41 AM2/13/24
to WildFly
Hi, no more ideas to solve this problem???

Cezar Apulchro

unread,
Feb 16, 2024, 4:44:29 PM2/16/24
to WildFly
Hi, trying to solve my problem I made some changes following this link "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/index" "2.2. Configuring NGINX as a web server that provides different content for different domains". I believe that my problem is the configuration of my nginx.conf, I am using wildfly as server then my application are deployed in the path /opt/wildfly/standalone/deployments I put this path in the root of nginx.con but the problem still still the same. The question is how to configure nginx with wildfly server?

Cezar Apulchro

unread,
Feb 16, 2024, 4:54:58 PM2/16/24
to WildFly
Sorry, my nginx.conf:
------
http {
     24     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
     25                       '$status $body_bytes_sent "$http_referer" '
     26                       '"$http_user_agent" "$http_x_forwarded_for"';
     27
     28     access_log  /var/log/nginx/access.log  main;
     29
     30     sendfile            on;
     31     tcp_nopush          on;
     32     tcp_nodelay         on;
     33     keepalive_timeout   65;
     34     types_hash_max_size 2048;
     35
     36     include             /etc/nginx/mime.types;
     37     default_type        application/octet-stream;
     38     include /etc/nginx/sites-enabled/*.*;
     39
     40     # Load modular configuration files from the /etc/nginx/conf.d directory.
     41     # See http://nginx.org/en/docs/ngx_core_module.html#include
     42     # for more information.
     43     include /etc/nginx/conf.d/*.conf;
     44
     45     server {
     46         listen       80 default_server;
     47         listen       [::]:80 default_server;
     48
     49         server_name  _;
     50         root         /usr/share/nginx/html;
     51     }
     52
              server {
     54         server_name  itcmedbr.com www.itcmedbr.com;
     55         root         /opt/wildfly/standalone/deployments;
     56
     57         # Load configuration files for the default server block.
     58         include /etc/nginx/default.d/*.conf;
     59
     60 #        location / {
     61             proxy_pass http://xxx.xxx.xx.xxx:8080;
     62
     63         }
     64
     65         error_page 404 /404.html;
     66             location = /40x.html {
     67         }
     68
     69         error_page 500 502 503 504 /50x.html;
     70             location = /50x.html {
     71         }
     72     }
     73

Ken Wills

unread,
Feb 16, 2024, 6:02:56 PM2/16/24
to Cezar Apulchro, WildFly
Hi Cezar,

On Fri, Feb 16, 2024 at 3:44 PM Cezar Apulchro <razec.a...@gmail.com> wrote:
Hi, trying to solve my problem I made some changes following this link "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/index" "2.2. Configuring NGINX as a web server that provides different content for different domains". I believe that my problem is the configuration of my nginx.conf, I am using wildfly as server then my application are deployed in the path /opt/wildfly/standalone/deployments I put this path in the root of nginx.con but the problem still still the same. The question is how to configure nginx with wildfly server?

This is not correct, and in fact may open a security hole in your configuration allowing your deployments to be downloaded by an external visitor (meaning your WARs  / EARs etc), I suggest you set this to /var/www/ or something (it can be an empty directory.) Nginx should behave as a proxy only and forward requests to WildFly. As a reminder, WildFly should only be bound to the loopback address, while nginx should be bound to the external address.

It is quite hard to make suggestions as to what may not be working currently, however do you have selinux enabled? This could perhaps be preventing the proxy from functioning correctly. You can check if it is enabled using the command $ getenforce. If it is enabled you can google for a nginx and selinux configuration and you'll get some info on what your options are. Since this appears to be a public host, I do not recommend disabling selinux.

Ken
 

Em terça-feira, 13 de fevereiro de 2024 às 11:52:41 UTC-3, Cezar Apulchro escreveu:
Hi, no more ideas to solve this problem???

Em segunda-feira, 12 de fevereiro de 2024 às 18:38:12 UTC-3, Cezar Apulchro escreveu:
Hi Jose, what you want from this "nmcli -p device show"?

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.

Cezar Apulchro

unread,
Feb 19, 2024, 3:07:27 PM2/19/24
to WildFly
Hi Ken sorry by delay, I created a directory for my app as you say.
-----
ls /var/www/itcmedbr.com/html/
index.jsp
------
getenforce
Enforcing
---------
sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33
-----

Cezar Apulchro

unread,
Feb 19, 2024, 3:25:32 PM2/19/24
to WildFly
One question, where is location of jsp's page and classes after deployed war file?

Ken Wills

unread,
Feb 19, 2024, 3:34:03 PM2/19/24
to Cezar Apulchro, WildFly


On Mon, Feb 19, 2024, 14:07 Cezar Apulchro <razec.a...@gmail.com> wrote:
Hi Ken sorry by delay, I created a directory for my app as you say.
-----
ls /var/www/itcmedbr.com/html/
index.jsp
------
getenforce
Enforcing
---------
sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33
-----

This is likely your issue, see the proxy section here: https://www.nginx.com/blog/using-nginx-plus-with-selinux/

Ken


Em sexta-feira, 16 de fevereiro de 2024 às 20:02:56 UTC-3, Ken Wills escreveu:
Hi Cezar,

On Fri, Feb 16, 2024 at 3:44 PM Cezar Apulchro <razec.a...@gmail.com> wrote:
Hi, trying to solve my problem I made some changes following this link "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/index" "2.2. Configuring NGINX as a web server that provides different content for different domains". I believe that my problem is the configuration of my nginx.conf, I am using wildfly as server then my application are deployed in the path /opt/wildfly/standalone/deployments I put this path in the root of nginx.con but the problem still still the same. The question is how to configure nginx with wildfly server?

This is not correct, and in fact may open a security hole in your configuration allowing your deployments to be downloaded by an external visitor (meaning your WARs  / EARs etc), I suggest you set this to /var/www/ or something (it can be an empty directory.) Nginx should behave as a proxy only and forward requests to WildFly. As a reminder, WildFly should only be bound to the loopback address, while nginx should be bound to the external address.

It is quite hard to make suggestions as to what may not be working currently, however do you have selinux enabled? This could perhaps be preventing the proxy from functioning correctly. You can check if it is enabled using the command $ getenforce. If it is enabled you can google for a nginx and selinux configuration and you'll get some info on what your options are. Since this appears to be a public host, I do not recommend disabling selinux.

Ken
 

Em terça-feira, 13 de fevereiro de 2024 às 11:52:41 UTC-3, Cezar Apulchro escreveu:
Hi, no more ideas to solve this problem???

Em segunda-feira, 12 de fevereiro de 2024 às 18:38:12 UTC-3, Cezar Apulchro escreveu:
Hi Jose, what you want from this "nmcli -p device show"?

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.

Ken Wills

unread,
Feb 19, 2024, 4:12:26 PM2/19/24
to Cezar Apulchro, WildFly


On Mon, Feb 19, 2024, 14:33 Ken Wills <k...@zaptillion.net> wrote:


On Mon, Feb 19, 2024, 14:07 Cezar Apulchro <razec.a...@gmail.com> wrote:
Hi Ken sorry by delay, I created a directory for my app as you say.

Also, just to clarify here, this is not needed at all for running a proxy, I simply meant it is a mistake to configure it to be your wildfly deployment directory. All the proxy does if forward requests via network requests, it does not need, and shouldn't have any knowledge of what is deployed to wildfly, or where on the disk.

Ken 

Cezar Apulchro

unread,
Feb 21, 2024, 5:11:19 AM2/21/24
to WildFly
Hi Ken, ok I removed any information of my domain from the nginx.conf file and itcmedbr files from /var/www directory but I continue receiving "This site can’t be reached".

Cezar Apulchro

unread,
Feb 21, 2024, 9:00:43 AM2/21/24
to WildFly
Hi people, I followed this video "https://www.youtube.com/watch?v=AqgClYuy1wM" and I've configured my nginx.conf but my problem to load my web page still the same.
nginx.conf:
     45     server {
     46         listen       80 default_server;
     47         listen       [::]:80 default_server;
     48
     49 #       server_name  _;
     50 #       root         /usr/share/nginx/html;
     51
     52         server_name  itcmedbr.com;
     53
     54         error_page 404 /404.html;
     55         location / {
     56             proxy_set_header Host $host;
     57             proxy_set_header X-Real-IP $remote_addr;
     58             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     59             proxy_set_header X-Forwarded-Proto $scheme;
     60             proxy_pass http://ipaddress;
     61             
     62         }
     63
     64         error_page 500 502 503 504 /50x.html;
     65         location = /50x.html {
     66         }
     67     }
--------------
Why my configuration don't work?

Ken Wills

unread,
Feb 21, 2024, 1:00:31 PM2/21/24
to Cezar Apulchro, WildFly
Hi Cezar,

Did you update your selinux configuration for nginx?

Ken

Cezar Apulchro

unread,
Feb 23, 2024, 4:17:53 PM2/23/24
to WildFly
Hi Ken,
I believe that selinux is configured to nginx but I don't know if i've configured right, if I inform my ipaddress in the browser I receiving nginx error page that say "The page you are looking for is temporarily unavailable. Please try again later." if I write myipaddress:8080 my webapp page is loaded.
I configured selinux config  to permissive.
-------------
sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          permissive

Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33
-------------

Jose Socola

unread,
Feb 23, 2024, 5:15:27 PM2/23/24
to Cezar Apulchro, WildFly
Hi Cezar,

Are u sure curl http://177.153.57.244:8080 open your webpage? or just curl http://192.168.5.12_local_ip:8080 show your webpage? or cul http://127.0.0.1:8080 open you webpage?

I think the problem is on the dns or assign ip when run wildfly, inside te log u can see the listener is running on ipaddress or just local.

Regards,
JS

Ken Wills

unread,
Feb 23, 2024, 5:36:30 PM2/23/24
to Cezar Apulchro, WildFly
Check the output of journalctl -f while you're making the request for any more clues perhaps, and also Jose's advice is sound around testing with curl. It sounds like you're making progress.

:Ken

Cezar Apulchro

unread,
Feb 24, 2024, 5:39:56 AM2/24/24
to WildFly
Hi Jose, 
yes only with my ipaddress:8080 my webapp is loaded.
What log you refer? journalctl don't show nothing of abnormal.


Cezar Apulchro

unread,
Feb 24, 2024, 7:09:30 AM2/24/24
to WildFly
Hi, 
my /var/log/nginx/error.log show me:
---------
[error] 12231#0: *18946 upstream timed out (110: Connection timed out) while reading response header from upstream,
 client: xxx.xxx.xx.xxx, server: itcmedbr.com, request: "GET / HTTP/1.0",
 upstream: "http://xxx.xxx.xx.xxx:80/", host: "xxx.xxx.xx.xxx"
   
[alert] 12231#0: *20199 socket() failed (24: Too many open files) while connecting to upstream, client: xxx.xxx.xx.xxx,
 server: itcmedbr.com, request: "GET /nginx-logo.png HTTP/1.0", upstream: "http://xxx.xxx.xx.xxx:80/nginx-logo.png",
 host: "xxx.xxx.xx.xxx", referrer: "http://xxx.xxx.xx.xxx/"
----------
Where xxx.xxx.xx.xxx = ipaddress.

Ken Wills

unread,
Feb 24, 2024, 1:41:44 PM2/24/24
to Cezar Apulchro, WildFly

Cezar Apulchro

unread,
Feb 26, 2024, 9:51:31 AM2/26/24
to WildFly
Hi, now my nginx proxy reverse is working fine after made an alteration in my nginx.conf, now I know that my problem is in my wildfly configuration.
My itcmedbr.conf:
--------
1 server {
2     listen       80;
3     listen       [::]:80;
4     server_name  itcmedbr.com;
5
6     # Load configuration files for the default server block.
7
8     location / {
9         proxy_pass "http://xxx.xxx.xx.xxx:8080";
10    }
11
12    error_page 404 /404.html;
13         location = /40x.html {
14    }
15
16    error_page 500 502 503 504 /50x.html;
17         location = /50x.html {
18    }
19 }
----------
The question is where is my java class, jsp pages and much more of my application after the deploy?
Now after alteration on nginx.conf,  when put the ip address in the browser the nginx page is loaded "Welcome to nginx on Rocky Linux!". After deployment of my itcmedbr.war file I can't find my itcmedbr.com then the problem is in wildfly.

Ken Wills

unread,
Feb 26, 2024, 10:11:26 AM2/26/24
to Cezar Apulchro, WildFly
On Mon, Feb 26, 2024 at 8:51 AM Cezar Apulchro <razec.a...@gmail.com> wrote:
Hi, now my nginx proxy reverse is working fine after made an alteration in my nginx.conf, now I know that my problem is in my wildfly configuration.
My itcmedbr.conf:
--------
1 server {
2     listen       80;
3     listen       [::]:80;
4     server_name  itcmedbr.com;
5
6     # Load configuration files for the default server block.
7
8     location / {
9         proxy_pass "http://xxx.xxx.xx.xxx:8080";

It is unclear to me why this is always xxx.xxx.xxx.xxx, why is it not just:

proxy_pass "http://127.0.0.1:8080";

As mentioned several times previously, nginx gets bound to the external address, wildfly to localhost.
 

Cezar Apulchro

unread,
Feb 26, 2024, 4:30:31 PM2/26/24
to WildFly
Same problem.
I made all the changes that were requested and nothing worked. I want to know how I load my web application by typing itcmedbr.com in my browser.

Ken Wills

unread,
Feb 26, 2024, 5:07:23 PM2/26/24
to Cezar Apulchro, WildFly
What do you get when you do:


on the local machine.

Cezar Apulchro

unread,
Feb 26, 2024, 5:56:40 PM2/26/24
to WildFly
in the browser "This site can't be reached" is showed.

Ken Wills

unread,
Feb 26, 2024, 6:13:15 PM2/26/24
to Cezar Apulchro, WildFly
Well, I doubt I can suggest more if you continue to have it set up this way, the last few things i'd check though are in the proxy configuration:

Make sure you're setting:

        proxy_set_header    X-Forwarded-For $remote_addr;
        proxy_set_header    Host $server_name:$server_port;
        proxy_set_header    Origin http://xxx.xxx.xxx.xxx;
        proxy_set_header    Upgrade $http_upgrade;
        proxy_set_header    Connection $connection_upgrade;

Not all are required, likely host certainly is for http/1.1. Other than that, good luck getting it to work.

Ken

Cezar Apulchro

unread,
Feb 27, 2024, 6:14:27 AM2/27/24
to WildFly
Hi Ken,
I am receiving this error:
 nginx -t
nginx: [emerg] unknown "connection_upgrade" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

configuration:
      1 server {
      2     listen       80;
      3     listen       [::]:80;
      4     server_name  itcmedbr.com;
      5
      6     # Load configuration files for the default server block.
      7
      8     location / {
      9         proxy_set_header X-Forwarded-For $remote_addr;
     10         proxy_set_header Host $server_name:$server_port;
     11         proxy_set_header Origin http://ipaddress;
     12         proxy_set_header Upgrade $http_upgrade;
     13         proxy_set_header Connection     $connection_upgrade;
     14
     15         proxy_pass http://127.0.0.1:8080;
     16     }
     17
     18     error_page 404 /404.html;
     19         location = /40x.html {
     20     }
     21
     22     error_page 500 502 503 504 /50x.html;
     23          location = /50x.html {
     24     }
     25 }
without Connection parameter the problem still the same.

Cezar Apulchro

unread,
Feb 27, 2024, 4:59:17 PM2/27/24
to WildFly
Hi, 
I said that my problem was with wildfly, this link https://www.nginx.com/resources/wiki/start/topics/examples/full/ shows a example of nginx.conf with root parameter so how to make the nginx to access itcmedbr.war file in /opt/wildfly/standalone/deployments where is default location for deployment of wildfly? In the standalone.xml I seted auto-deploy-exploded="true" in the deployment-scanner parameter but nothing happened.

Cezar Apulchro

unread,
Mar 6, 2024, 5:47:34 AM3/6/24
to WildFly
1 - deploy the war file
----------------
 ls /opt/wildfly/standalone/deployments/
itcmedbr.war  itcmedbr.war.deployed  README.txt
-----------------
2 - configuration of nginx:
-----------------
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

 user nginx;
 worker_processes auto;
 error_log /var/log/nginx/error.log;
 pid /run/nginx.pid;

 # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
 include /usr/share/nginx/modules/*.conf;

 events {
     worker_connections 1024;
 }

 http {

     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                       '$status $body_bytes_sent "$http_referer" '
                       '"$http_user_agent" "$http_x_forwarded_for"';

     access_log  /var/log/nginx/access.log  main;

     sendfile            on;
     tcp_nopush          on;
     tcp_nodelay         on;
     keepalive_timeout   65;
     types_hash_max_size 2048;

     include             /etc/nginx/mime.types;
     default_type        application/octet-stream;


     # Load modular configuration files from the /etc/nginx/conf.d directory.
     # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
     include /etc/nginx/conf.d/*.conf;

     server {
         listen       80 default_server;
         listen       [::]:80 default_server;
         server_name  _;
         root         /usr/share/nginx/html;


         # Load configuration files for the default server block.
 #        include /etc/nginx/default.d/*.conf;

         location / {
         }
 
         error_page 404 /404.html;
             location = /40x.html {

        }

         error_page 500 502 503 504 /50x.html;
             location = /50x.html {
         }
     }

 # Settings for a TLS enabled server.
 #
 #    server {
 #        listen       443 ssl http2 default_server;
 #        listen       [::]:443 ssl http2 default_server;
 #        server_name  _;
 #        root         /usr/share/nginx/html;
 #
 #        ssl_certificate "/etc/pki/nginx/server.crt";
 #        ssl_certificate_key "/etc/pki/nginx/private/server.key";
 #        ssl_session_cache shared:SSL:1m;
 #        ssl_session_timeout  10m;
 #        ssl_ciphers PROFILE=SYSTEM;
 #        ssl_prefer_server_ciphers on;
 #
 #        # Load configuration files for the default server block.
 #        include /etc/nginx/default.d/*.conf;
 #
 #        location / {
 #        }
 #
 #        error_page 404 /404.html;
 #            location = /40x.html {
 #        }
 #
 #        error_page 500 502 503 504 /50x.html;
 #            location = /50x.html {
 #        }
 #    }

 }
-----------------
2.1 - configuration of itcmedbr.conf in /etc/nginx/conf.d:
------------------
 server {
     listen       80;
     listen       [::]:80;
     server_name  itcmedbr.com www.itcmedbr.com;

     listen       443 ssl http2 default_server;
     listen       [::]:443 ssl http2 default_server;

     # Redirect all port 80 (HTTP) requests to port 443 (HTTPS).
     return 301 https://itcmedbr.com$request_uri;


     # Load configuration files for the default server block.

     location / {
         proxy_set_header Origin                 http://ipaddress;

         proxy_pass http://127.0.0.1:8080;
     }

     error_page 404 /404.html;
         location = /40x.html {

     }

     error_page 500 502 503 504 /50x.html;
          location = /50x.html {
     }
 }
-------------------
3 - status nginx
--------------------
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2024-03-03 18:36:43 -03; 41s ago
--------------------
4 - status wildfly.service
---------------------
   Loaded: loaded (/etc/systemd/system/wildfly.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2024-03-03 18:25:40 -03; 41s ago
---------------------
5 - firewall ports
----------------------
firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services: http https ssh
  ports: 8080/tcp 9990/tcp 3306/tcp 80/tcp 443/tcp
  protocols:
  forward: no
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

ss -tunelp | grep 80
tcp   LISTEN 0      511           0.0.0.0:80         0.0.0.0:*    users:(("nginx",pid=159107,fd=6),("nginx",pid=159105,fd=6)) ino:2538418 sk:4b <->
tcp   LISTEN 0      2048   xxx.xxx.xx.xxx:8080       0.0.0.0:*    users:(("java",pid=158828,fd=494)) uid:990 ino:2536856 sk:4c <->
tcp   LISTEN 0      511              [::]:80            [::]:*    users:(("nginx",pid=159107,fd=7),("nginx",pid=159105,fd=7)) ino:2538419 sk:4f v6only:1 <->
 
 ss -tunelp | grep 443
tcp   LISTEN 0      511           0.0.0.0:443        0.0.0.0:*    users:(("nginx",pid=159107,fd=8),("nginx",pid=159105,fd=8)) ino:2538420 sk:4d <->
tcp   LISTEN 0      2048   xxx.xxx.xx.xxx:8443       0.0.0.0:*    users:(("java",pid=158828,fd=495)) uid:990 ino:2536857 sk:4e <->
tcp   LISTEN 0      511              [::]:443           [::]:*    users:(("nginx",pid=159107,fd=9),("nginx",pid=159105,fd=9)) ino:2538421 sk:50 v6only:1 <->
---------------------
now when I typing itcmedbr.com I receiving " This site can't be reached 

The connection was reset." and if I typing in the browser ip:8080 the "Welcome to Wildfly" page is loaded.


Cezar Apulchro

unread,
Mar 6, 2024, 6:41:47 AM3/6/24
to WildFly
Now my /var/log/nginx/error.log is showing:
-------------------
[error] 170362#0: *585 open() "/usr/share/nginx/html/badging/badge_print_v0.php" failed (2: No         such file or directory), client: xxx.xx.xxx.xxx, server: _, request: "GET /badging/badge_print_v0.php?tpl=../../.        ./../../etc/passwd HTTP/1.1", host: "xxx.xxx.xx.xxx"
    175 2024/03/06 08:22:06 [error] 198825#0: *1 "/usr/share/nginx/html/search/index.html" is not found (2: No such file o        r directory), client: xxx.xx.xxx.xxx, server: _, request: "POST /search/ HTTP/1.1", host: "xxx.xxx.xx.xxx"
    176 2024/03/06 08:22:19 [error] 198825#0: *2 "/usr/share/nginx/html/search/index.html" is not found (2: No such file o        r directory), client: xxx.xx.xxx.xxx, server: _, request: "POST /search/ HTTP/1.1", host: "xxx.xxx.xx.xxx"
---------------------

Ken Wills

unread,
Mar 6, 2024, 9:02:42 AM3/6/24
to Cezar Apulchro, WildFly


On Wed, Mar 6, 2024, 05:41 Cezar Apulchro <razec.a...@gmail.com> wrote:
Now my /var/log/nginx/error.log is showing:
-------------------
[error] 170362#0: *585 open() "/usr/share/nginx/html/badging/badge_print_v0.php" failed (2: No         such file or directory), client: xxx.xx.xxx.xxx, server: _, request: "GET /badging/badge_print_v0.php?tpl=../../.        ./../../etc/passwd HTTP/1.1", host: "xxx.xxx.xx.xxx"
    175 2024/03/06 08:22:06 [error] 198825#0: *1 "/usr/share/nginx/html/search/index.html" is not found (2: No such file o        r directory), client: xxx.xx.xxx.xxx, server: _, request: "POST /search/ HTTP/1.1", host: "xxx.xxx.xx.xxx"
    176 2024/03/06 08:22:19 [error] 198825#0: *2 "/usr/share/nginx/html/search/index.html" is not found (2: No such file o        r directory), client: xxx.xx.xxx.xxx, server: _, request: "POST /search/ HTTP/1.1", host: "xxx.xxx.xx.xxx"
---------------------

This is highly likely to be just normal Internet traffic noise.

Cezar Apulchro

unread,
Mar 6, 2024, 9:43:18 AM3/6/24
to WildFly
Hi Ken,
the problem is that I don't find any information of my jsp pages, java class and much more of my web application, my interpeting is that must be in some place a directory with this information, for example when you use Tomcat server the pages are located in www directory sub-directory html. In wildfly 30 how this work?

Ken Wills

unread,
Mar 6, 2024, 9:55:44 AM3/6/24
to Cezar Apulchro, WildFly
In wildfly these are in the the deployment directory, as I recall I think you're deploying an exploded WAR, correct? Note as a reminder, your reverse proxy does *not* need to know where this is, it should be forwarding http / https requests via sockets.

Cezar Apulchro

unread,
Mar 6, 2024, 4:53:19 PM3/6/24
to WildFly
Hi Ken,
since the beginning of this contact I had created by itcmedbr.war in the deployments directory and nothing happens, that is, my application does not load, it just generate this message "This site can't be reached".
-------------
ls /opt/wildfly/standalone/deployments
itcmedbr.war  itcmedbr.war.deployed  README.txt
--------------
In the wildfly deployments page the status of itcmedbr.war isn't exploded.

Cezar Apulchro

unread,
Mar 7, 2024, 6:53:17 AM3/7/24
to WildFly
Is this configuration right?
----------------
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
    161             <deployment-scanner name="itcmedbr.war" path="deployments" relative-to="jboss.server.base.di        r" scan-interval="5000" auto-deploy-zipped="true" auto-deploy-exploded="false" deployment-timeout="240"         runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
    162         </subsystem>
-----------------

Jose Socola

unread,
Mar 7, 2024, 9:43:48 AM3/7/24
to Cezar Apulchro, WildFly
HI Cezar,

I think you are stuck and lost. I recommend formatting everything and starting again. Follow the steps and check first if wildfly running ok with the public ip and port 8080 after that install nginx and config all with 127.0.0.1 is the same server.

You can use this script https://gist.github.com/russellhoff/d3f6e75052ebe96ed78f1e1645bf2c6b to install wildfly just change  version of url and make sure you have wget and tar command on server and java jdk.

WILDFLY_VERSION=30.0.0.Final
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION
WILDFLY_ARCHIVE_NAME=$WILDFLY_FILENAME.tar.gz
WILDFLY_DOWNLOAD_ADDRESS=https://github.com/wildfly/wildfly/releases/download/$WILDFLY_VERSION/$WILDFLY_ARCHIVE_NAME


Regards,
JS

Darran Lofthouse

unread,
Mar 7, 2024, 10:00:45 AM3/7/24
to WildFly
+1 this is why in my earlier comments I recommend starting with the clean installation, break the problem into smaller steps and work through them one by one.

Once the proxy has been configured and can display the default welcome page from port 8080 getting it to display the content of a successfully deployed web application becomes almost a trivial activity.  The proxy does not need to know anything about the war file at all, all it needs to know is the correct configuration to listen for and pass the HTTP traffic to WildFly, WildFly then deals with the details of the war file.

Adriano Aguiar

unread,
Mar 7, 2024, 3:30:18 PM3/7/24
to WildFly
To configure proxy you only need the system running and if it is Linux enable httpd_can_network, here is an example:

Run this command: setsebool -P httpd_can_network_connect 1

server {
     
        listen       443 ssl http2;
        listen       [::]:443 ssl http2;
        server_name  site.com.br
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header X-NginX-Proxy true;
 

        ssl_certificate /etc/nginx/ssl/cert.crt;
        ssl_certificate_key /etc/nginx/ssl/cert.key;
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_protocols       SSLv3 TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;

        location / {
 
   proxy_buffering          off;
           proxy_buffer_size        128k;
           proxy_busy_buffers_size  256k;
           proxy_buffers            4                   256k;
           proxy_set_header         Host                $host;
           proxy_set_header         X-Real-IP           $remote_addr;
           proxy_set_header         X-Forwarded-For     $proxy_add_x_forwarded_for;
           proxy_set_header         X-Forwarded-Proto   $scheme;
           proxy_set_header         Upgrade             $http_upgrade;
           proxy_set_header         Connection          $http_connection;

           proxy_pass http://127.0.0.1:8080/;

Cezar Apulchro

unread,
Mar 7, 2024, 5:13:59 PM3/7/24
to WildFly
Hi  Adriano,
from what I understand your post is for ssl and I don't have ssl certificate.
What is the problem with my conf?
--------------------
 server {
     listen       80;
     listen       [::]:80;
     server_name  itcmedbr.com www.itcmedbr.com;

     listen       443 ssl http2 default_server;
     listen       [::]:443 ssl http2 default_server;

     # Redirect all port 80 (HTTP) requests to port 443 (HTTPS).
     return 301 https://itcmedbr.com$request_uri;

     # Load configuration files for the default server block.

     location / {
         proxy_set_header Origin                 http://ipaddress;

         proxy_pass http://127.0.0.1:8080;
     }

     error_page 404 /404.html;
         location = /40x.html {
     }

     error_page 500 502 503 504 /50x.html;
          location = /50x.html {
     }
 }
------------------

Adriano Aguiar

unread,
Mar 8, 2024, 7:21:15 AM3/8/24
to WildFly
If you don't have SSL it should look like this:

server {
     listen       80;
     listen       [::]:80;
     server_name  itcmedbr.com www.itcmedbr.com;
     # Load configuration files for the default server block.

     location / {
       
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

         proxy_pass http://127.0.0.1:8080;
     }

     error_page 404 /404.html;
         location = /40x.html {
     }

     error_page 500 502 503 504 /50x.html;
          location = /50x.html {
     }
 }

#include /etc/nginx/conf.d/*;

Cezar Apulchro

unread,
Mar 13, 2024, 11:24:04 AM3/13/24
to WildFly
Trying to solve the problem I did the following steps:
1 - uninstall and remove Nginx
2 - install nginx with certbot
     yum install nginx certbot python3-certbot-nginx
3 - create my server conf
     vi /etc/nginx/conf.d/itcmedbr.conf
      1 server {
      2         server_name     itcmedbr.com;
      3
      4 }
4 - configure certbot
     certbot --nginx
         define email
         define domain
5 - reload, restart, nginx and wildfly
6 - when test nginx result is:
      nginx -t
      nginx: [warn] conflicting server name "itcmedbr.com" on 0.0.0.0:80, ignored <==( how to solve this)
      nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
      nginx: configuration file /etc/nginx/nginx.conf test is successful
7 - result of nginx.conf
      1 # For more information on configuration, see:
      2 #   * Official English Documentation: http://nginx.org/en/docs/
      3 #   * Official Russian Documentation: http://nginx.org/ru/docs/
      4
      5 user nginx;
      6 worker_processes auto;
      7 error_log /var/log/nginx/error.log;
      8 pid /run/nginx.pid;
      9
     10 # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
     11 include /usr/share/nginx/modules/*.conf;
     12
     13 events {
     14     worker_connections 1024;
     15 }
     16
     17 http {
     18     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
     19                       '$status $body_bytes_sent "$http_referer" '
     20                       '"$http_user_agent" "$http_x_forwarded_for"';
     21
     22     access_log  /var/log/nginx/access.log  main;
     23
     24     sendfile            on;
     25     tcp_nopush          on;
     26     tcp_nodelay         on;
     27     keepalive_timeout   65;
     28     types_hash_max_size 2048;
     29
     30     include             /etc/nginx/mime.types;
     31     default_type        application/octet-stream;
     32
     33     # Load modular configuration files from the /etc/nginx/conf.d directory.
     34     # See http://nginx.org/en/docs/ngx_core_module.html#include
     35     # for more information.
     36     include /etc/nginx/conf.d/*.conf;
     37
     38     server {
     39         listen       80 default_server;
     40         listen       [::]:80 default_server;
     41         server_name  _;
     42         root         /usr/share/nginx/html;
     43
     44         # Load configuration files for the default server block.
     45         include /etc/nginx/default.d/*.conf;
     46
     47         location / {
     48         }
     49
     50         error_page 404 /404.html;
     51             location = /40x.html {
     52         }
     53
     54         error_page 500 502 503 504 /50x.html;
     55             location = /50x.html {
     56         }
     57     }
     58
     59 # Settings for a TLS enabled server.
     60
     61     server {
     62         listen       443 ssl http2 default_server;
     63         listen       [::]:443 ssl http2 default_server;
     64         server_name  _;
     65         root         /usr/share/nginx/html;
     66
     67         ssl_certificate "/etc/ssl/certs/nginx-selfsigned.crt";
     68         ssl_certificate_key "/etc/ssl/private/nginx-selfsigned.key";
     69         ssl_session_cache shared:SSL:1m;
     70         ssl_session_timeout  10m;
     71         ssl_ciphers PROFILE=SYSTEM;
     72         ssl_prefer_server_ciphers on;
     73
     74         # Load configuration files for the default server block.
     75         include /etc/nginx/default.d/*.conf;
     76
     77         location / {
     78         }
     79
     80         error_page 404 /404.html;
     81             location = /40x.html {
     82         }
     83
     84         error_page 500 502 503 504 /50x.html;
     85             location = /50x.html {
     86         }
     87     }
     88
     89
     90
     91     server {
     92     server_name itcmedbr.com; # managed by Certbot
     93         root         /usr/share/nginx/html;
     94
     95         # Load configuration files for the default server block.
     96         include /etc/nginx/default.d/*.conf;
     97
     98         location / {
     99         }
    100
    101         error_page 404 /404.html;
    102             location = /40x.html {
    103         }
    104
    105         error_page 500 502 503 504 /50x.html;
    106             location = /50x.html {
    107         }
    108
    109
    110     listen [::]:443 ssl ipv6only=on; # managed by Certbot
    111     listen 443 ssl; # managed by Certbot
    112     ssl_certificate /etc/letsencrypt/live/itcmedbr.com/fullchain.pem; # managed by Certbot
    113     ssl_certificate_key /etc/letsencrypt/live/itcmedbr.com/privkey.pem; # managed by Certbot
    114     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    115     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    116
    117 }
    118
    119     server {
    120     if ($host = itcmedbr.com) {
    121         return 301 https://$host$request_uri;
    122     } # managed by Certbot
    123
    124
    125         listen       80 ;
    126         listen       [::]:80 ;
    127     server_name itcmedbr.com;
    128     return 404; # managed by Certbot
    129
    130
    131 }}
how we can see nginx.conf was updated by certbot.
After all of this now I've a new problem that when I typing my ipaddress:9990 in the browser to open wildfly console I receive the same message "This site can't be reached."

Cezar Apulchro

unread,
Mar 27, 2024, 5:12:52 PM3/27/24
to WildFly
Hi guys, I believe that I know where is my problem, this block
------------
"<deployments>
   <deployment name="test-application.war"
               runtime-name="test-application.war">
       <content sha1="dda9881fa7811b22f1424b4c5acccb13c71202bd"/>
   </deployment>
</deployments>"
------------
show that I must inform the war.deployed file location but I don't know where I puting this on standalone.xml. Until now I don't find any doc of wildfly that explain how do that.

Darran Lofthouse

unread,
Mar 28, 2024, 6:32:18 AM3/28/24
to WildFly
The war gets deployed to the application server, then the application server adds that element to the configuration itself to record the necessary information about the deployment.

What is the current error you are getting that has led you to believe this is now the area to be looking?

Cezar Apulchro

unread,
Mar 28, 2024, 7:53:21 AM3/28/24
to WildFly
Error loged:
vi /var/log/nginx/error.log
--------------
[crit] 132538#0: *116 connect() to unix:/home/ec2-user/buisness/buisness.sock failed (2: No such file or directory)
 while connecting to upstream, client: xxx.xxx.xxx.xxx, server: itcmedbr.com, request: "GET / HTTP/1.1",
 upstream: "http://unix:/home/ec2-user/buisness/buisness.sock:/", host: "itcmedbr.com"

[crit] 132538#0: *116 connect() to unix:/home/ec2-user/buisness/buisness.sock failed (2: No such file or directory)
 while connecting to upstream, client: xxx.xxx.xxx.xxx, server: itcmedbr.com, request: "GET /favicon.ico HTTP/1.1",
 upstream: "http://unix:/home/ec2-user/buisness/buisness.sock:/favicon.ico", host: "itcmedbr.com", referrer: "https://itcmedbr.com/"
----------------
I sended the last msg with base in this link "https://docs.wildfly.org/30/Admin_Guide.html#content-repository", "6.3.1. Content Repository" Wildfly Admin Guide.

Cezar Apulchro

unread,
Apr 1, 2024, 10:43:08 AM4/1/24
to WildFly
Hi, I found this example "https://github.com/girirajsharma/wildfly-ssl-examples/blob/master/configuration/wildfly/ssl/standalone.xml" of standalone.xml in this example is shown how to customize deployments block but in my standalone I'm getting this error when restart my wildfly.
My deployments block:
-------------------
 <deployments>
        <deployment name="itcmedbr.war" runtime-name="itcmedbr.war">
            <content sha1="6f17e57c4de1e47a6cd71b1a9c692e6401857d44"/>
        </deployment>
  </deployments>
----------------------
Error in server.log:
----------------------
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add")
failed - address: ([("deployment" => "itcmedbr.war")]) - failure description: "WFLYCTL0212: Duplicate resource [(\"deployment\" => \"itcmedbr.war\")]"
----------------------

Cezar Apulchro

unread,
Apr 1, 2024, 5:42:42 PM4/1/24
to WildFly
Hi, to test my reverse proxy I did the following test:
---------------
 curl -v --resolve service2.example.com:443:127.0.0.1 https://service2.example.com/path1
* Added service2.example.com:443:127.0.0.1 to DNS cache
* Hostname service2.example.com was found in DNS cache
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to service2.example.com (127.0.0.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, [no content] (0):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, [no content] (0):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, [no content] (0):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, [no content] (0):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, [no content] (0):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=itcmedbr.com
*  start date: Mar 25 08:58:52 2024 GMT
*  expire date: Jun 23 08:58:51 2024 GMT
*  subjectAltName does not match service2.example.com
* SSL: no alternative certificate subject name matches target host name 'service2.example.com'
* Closing connection 0
* TLSv1.3 (OUT), TLS alert, [no content] (0):
* TLSv1.3 (OUT), TLS alert, close notify (256):
curl: (51) SSL: no alternative certificate subject name matches target host name 'service2.example.com'
----------------------
I believe that my reverse proxy is right.

Cezar Apulchro

unread,
Apr 5, 2024, 10:52:05 AM4/5/24
to WildFly
Hi, i've a question, in my nginx.conf the $host variable is tested but where is loaded or set this variable?
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

    server {

    server_name itcmedbr.com; # managed by Certbot
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
   

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/itcmedbr.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/itcmedbr.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

    server {
    if ($host = itcmedbr.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen       80 ;
        listen       [::]:80 ;
    server_name itcmedbr.com;

    return 404; # managed by Certbot
}}
------------------------
Thanks.

Ken Wills

unread,
Apr 5, 2024, 11:38:06 AM4/5/24
to Cezar Apulchro, WildFly
Hi Cezar,

On Fri, Apr 5, 2024 at 9:52 AM Cezar Apulchro <razec.a...@gmail.com> wrote:
Hi, i've a question, in my nginx.conf the $host variable is tested but where is loaded or set this variable?


As a reminder this is a list for WildFly, and while people are generally happy to help, nginx configuration questions are likely better addressed to an nginx support list.

Ken
 

Cezar Apulchro

unread,
Apr 7, 2024, 11:02:47 AM4/7/24
to WildFly
Hi, all that I read in the web or I saw in the youtube about configuration of wildfly to deploy an application in the web show the results to load the project with ipaddress:8080/domain.com this manner work to me too but I don't saw or read until now any result that call the project as domain.com in my case itcmedbr.com, somebody can explain this?

Jose Socola

unread,
Apr 8, 2024, 12:44:38 PM4/8/24
to Cezar Apulchro, WildFly
Hi Cezar, 

Did you refer about virtual host? context-root?

image.png

Cezar Apulchro

unread,
Apr 8, 2024, 5:38:19 PM4/8/24
to WildFly
Hi Jose, your post has Step 6, Step 7 and Step 8 is right? I did the changes that you send me but now not even nginx welcome page is being loaded, the result of www.itcmedbr.com or itcmedbr.com in my browser is "This site can't be reached" and my SSL is not working, before these changes my SSL was active.
Result of step 8:
----------
ls /opt/wildfly/standalone/deployments
itcmedbr.war  itcmedbr.war.deployed
----------

Jose Socola

unread,
Apr 8, 2024, 5:58:24 PM4/8/24
to Cezar Apulchro, WildFly
Hi Cezar,

Wildfly looks run correctly, just u need check the nginx, nginx receive 80 and redirect to 8080.



Screenshot 2024-04-08 at 16.51.59.png


Screenshot 2024-04-08 at 16.55.00.png





Cezar Apulchro

unread,
Apr 12, 2024, 5:38:04 PM4/12/24
to WildFly
Hi Jose,
how did you do that? How did you access my login page? Why my login page is don't beam loaded as this that you show me?

Cezar Apulchro

unread,
Apr 13, 2024, 8:45:41 AM4/13/24
to WildFly
Hi Jose,
as you can see my nginx is ok but my page still don't be loaded. I've ask you if was only step 6, step 7 and step 8 that you send me but you.
itcmedbr.jpg

Cezar Apulchro

unread,
Apr 13, 2024, 9:09:00 AM4/13/24
to WildFly
Now I'm receiving this error: 
[crit] 45458#0: *736 connect() to xxx.xxx.xx.xxx:8080 failed (13: Permission denied) while connecting to upstream, client: 185.224.128.38, server: itcmedbr.com, request: "GET / HTTP/1.1", upstream: "http://xxx.xxx.xx.xxx:8080/", host: "xxx.xxx.xx.xxx:80"

Cezar Apulchro

unread,
Apr 13, 2024, 10:45:41 AM4/13/24
to WildFly
I solved this error.

Cezar Apulchro

unread,
Apr 13, 2024, 11:06:23 AM4/13/24
to WildFly
I don't have any type of error in my logs, log of nginx log of wildfly, why  is happens for this error on my browser?

Jose Socola

unread,
Apr 15, 2024, 1:37:24 PM4/15/24
to Cezar Apulchro, WildFly
Hi Cezar, 

Wildfly run on port 8080 port 8080 it's open and we can access with write http://itcmedbr.com:8080 you can see login webpage.
Nginx run on port 443 and 80, and u need to redirect traffic to 8080 if it's the same server u must be conf with localhost or 127.0.0.0 if u hace two different server one for nginx and one for wildfly u need to write ip_address for redirect in local network to wildfly Server.

i'm no expert on nginx but i know u problem is on redirect nginx to wildfly because wildfly open and run correctly.


image.png
image.png
image.png

Regards,
JS 




Cezar Apulchro

unread,
Apr 21, 2024, 5:28:24 PM4/21/24
to WildFly
Hi all,
after changes in my standalone.xml and in my nginx.conf now I am receiving two errors, one error in my standalone.xml and another in my nginx.conf, by what I saw in the web I must to create an security-realm in standalone but after create this block I receive error that is not permited to create this block. When I access my domain in the browser I receive that I don't have certificate this occur after I create itcmedbr.com.p12 file this file is an attempt to use in keystore parameter.
error in server.log:
-------------------------------------------------
2024-04-21 10:43:52,623 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 80) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'itcmedbr.war#itcmedbr_PU'
2024-04-21 10:44:32,512 INFO  [jakarta.enterprise.resource.webcontainer.faces.config] (ServerService Thread Pool -- 109) Initializing Mojarra 4.0.5 for context '/itcmedbr'
2024-04-21 10:44:40,024 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 109) WFLYUT0021: Registered web context: '/itcmedbr' for server 'default-server'
2024-04-21 10:44:41,793 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "undertow"),
    ("server" => "default-server"),
    ("host" => "default-host"),
    ("filter-ref" => "server-header")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.filter.server-header"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["service jboss.undertow.server.default-server.default-host.filter-ref.server-header is missing [jboss.undertow.filter.server-header]"]
}
2024-04-21 10:44:41,800 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "undertow"),
    ("server" => "default-server"),
    ("host" => "default-host"),
    ("filter-ref" => "x-powered-by-header")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.filter.x-powered-by-header"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["service jboss.undertow.server.default-server.default-host.filter-ref.x-powered-by-header is missing [jboss.undertow.filter.x-powered-by-header]"]
}
2024-04-21 10:44:42,234 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 45) WFLYSRV0010: Deployed "itcmedbr.war" (runtime-name : "itcmedbr.war")
2024-04-21 10:44:43,005 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.undertow.filter.server-header (missing) dependents: [service jboss.undertow.server.default-server.default-host.filter-ref.server-header]
      service jboss.undertow.filter.x-powered-by-header (missing) dependents: [service jboss.undertow.server.default-server.default-host.filter-ref.x-powered-by-header]

2024-04-21 10:44:43,665 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2024-04-21 10:44:43,750 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://186.202.57.170:9990/management
2024-04-21 10:44:43,751 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://186.202.57.170:9990
Hi all,
after changes in my standalone.xml and in my nginx.conf now I am receiving two errors, one error in my standalone.xml and another in my nginx.conf, by what I saw in the web I must to create an security-realm in standalone but after create this block I receive error that is not permited to create this block. When I access my domain in the browser I receive that I don't have certificate this occur after I create itcmedbr.com.p12 file this file is an attempt to use in keystore parameter.2024-04-21 10:44:43,769 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 31.0.1.Final (WildFly Core 23.0.3.Final) started (with errors) in 113015ms - Started 1095 of 1298 services (2 services failed or missing dependencies, 323 services are lazy, passive or on-demand) - Server configuration file in use: standalone.xml
-------------------------------------------------------------------------------------------------------------------------------------------------

nginx log error:
----------------------------------------------
[error] 98861#0: *12 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: xxx.xxx.xxx.xxx, server: 0.0.0.0:80
-----------------------------------------------
My nginx.conf:
-----------------------
    listen 80 ssl http2;
    listen [::]:80 ssl http2;


    server_name itcmedbr.com; # managed by Certbot
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
            resolver itcmedbr.com [::1]:5353;

            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-NginX-Proxy true;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_pass http://itcmedbr.com:80;
            proxy_set_header Host $http_host;
            proxy_pass_header Server;
            proxy_cache_bypass $http_upgrade;


        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
   

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443; # managed by Certbot

    ssl_certificate /etc/letsencrypt/live/itcmedbr.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/itcmedbr.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

    server {
    if ($host = itcmedbr.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    return 404; # managed by Certbot


}}
---------------------------------------
I am totally losted.
Thanks.

Cezar Apulchro

unread,
May 13, 2024, 10:44:29 AM5/13/24
to WildFly
Hi all, trying to resolve my problem I removed nginx from my linux but now I am receiving "refused to connect." as result of itcmedbr.com in my browser.
here is part of my standalone.xml:
------------------
 <subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="default-host" default-servlet-container="default" default-server="default-server" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}" default-security-domain="other">
            <byte-buffer-pool name="default"/>
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
                <https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
                <host name="default-host" alias="localhost, itcmedbr.com, www.itcmedbr.com">
                    <location name="/" handler="welcome-content"/>
                    <http-invoker http-authentication-factory="application-http-authentication"/>
                </host>
            </server>
            <servlet-container name="default">
                <jsp-config/>
                <websockets/>
            </servlet-container>
            <handlers>
                <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
            </handlers>
            <application-security-domains>
                <application-security-domain name="other" security-domain="ApplicationDomain"/>
            </application-security-domains>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:webservices:2.0" statistics-enabled="${wildfly.webservices.statistics-enabled:${wildfly.statistics-enabled:false}}">
            <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
            <endpoint-config name="Standard-Endpoint-Config"/>
            <endpoint-config name="Recording-Endpoint-Config">
                <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                </pre-handler-chain>
            </endpoint-config>
            <client-config name="Standard-Client-Config"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:weld:5.0"/>
    </profile>
    <interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
        </interface>
        <interface name="public">
             <inet-address value="${jboss.bind.address:127.0.0.1}"/>
        </interface>
    </interfaces>
    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="http" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="${jboss.mail.server.host:localhost}" port="${jboss.mail.server.port:25}"/>
        </outbound-socket-binding>
    </socket-binding-group>
---------------------
How to solve this? Thanks.

Darran Lofthouse

unread,
May 13, 2024, 11:11:27 AM5/13/24
to WildFly
When you enter a HTTP url in a web broswer e.g. http://example.com the web browser will attempt to connect to port 80 on the address it has resolved home the host name.

I don't know if you have any other firewall settings etc that need to be looked at but it looks as though your server is configured to listen on port 8080 so instead your URL would need to be in the form http://example.com:8080

Cezar Apulchro

unread,
May 13, 2024, 6:10:03 PM5/13/24
to WildFly
Hi Darran when I type itcmedbr.com:8080 as you say the wildfly welcome page is loaded. Another thing is that in all contributions to explain how the wildfly standalone or domain mode work in the web they show ipaddress:8080/example/ then what is the magic to type itcmedbr.com and my webapp be loaded?

Cezar Apulchro

unread,
May 31, 2024, 5:48:08 PM5/31/24
to WildFly
Hi guys, trying to solve my problem I changed my wildfly configuration from standalone to domain mode, in this mode I created my server under the main-server-group now after do the deploy in this mode an directory was created with all my jsp files in the domain servers itcmedbr-server data but when I try to restart my itcmedbr-server in the wildfly console manager I receiving "Boot errors occurred during the start of server itcmedbr-server." and the errors is in these two parameters "/subsystem=undertow/configuration=handler/file=itcmedbr-content" and "/subsystem=undertow/server=default-server/host=default-host/location=/" below is my configuration.
-------------------------
<subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="default-host" default-servlet-container="default" default-server="default-server" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}" default-security-domain="itcmedbr.war">

                <byte-buffer-pool name="default"/>
                <buffer-cache name="default"/>
                <server name="default-server">
                    <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
                    <https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
                    <host name="default-host" alias="itcmedbr.com,www.itcmedbr.com">
                        <location name="/" handler="itcmedbr-content"/>

                        <http-invoker http-authentication-factory="application-http-authentication"/>
                    </host>
                </server>
                <servlet-container name="default">
                    <jsp-config/>
                    <websockets/>
                </servlet-container>
                <handlers>
                    <file name="itcmedbr-content" path="${jboss.home.dir}/opt/wildfly/domain/servers/itcmedbr-server/data/content/91/31e29df82c5045b7cdc38f2dbde66a8adb4021/content/"/>

                </handlers>
                <application-security-domains>
                    <application-security-domain name="other" security-domain="ApplicationDomain"/>
                </application-security-domains>
            </subsystem>
-----------------------------------
Where is the error in this configuration.

Cezar Apulchro

unread,
Jun 17, 2024, 11:24:22 AM6/17/24
to WildFly
Hi all,
I solved the errors of my wildfly configuration but I still receiving "404 Not found" as result of itcmedbr.com in my the browser, I don't have any type of error in wildfly log or nginx log, after change to domain mode was created a directory with my jsp pages, web-inf and meta-inf.
Nobody to tell me why this occur?
Thanks.

Reply all
Reply to author
Forward
0 new messages