There are some examples (http://www.ejabberd.im/extauth) about the exteranl authentication of ejabbered.
we now use apache+tomcat+ejabbered+jwchat.
Tomcat is installed in directory c:\program files\tomcat
ejabbered is installed in directory c:\program files\ejabbered
I want to write a authentication file(in jsp,java..). where should I put it, in the directory of tomcat or ejabbered?
How to config the ejaberred.cfg?
My configuration is set as
{auth_method, external}.
{extauth_program, "/jwchat/test.jsp"}.
,but I got the following error message when ejabbered is started:
Error in process <0.239.0> on node 'ejabberd@atteam' with exit value:
"{einval,[{erlang,open_port,[{spawn,"/jwchat/test.jsp"},[{packet,2}]]},{extauth,init,2}]}"
Can anybody help? thank you in advance.
The extauth program is
The extauth program is started by ejabberd on start so on ejabberd.cfg you should put the full path to the executable.
Same Error
I'm getting the same error even I have my ejabberd.cfg pointing to the FULL PATH of the executable script.
Error in process <0.274.0> on node 'ejabberd@localhost' with exit value: {einval,[{erlang,open_port,[{spawn,"C:\jabbertest\extauth.php"},[{packet,2}]]},{extauth,init,2}]}
Please help
Maybe format of string?
I'm getting the same error even I have my ejabberd.cfg pointing to the FULL PATH of the executable script.
Error in process <0.274.0> on node 'ejabberd@localhost' with exit value: {einval,[{erlang,open_port,[{spawn,"C:\jabbertest\extauth.php"},[{packet,2}]]},{extauth,init,2}]}
It seems you are using Windows. Maybe your problem is in the format of the string.
If you currently have "C:\jabbertest\extauth.php" in ejabberd.cfg, try putting "C:\\jabbertest\\extauth.php". Or the opposite.
Still the same..
I tried
"C:\\jabbertest\\extauth.php"
"C:\/jabbertest\/extauth.php"
"C:/jabbertest/extauth.php"
and getting the same error.
Some ideas
Error in process <0.274.0> on node 'ejabberd@localhost' with exit value: {einval,[{erlang,open_port,[{spawn,"C:\jabbertest\extauth.php"},[{packet,2}]]},{extauth,init,2}]}
Ah, sorry, I never used extauth in Windows, only in Linux. I'll try to give some hints, maybe they help you to find the correct solution.
The code in ejabberd that generates this error is called when ejabberd starts: it attempts to start your extauth script, and fails.
So, you must specify the full path of a program that should be executable. If you specify a php script, then I guess you have PHP installed in such a way that the script can be executed as-is. Maybe you can also specify something like this: "C:\\PHP-5.0.0\\php.exe C:\\jabbertest\\extauth.php"
You can repeat the error easily, and investigate what is the correct value:
You can find more information of theopen_port function