how to deploy war file to Glassfish on port 80? - deployment

When I deploy my application, I can access to my website at the adress: domain.com:8080 but I want to access with the adress domain.com:80.
When I try to access to domain.com, I found a page "index of" with different folders (my .war) but not website. Can I configure something on glassfish, what I need to do?
help me I'm desesperate

To run your app under 80 port you have just to adjust your listener from 8080 to 80 and make the your app as default web app in the virtual server :
log first on the GF admin panel ( default domain.com:4848 )
then go to left menu :
(change port to 80)
1 - Configuration -> 2 - server-config (default) -> 3 - network Config -> 4 - network Listeners -> 5 -select your listener (http-listener-1 if default) ---> 6 - then change the port to 80 and save .
(make it default app)
same thing but make change in default virtual server :
1 - Configuration -> 2 - server-config (default) -> 3 - virtual servers -> 4 - server (by default) ---> 5 - then select your app in the default web app and save
after those restart the server and try .
here are some image so they can help you (sorry screen shot in french)
Config port 80 :
make your app as default in virtual server :

Related

Home Assistant with MODBUS

Integrating a MODBUS installation with Home Assistant
MODBUS controller in the Gavazzi SH2WEB24
Home Assistant Configiguration.yaml:
modbus:
name: SmartHouse
type: tcp
host: <my_ip_addr>
port: 502
# SmartHouse Functions
switch:
platform: modbus
scan_interval: 10
registers:
- name: test1
hub: SmartHouse
slave: 1
register: 352
command_on: 1
command_off: 0
# SmartHouse Convert to light
light:
- platform: switch
name: Light_test1
entity_id: switch.test1
In the Home Assistant startup logs, we see this error:
Logger: pymodbus.client.sync Source:
/usr/local/lib/python3.8/site-packages/pymodbus/client/sync.py:214
First occurred: 10:40:02 (1 occurrences) Last logged: 10:40:02
Connection to (<my_ip_addr>, 502) failed: [Errno 111] Connection
refused
The modbus controller is working fine when used with the Gavazzi (windows) software.
In that software, only IP and port need to be specified, no other credentials.
So why would there be a "connection refused" error addressing it from Home Assistant?
Got it working.
Key is to enable modes in the SHTOOL software: in project settings / communication enable "Modbus TCP/IP"
Also the modes map must be created:
Modbus / Modbus map: click a bulb, expand it and click the 'v' icon to enable the mapping. You can as well do that with all entities to map all of them to modbus.
Note the "use address" field. This is important, and will be used as "register" value below (see **).
This list can be exported to ckv via "Save modbus as CSV"
Go to Home Assistant
Enable the "File Editor" if you didn't do this already.
See this link for more info
Now ediy the config file: Click "File Editor" in the left pane.
Look for /config/configuration.yaml
Then add these entries:
modbus:
name: SmartHouse
type: tcp
host: <your smart house IP>
port: 502
# SmartHouse Functions
switch:
platform: modbus
scan_interval: 10
registers:
- name: light1
hub: SmartHouse
slave: 1
register: <register as noted above **>
command_on: 1
command_off: 0
# SmartHouse Convert to light
light:
- platform: switch
name: light1
entity_id: light1
That's basically it. Now you can use this light e.g. in the dashboard.
Go the dashboard, edit it and add the light.
You can click it to toggle, and see the status as well.

How to upload the siacs HttpUploadComponent for file sharing in openfire localhost

