what else to do to enable XML-RPC in ejabberd? - ejabberd

I have configure ejabberd on my server but when i tried to access ejabberd i am getting the error the port 4560/rpc2 is not responding.I have uncomment out XML-RPC in ejabberd.yml file but after uncomment the ejabberd stop working.Here is the code which i uncomment.
-
## port: 4560
## module: ejabberd_xmlrpc
## maxsessions: 10
## timeout: 5000
## access_commands:
## admin:
## commands: all
## options: []
i have search almost everything what else i have to install or uncomment to enable this port and function.

I have configure ejabberd on my server
You don't mention what ejabberd version you are using. I guess the latest released, ejabberd 19.09.1
but when i tried to access ejabberd i am getting the error the port 4560/rpc2 is not responding.
That may be because you must configure a listener for port 4560 in ejabberd.yml
I have uncomment out XML-RPC in ejabberd.yml file but after uncomment the ejabberd stop working.Here is the code which i uncomment.
You don't mention what error messages are shown in the ejabberd log files. Was it like this?
11:22:26.482 [critical] Failed to start ejabberd application: Invalid value of option listen->3: Unknown option: maxsessions.
It means the option maxsessions is no longer supported by ejabberd_xmlrpc.
I configure it like this:
-
port: 4560
module: ejabberd_xmlrpc
Then I do a simple test, visiting this website:
http://localhost:4560/
And the ejabberd_xmlrpc replies as expected that this GET query is not supported:
400 Bad Request

I have installed the latest version of ejabberd-20.01 so now i am not getting xml-rpc error any more.But now i am facing user register error.

Related

Configure wiki.js(open source) on AWS EC2 instance

I've deployed wiki.js on AWS EC2 instance using docker. With installation Command as follows :
docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "DB_TYPE=mysql" -e "DB_HOST=172.0.0.1" -e "DB_PORT=3306" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" requarks/wiki:2
I've referred wiki.js installation .
DB container and wiki containers are running in the same instance, When I check the above-created container logs, it shows the below output.
Loading configuration from /wiki/config.yml... OK
2021-07-21T16:13:45.924Z [MASTER] info: =======================================
2021-07-21T16:13:45.926Z [MASTER] info: = Wiki.js 2.5.201 =====================
2021-07-21T16:13:45.926Z [MASTER] info: =======================================
2021-07-21T16:13:45.927Z [MASTER] info: Initializing...
2021-07-21T16:13:47.149Z [MASTER] info: Using database driver mysql2 for mysql [ OK ]
2021-07-21T16:13:47.153Z [MASTER] info: Connecting to database...
2021-07-21T16:13:47.189Z [MASTER] info: Database Connection Successful [ OK ]
2021-07-21T16:13:47.237Z [MASTER] warn: DB Configuration is empty or incomplete. Switching to Setup mode...
2021-07-21T16:13:47.238Z [MASTER] info: Starting setup wizard...
2021-07-21T16:13:47.477Z [MASTER] info: Starting HTTP server on port 3000...
2021-07-21T16:13:47.478Z [MASTER] info: HTTP Server on port: [ 3000 ]
2021-07-21T16:13:47.482Z [MASTER] info: HTTP Server: [ RUNNING ]
2021-07-21T16:13:47.482Z [MASTER] info: πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»πŸ”»
2021-07-21T16:13:47.483Z [MASTER] info:
2021-07-21T16:13:47.483Z [MASTER] info: Browse to http://YOUR-SERVER-IP:3000/ to complete setup!
2021-07-21T16:13:47.483Z [MASTER] info:
2021-07-21T16:13:47.483Z [MASTER] info: πŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”ΊπŸ”Ί
But when I run container IP + port into the browser it shows This site can't be reached
I've already opened ports 80, 443, and 3000 inside the security group attached with this instance. Unable to figure out the reason, why it's not loading wiki.js on the running URL.
It works deliberately in a local docker container, but not in a remote container. Can anyone please help me with this, any help would be appreciated.Thanks in advance.
Same log output but with Postgre in the version I got. I managed to get it working by just running docker start wiki, following the installation process in Wiki.js website.
Have you set the inbound rules of the instance to allow you access over HTTP (not HTTPS)? If yes, you access the instance by just browsing its IP address (No port either as suggested). This is consistent with the local container I set up too.
Make sure the instance has an inbound rule/security group that supports HTTP requests (IPv4 version, TCP protocol, Port range of 80 and the appropriate Source depending on your case).

How to know where ejabberd is config

