![]() Goto Settings -> Writing and check that the XML-RPC option is on (it is off by default). Adding authentication via XML-RPC to Wordpressįirst, before continuing, ensure that you have XML-RPC turned on in your Wordpress Dashboard. Restart your server to apply the configuration settings (after re-uploading your settings file). ![]() Modify the line beneath to read something like (or wherever you put the auth script): Uncomment this line and the line beneath it. Goto your Ejabberd configuration folder (mine is /opt/ejabberd-2.1.4/conf) - open "ejabberd.cfg". Otherwise, it should work out of the box with relatively little configuration (once you've installed the WordPress plugin). If you're having problems, try changing lines 167 and 176 to remove the https (replace with http). Note, this part is heavily borrowed from - however, I've essentially stripped out the MySQL code and added support for Wordpress's in-built XML-RPC libraries (this doesn't use the in-built PHP function calls as you need to recompile PHP to enable them, which isn't a general solution). To build this cleanly, we're going to be authenticating via XML-RPC with Wordpress. It tests for user logins (authenticating by username+password) and also checking for user existence on the system (check if a given username exists). This is simply a PHP file that resides somewhere on your webserver (may as well place it in an Ejabberd install directory). Add a new XML-RPC method to Wordpress to allow user-login checking.Configure Ejabberd to use the authentication script.An authentication script for Ejabberd to communicate with Wordpress.I'm pretty nifty at hacking about with Wordpress, so thought I'd challenge myself to do it as neatly as possible. Then, restart your ejabberd instance – it will now use the MariaDB database! Please note that the Mnesia database will still be started up and used for non-persistent data and clustering.I was recently installing Ejabberd and wanted to integrate it with a Wordpress installation. Now, add default_db: sql and auth_method: sql to your ejabberd.yml configuration file: default_db: sql It’s a good practice to remove the /tmp/mnesia.sql after we are done with it. Mysql -h localhost -D ejabberd -u ejabberd -p < /tmp/mnesia.sql ejabberdctl export2sql /tmp/mnesia.sql Let’s first migrate Mnesia data into our new SQL database using ejabberdctl – we first export the data into a mnesia.sql file, and then we import it into the MariaDB database: cd /opt/ejabberd-21.01/bin/ Migrating Mnesia data to MariaDB databaseĪt this point, if you restart your ejabberd, it won’t be using MariaDB just yet. Edit your ejabberd.yml config and add the following settings, where password refers to the ejabberd MariaDB user: sql_type: mysql Now that our MariaDB tables are ready, we need to configure ejabberd to use this MySQL-compatible database. ![]() To verify that everything is correct, run a command to display all the database tables, again using the ejabberd MariaDB user, and the output should look something like that: echo "SHOW TABLES " | mysql -h localhost -D ejabberd -u ejabberd -p -table Mysql -h localhost -D ejabberd -u ejabberd -p < mysql.sql This time, we are switching to using the ejabberd MariaDB user, and the Enter password prompt is asking for the password we just specified in the GRANT command above: wget The Enter password prompt is again asking about the root MariaDB user: echo "GRANT ALL ON ejabberd.* TO IDENTIFIED BY 'password' " | mysql -h localhost -u root -pįinally, let’s download the latest ejabberd SQL schema and load it into our database. Next, let’s create a dedicated ejabberd user authenticated with a password, and assign it to this database. To get MariaDB ready for ejabberd, we need to create a new database, its user, and then populate the database with the ejabberd SQL schema.įirst, let’s create the database using your MariaDB root user: echo "CREATE DATABASE ejabberd " | mysql -h localhost -u root -p Then run the installation wizard and follow the instructions: mysql_secure_installation To install MariaDB simply use: apt-get install mariadb-server I have updated my ejabberd to version 21.01 (the update process is the same as the initial ejabberd installation, so check my first tutorial). We assume the usual Debian configuration as in my previous tutorials. ProcessOne experts will make your communication scalable. Today, I will show you how to install MariaDB, a MySQL-compatible database, migrate your data and configure ejabberd to use MariaDB instead of Mnesia. It is great for home and small office environments, but in larger companies, as the amount of chat logs and users grows, we need more scalability. By default, ejabberd uses the Mnesia internal database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |