unable to invoke mod_rest of jabberd, - ejabberd

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

Related

what else to do to enable XML-RPC in 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.

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

Mysql port already in use

180718 12:43:04 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
180718 12:43:04 [ERROR] Do you already have another mysqld server running on port: 3306 ?
180718 12:43:04 [ERROR] Aborting
is there any solution for it? Mysql is running on windows based server.
Please give the best solution..
Either a second instance of MySQL or another service is running on port 3306.
You can either stop the service which is running on port 3306 by
getting the process id of that service:
netstat -a -n -o | find "3306"
and then killing that process (e.g. for process id 1234):
taskkill /pid 1234 /f
or run MySQL on a different port.
I had also faced the problem. I stopped the "docker desktop" app(you have to stop from the app if you stop it from the task manager then it will restart automatically).it works for me.
I had a similar problem, I solved it by executing the command to get the PID using the same port:
netstat -a -n -o | find "3306"
After you get the PID, go to Task manager > Services and right click on the service with the same PID, and press stop.
The issue is because mysql workbench uses port:3306 when you try to connect it through PhP platform and the port can only be used by one app so xampp is deprived of it, the reason it's aborting.

Initializing database failed in MySQL server 8.0.111 on windows 7 64

I'm trying to create MySql Server version 8.0.11 on Windows 7 64bit , I got this :
Here are the logs :
Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file
Beginning configuration step: Updating Windows Firewall rules
Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 5050" protocol=TCP localport=5050
Deleted 2 rule(s).
Ok.
Adding a Windows Firewall rule for MySQL80 on port 5050.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 5050" protocol=TCP localport=5050 dir=in action=allow
Ok.
Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules
Beginning configuration step: Adjusting Windows service
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Updating existing service
Existing service updated
Ended configuration step: Adjusting Windows service
Beginning configuration step: Initializing Database
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.11...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-07-02T23:37:38.137575Z 0 [ERROR] [MY-011071] [Server] Unknown suffix '.' used for variable 'lower_case_table_names' (value '0.0')
2018-07-02T23:37:38.137575Z 0 [ERROR] [MY-011071] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Error while setting value '0.0' to 'lower_case_table_names'
2018-07-02T23:37:38.137575Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-07-02T23:37:38.137575Z 0 [Note] [MY-010120] [Server] Binlog end
Process for mysqld, with ID 6256, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.11.
Database initialization failed.
Ended configuration step: Initializing Database
Can't find from this log if the error is MySql error or something wrong with my windows.
Solved, Just uninstalled everything that belongs to myseql .. restart my pc and installed again but this time I agreed to let the installer get the latest updates .. it worked
For me what worked was that in the installation step, instead of proceeding with the "Developer Default" in the "Choosing as Setup Type" section, I proceeded with the "Full" version. Also, note that in the "Accounts and Roles" section I did "add a user". Then everything worked out well; hope it helps someone.

mysql and gunicorn open connections at the same port

SOME BACKGROUND:
I have created a django app and I am at the point where I want to deploy it. I have looked at multiple options including wsgi but since the new mac os update came about, I can not install mod_wsgi because I do not have apxs or apxs2 on my computer, (Some discussion on web about rights to write in files, If you know more and would like to explain, please do.)
However, I looked into other options to try to deploy the app and I want to use Heroku. I have followed the dev guide for Django deployment until I reached the part where I test using "heroku local web".
THE ISSUE
The problem stems from here because the local mysql server uses the same port that the gunicorn is also trying to use. I have found similar posts on stackoverflow about 'connections in use' but none have shown how to change ports for gunicorn. I have found some open ports available on my localhost but everytime I try to change the mysql ports to those, the connection times out. Therefore, I would like to know how to change the port the Gunicorn connects to so it does not try to connect to the same default port as the mysql which is 3306.
I was serving the django project with the server it came with and the database I am using is mysql for local production. I am trying to connect locally with gunicorn and Heroku now because I feel that if this goes right locally it will probably go right when I attempt to put the project online.
ERROR GIVEN
10:38:52 PM web.1 | [2017-01-08 22:38:52 -0500] [83200] [ERROR] Connection in use: ('0.0.0.0', 3306)
10:38:52 PM web.1 | [2017-01-08 22:38:52 -0500] [83200] [ERROR] Retrying in 1 second.
10:38:53 PM web.1 | [2017-01-08 22:38:53 -0500] [83200] [ERROR] Connection in use: ('0.0.0.0', 3306)
10:38:53 PM web.1 | [2017-01-08 22:38:53 -0500] [83200] [ERROR] Retrying in 1 second.
10:38:54 PM web.1 | [2017-01-08 22:38:54 -0500] [83200] [ERROR] Connection in use: ('0.0.0.0', 3306)
10:38:54 PM web.1 | [2017-01-08 22:38:54 -0500] [83200] [ERROR] Retrying
in 1 second.
MY PROFILE
web: gunicorn project_name.wsgi.application --log-file -
The gunicorn connects when I stop the mysql server, but I get an exception since the project can not connect to the databases.
--Thank you
You can specify the port for Gunicorn as follows -
gunicorn --bind 127.0.0.1:8000
So basically the complete command would be
gunicorn --bind 127.0.0.1:8000 myproject.wsgi:application
You can change 8000 to any of your desired port number.
To install mod_wsgi on MacOS X see:
https://pypi.python.org/pypi/mod_wsgi
All you need to do is pip install mod_wsgi.
You can then use mod_wsgi-express on the command line to run it on an unprivileged port, with all configuration done for you.
Or, you can integrate it with existing Apache installation and manually configure it yourself by running mod_wsgi-express module-config and taking what it outputs and add it to the main Apache configuration for the system. Then add you specific WSGI application configuration to the Apache configuration file as well.