I am working on old project where ejabberd is used. In laravel env file this information is written
JABBER_SERVER=localhost
JABBER_ENV=dev
RPC_SERVER= http://xx.xx.xx.xxx:4560/RPC2
JABBER_HOST=localhost
when i try to find the ejabberd service on my ubuntu server i couldn't.I don't have any idea how i can find ejabberd information because i am getting an error.
2019-12-26 07:54:27.338 [info] <0.23787.5>#ejabberd_c2s:process_terminated:264 (tcp|<0.23786.5>) Closing c2s session for prod6067#localhost/121590970668513998469410: Connection failed: connection closed
2019-12-26 07:54:30.577 [info] <0.339.0>#ejabberd_listener:accept:300 (<0.23789.5>) Accepted connection 115.186.58.62:58101 -> 172.31.42.93:5222
2019-12-26 07:54:31.390 [info] <0.23790.5>#ejabberd_c2s:handle_auth_success:423 (tcp|<0.23789.5>) Accepted c2s SCRAM-SHA-1 authentication for prod6067#localhost by mnesia backend from
2019-12-26 07:54:32.166 [info] <0.23790.5>#ejabberd_c2s:bind:394 (tcp|<0.23789.5>) Opened c2s session for prod6067#localhost/151108589900049164879426
If you can run the ejabberdctl shell script, then it will show many information about where ejabberd is installed:
$ ejabberdctl
...
Optional parameters when starting an ejabberd node:
--config-dir dir Config ejabberd: /etc/ejabberd
--config file Config ejabberd: /etc/ejabberd/ejabberd.yml
--ctl-config file Config ejabberdctl: /etc/ejabberd/ejabberdctl.cfg
--logs dir Directory for logs: /usr/local/var/log/ejabberd
--spool dir Database spool dir: /usr/local/var/lib/ejabberd
--node nodename ejabberd node name: ejabberd#localhost

Ejabberd oauth is not generating token