I am implementing the chat appliation using https://github.com/siacs/Conversations in android. There are no image sharing for group chat thats why It required the HTTP Upload component on openfire server (https://github.com/siacs/HttpUploadComponent). I made the changes in config.yml as per required. I am able to connected but in android eu:siacs:conversations:http:upload" not coming in feature list.
config.yml looks like below:-
component_jid: upload.andreis-mac-mini-2.local
component_secret: test
component_port: 5275
storage_path : /Users/enovate/Documents/Jagdish/Test
whitelist:
# andreis-mac-mini-2.local
# - someotherdomain.tld
# - dude#domain.tld
max_file_size: 20971520 #20MiB
http_address: 127.0.0.1 #use 0.0.0.0 if you don't want to use a proxy
http_port: 8080
# http_keyfile: /etc/ssl/private/your.key
# http_certfile: /etc/ssl/certs/your.crt
get_url: http://andreis-mac-mini-2.local
put_url: http://andreis-mac-mini-2.local
expire_interval: 82800 #time in secs between expiry runs (82800 secs = 23 hours). set to '0' to disable
expire_maxage: 2592000 #files older than this (in secs) get deleted by expiry runs (2592000 = 30 days)
user_quota_hard: 104857600 #100MiB. set to '0' to disable rejection on uploads over hard quota
user_quota_soft: 78643200 #75MiB. set to '0' to disable deletion of old uploads over soft quota an expiry runs
If anyone have idea. Please help me. Thanks in advance...

Error when getting the Info from Config Server

I am configuring an Eureka client app, but always the registered port result in 80.
The server config is obtained from Eureka with auto-discovery enabled, when auto-discovery is disabled the port is registered correctly.
The port of the app is assigned only from the command line (--server.port=8080) and deleted in all other properties files (app.yaml, boostrap.yaml and in the config server git repo)
I have notice that in this code:
EurekaClientConfiguration.java
if (port != 0 && instanceConfig.getNonSecurePort() == 0) {
instanceConfig.setNonSecurePort(port);
}
The instanceConfig.getNonSecurePort() never is 0, due to this, the nonSecurePort property is never changed.
I have to register the port property in some other place?
Edited to add some detail:
I mean that my bootstrap.yml has the following lines:
cloud:config:discovery:enabled: true
The yml config is in a github repository and doesn’t have the port assigned
The app is running in the port 8082 with the app param --server.port=8082 But when it is registered in Eureka the port is always 80 instead of 8082
<port enabled="true">8082</port>
<securePort enabled="false">443</securePort>
This cause every based ribbon invocation doesn’t get the correct URL.
I notice that the port is setting correctly in this handler event after the init
EurekaClientConfiguration.java:
public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) {
...
EurekaClientConfiguration.this.port = event.getEmbeddedServletContainer().getPort();
But the flag "running" is active now and doesn't have any effect
Thanks a lot for your help

Apache redirecting to wrong port (how to replace str in varnish)

I have a server configured with varnish on port 80 -> apache2 on port 81
if i go to a folder without a trailing slash ( http://xxx/test ) it tries to redirect to ( http://xxx:81/test/ )
is it possible to stop apache from doing that ? it breaks every single thing from phpmyadmin to svn....
maybe a rule in varnish to drop the :81 from the redirect ? but im not good in configuring advanced varnish..
sub vcl_deliver {
if(resp.http.Location){
set resp.http.Location = regsub(resp.http.Location, ":81/","/");
}
}
(eventually check if the request host matches the response Location: host )

Netbeans 7.3.1 FTP downloading issue on Mac ("I won't open connection to" error..."

I've set up a new PHP project on NetBeans, configured the FTP manager to open a standard (pure) FTP connection to my host...'Test Connection' works successfully ... FileZilla
works fine to log in to host + open + edit files (normal FTP operations).
Just can't get it to download my files in Netbeans ... very frustrating
USER hicksads 331 User hicksads OK. Password required PASS ** 230
OK. Current restricted directory is / PBSZ 0 200 PBSZ=0 TYPE I 200
TYPE is now 8-bit binary CWD /public_html 250 OK. Current directory is
/public_html PWD 257 "/public_html" is your current location CWD
/public_html 250 OK. Current directory is /public_html PWD 257
"/public_html" is your current location SYST 215 UNIX Type: L8 PORT
192,168,100,18,194,238
500 I won't open a connection to 192.168.100.18 (only to 110.142.50.242)
QUIT 221-Goodbye. You uploaded 0 and
downloaded 0 kbytes. 221 Logout.
Any help much appreciated!
I was in a hotel room and needed to download all the files for a project.
When downloading with netbeans on a pc...
I wont open a connection to ip address only to ip address...
after some searching it was this post that helped me.
1. find the remote connection row and click manage
2. most ftp accounts will need port 2
3. at the bottom there is a check box for passive mode. Check it.
test connection and if succesfull you are ready to download.