Can some please explain me how to configure ejabberd rest api support, I could not find any sufficient resource regarding this.
I'm using linux (ubuntu 16.04), so till now I've done apt-get -y install ejabberd and please tell me is there any need to change in config file /etc/ejabberd/ejabberd.yml file.
<pre>
listen:
## To handle ejabberd commands using XML-RPC
-
port: 4560
module: ejabberd_xmlrpc
access_commands: {}
-
port: 5280
## ip: "::"
ip: "0.0.0.0"
module: ejabberd_http
request_handlers:
"/websocket": ejabberd_http_ws
# OAuth support:
"/oauth": ejabberd_oauth
# ReST API:
"/api": mod_http_api
## "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
register: true
captcha: true
tls: false
certfile: "/etc/ejabberd/ejabberd.pem"
# Allow OAuth authentication and token generation
commands_admin_access: configure
commands:
- add_commands: [user, admin, open]
# Tokens are valid for a year as default:
oauth_expire: 31536000
oauth_access: all
api_permissions:
- "admin access":
- who:
- admin
- what:
- "*"
- "!stop"
</pre>
well, I tried as given in the doc, but when I entered the user, server and password at
http://ipaddress:5280/oauth/authorization_token?response_type=token&client_id=localhost&redirect_uri=http://www.razrcorp.com/&scope=get_roster+sasl_auth
i can see Authorization request Application localhost wants to access scope get_roster sasl_auth
but when i fill from user - test#localhost server - ipaddress password - test
It redirect to http://ipaddress:5280/oauth/authorization_token with response
This page isn’t working
ipaddress didn’t send any data.
ERR_EMPTY_RESPONSE
If check the logs it says
2018-04-06 11:33:49.136 [error] <0.671.0> CRASH REPORT Process <0.671.0> with 0 neighbours crashed with reason: call to undefined function oauth2:authorize_password({<<"test#localh
ost">>,<<"35.18.18.32">>}, <<"localhost">>, <<"http://www.razrcorp.com/">>, [<<"get_roster">>,<<"sasl_auth">>], {password,<<"test">>})
You are missing the oauth2 modules in your installation. It seems the package you are using may be incorrect. Maybe you should try with ProcessOne packages: https://www.process-one.net/en/ejabberd/downloads/
They should be complete and contains all the required dependencies.

unable to invoke mod_rest of jabberd,

i have setup a ejabberd server and enable the mod_rest. i could start ejabberd without problem. however if i invoke the rest service,
i have google module_must_be_started_in_vhost, but no luck. anyone could help?
Error from ejabberbctl live
22:18:13.881 [error] CRASH REPORT Process <0.492.0> with 0 neighbours crashed with reason: {module_must_be_started_in_vhost,mod_rest,<<"xjt.cloudapp.net">>} in mod_rest:try_get_option/3 line 107
22:18:13.881 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.492.0> exit with reason {module_must_be_started_in_vhost,mod_rest,<<"xjt.cloudapp.net">>} in context child_terminated
-
port: 5285
module: ejabberd_http
hosts:
- "xjt.cloudapp.net"
request_handlers:
"/rest": mod_rest
Have you installed mod_rest?
I think this is right..
ejabberdctl modules_update_specs
ejabberdctl module_install mod_rest

Zabbix JMX Tomcat monitoring

I have been trying to setup Zabbix to monitor my 2 tomcat servers on 2 different Amazon EC2 machines, but in vain.
The Z on the host is green, however te JMX is red with these errors
- ZBX_TCP_READ() failed: [4] Interrupted system call
- Someother error [111] connection refused
and many such errors, one after another, in the sense I resolve an error to see one more new error popping up.
These are some assumptions
All the machines run Ubuntu 12.10 and later
Server's IP address: 66.55.12.120 (Runs Zabbix server v2.2.4 (revision 46772) (23 June 2014) )
Agent's IP address: 87.52.45.198 ( Runs Zabbix agent v2.2.2 (revision 42525) (12 February 2014) )
My local machine's IP address: 76.89.54.111
Here is what I've done so far.
On Server Side:
1) Installed Zabbix_server using sudo apt-get install zabbix-server-mysql.
2) The GUI, mysql database all have been installed and configured.
3) The following are the only 3 changes that I've made in the file /etc/zabbix/zabbix_server.conf
...
JavaGateway=localhost
JavaGatewayPort=10052
StartJavaPollers=5
...
4) The Zabbix Java gateway was installed using sudo apt-get install zabbix-java-gateway.
5) The following are the only 3 changes that I've made in the file
/etc/zabbix/zabbix_java_gateway.conf
...
LISTEN_IP="127.0.0.1"
LISTEN_PORT=10052
START_POLLERS=5
...
On Client Side:
1) Installed Zabbix Client using
sudo apt-get install zabbix-agent
2) The following are the only 3 changes that I've made in the file
/etc/zabbix/zabbix_agentd.conf
...
Server=66.55.12.120
StartAgents=5
ServerActive=66.55.12.120:10051
Hostname=Security-test-JMX-EC2
... <br />
3) The Hostname is the same as the one that is mentioned while creating the Host on the GUI.
I believe that there are some issues with the IP and ports. So, here are the outbound rules for both the machines as obtained from Amazon EC2 Security Groups for the machines
OUTBOUND RULES for SERVER SECURITY GROUP:
Type Protocol Port Source Reasoning
Custom- TCP 8080 0.0.0.0/0
TCP Rule
All ICMP All N/A 0.0.0.0/0
Custom- TCP 10052 27.52.52.128/32 For access from Agent
TCP Rule
Custom- TCP 8081 76.84.120.130/32 To access Zabbix GUI from-
TCP Rule -my local machine's web browser
Custom- TCP 10051 27.52.52.128/32 As the agent responds to-
TCP Rule -the server on Port 10051TCP Rule-
-Must allow inbound communications-
- from the agent.
Custom- TCP 11000 27.52.52.128/32 The agent's JMX reporting-
TCP Rule -happens on port 11000(not on 12345).
OUTBOUND RULES for CLIENT SECURITY GROUP:
Type Protocol Port Source
HTTPS TCP 443 0.0.0.0/0
Custom- TCP 10050 66.55.12.120/32
TCP Rule
Custom- TCP 10052 66.55.12.120/32
TCP Rule
Custom- TCP 11000 66.55.12.120/32
TCP Rule
HTTP TCP 80 76.89.54.111/32
Custom- TCP 8080 76.89.54.111/32
TCP Rule
Custom- TCP 8443 76.89.54.111/32
TCP Rule
What am I missing? Please guide me.
Any help is appreciated.
Thanks
Goutham
If you can, then run VisualVm (probably using a tunneled X session) on the zabbix host, and see if you can connect to the target JVM with that. If you can't connect from that, you won't be able to connect from Zabbix.
Try with the following CATALINA_OPTS, replacing with the IP on the target that you want JMX to listen on:
export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=falseom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=<LOCAL_IP>"
This will disable all JMX security so be aware!
Once you hopefully get it to connect, the "Tomcat JMX" items in Zabbix are also all incorrect! e.g.
Incorrect Zabbix default:
jmx["Catalina:type=GlobalRequestProcessor,name=http-8080",bytesReceived]
Correct entry:
jmx["Catalina:type=ThreadPool,name=\"http-bio-8080\"", bytesReceived]
Note the escaped quotes and incorrect thread name. Add the Mbeans plugin to VisualVM, and use that to browse the MBeans on the target VM, and check the Zabbix names.
It does work eventually, but is a real pain to setup. Zabbix is however one of the few open source monitoring tools that supports JMX at all!
By default, JMX does not work very well with firewalls. You might find related bug reports on Zabbix tracker useful: ZBX-5326 and ZBX-6815. The first one contains a workaround for Tomcat which might work for you.
#gvatreya wrote:
Server: (Runs Zabbix server)
Agent: (Runs Zabbix agent)
It looks like you have to start Zabbix Java gateway as well on host where it is installed (it is a daemon/service).
I configured as follows:
Server: (Runs Zabbix server, Zabbix Java gateway)
Agent: (Runs Zabbix agent)
I think it is possible to install it on a dedicated host.
Have you tried adding -Djava.net.preferIPv4Stack=true to the VM options?
to make it work add next java_opts to your tomcat startup script
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=2345
-Dcom.sun.management.jmxremote.rmi.port=12345
-Djava.rmi.server.hostname=<tomcat_hostname>