Skip to content

Issues getting Flarum to work on new host

Solved Configure
65 4 29.6k 1
  • wrote on last edited by phenomlab
    #1

    i have created a DB and imported DB but i could not find any user assigned to it in PHPmyadmin am i missing anything?

  • i have created a DB and imported DB but i could not find any user assigned to it in PHPmyadmin am i missing anything?

    wrote on last edited by
    #2
  • wrote on last edited by
    #3

    @phenomlab

    Failed to save user : SQL drop user if exists 'asku@ask.domain.com'@'localhost' failed : String 'asku@ask.domain.com' is too long for user name (should be no longer than 32)
    

    looks like my domain name is too big, never thought this will be an a issue 😄 how to handle this?

  • @phenomlab

    Failed to save user : SQL drop user if exists 'asku@ask.domain.com'@'localhost' failed : String 'asku@ask.domain.com' is too long for user name (should be no longer than 32)
    

    looks like my domain name is too big, never thought this will be an a issue 😄 how to handle this?

    wrote on last edited by
    #4

    @Hari Looks like you are attempting to rename the existing user ? I wouldn’t do that.

    Login to MySQL as root, and run

    show create table mysql.user

    What’s the output of that command ?

  • @Hari Looks like you are attempting to rename the existing user ? I wouldn’t do that.

    Login to MySQL as root, and run

    show create table mysql.user

    What’s the output of that command ?

    wrote on last edited by Hari
    #5

    @phenomlab

    localhost/		https://ip/phpmyadmin/index.php?route=/server/sql
    Your SQL query has been executed successfully.
    
    show create table mysql.user;
    
    
    
    user	CREATE TABLE `user` (
      `Host` char(255) CHARACTER...
    

    as root i could not able to grant permission to a user

    cf1f3c2b-cf98-4755-bb5e-9f47d4211f93-image.png

  • @phenomlab

    localhost/		https://ip/phpmyadmin/index.php?route=/server/sql
    Your SQL query has been executed successfully.
    
    show create table mysql.user;
    
    
    
    user	CREATE TABLE `user` (
      `Host` char(255) CHARACTER...
    

    as root i could not able to grant permission to a user

    cf1f3c2b-cf98-4755-bb5e-9f47d4211f93-image.png

    wrote on last edited by
    #6

    @Hari This doesn’t look right to me. Can you PM the server details plus a username and password I can use to access and take a look ?

  • @Hari This doesn’t look right to me. Can you PM the server details plus a username and password I can use to access and take a look ?

    wrote on last edited by Hari
    #7

    @phenomlab sure, i have deleted that user and created a new DB and user “askDO” shared logins via PM

    lol, meanwhile i am trying to install composer 😄

    root@ask public_html]# composer require blomastra/flarum-redis:*
    sh: 1: composer: not found
    [root@ask public_html]# mv composer.phar /usr/local/bin/composer
    mv: cannot stat 'composer.phar': No such file or directory
    [root@ask public_html]# php composer-setup.php --install-dir=bin --filename=composer
    Could not open input file: composer-setup.php
    [root@ask public_html]# php composer-setup.php --install-dir=bin --filename=composer
    Could not open input file: composer-setup.php
    [root@ask public_html]#
    
  • @phenomlab sure, i have deleted that user and created a new DB and user “askDO” shared logins via PM

    lol, meanwhile i am trying to install composer 😄

    root@ask public_html]# composer require blomastra/flarum-redis:*
    sh: 1: composer: not found
    [root@ask public_html]# mv composer.phar /usr/local/bin/composer
    mv: cannot stat 'composer.phar': No such file or directory
    [root@ask public_html]# php composer-setup.php --install-dir=bin --filename=composer
    Could not open input file: composer-setup.php
    [root@ask public_html]# php composer-setup.php --install-dir=bin --filename=composer
    Could not open input file: composer-setup.php
    [root@ask public_html]#
    
    wrote on last edited by
    #8

    @Hari said in how can i create a mysql user in virtualmin:

    sure, i have deleted that user and created a new DB and user “askDO” shared logins via PM

    Everything looks to be in order. The user askDO seems to have full access to that database. Is this now working ?

  • @Hari said in how can i create a mysql user in virtualmin:

    sure, i have deleted that user and created a new DB and user “askDO” shared logins via PM

    Everything looks to be in order. The user askDO seems to have full access to that database. Is this now working ?

    wrote on last edited by
    #9

    @phenomlab i have changed the domain in flarum config file to IP but it is not working, trying to install composer now

  • @phenomlab i have changed the domain in flarum config file to IP but it is not working, trying to install composer now

    wrote on last edited by
    #10

    @Hari checking

  • @phenomlab i have changed the domain in flarum config file to IP but it is not working, trying to install composer now

    wrote on last edited by
    #11

    @Hari It’s looking for a Redis install. Is this active ?

    [2022-02-16 11:57:15] flarum.ERROR: Predis\Connection\ConnectionException: Connection refused [tcp://127.0.0.1:6379]

  • @Hari It’s looking for a Redis install. Is this active ?

    [2022-02-16 11:57:15] flarum.ERROR: Predis\Connection\ConnectionException: Connection refused [tcp://127.0.0.1:6379]

    wrote on last edited by
    #12

    @phenomlab yes, after installing composer i am supposed to install redis

  • @phenomlab i have changed the domain in flarum config file to IP but it is not working, trying to install composer now

    wrote on last edited by phenomlab
    #13

    @Hari Did you install composer as per this guide ?

    https://getcomposer.org/download/

    Essentially, it’s this

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
    php composer-setup.php
    php -r "unlink('composer-setup.php');"
    
  • @Hari Did you install composer as per this guide ?

    https://getcomposer.org/download/

    Essentially, it’s this

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
    php composer-setup.php
    php -r "unlink('composer-setup.php');"
    
    wrote on last edited by
    #14

    @phenomlab yes,

    caa5c419-1e66-4c44-a62d-7b4b1ad4ff1e-image.png

  • wrote on last edited by phenomlab
    #15

    @Hari It’s not installed

    6ac11845-ecd3-47bc-8584-b4583fa6c582-image.png

    EDIT: Seems it is installed, but not correctly. You should be able to run this simply as composer. However, php composer.phar will work, but it’s clumsy to type…

  • @Hari It’s not installed

    6ac11845-ecd3-47bc-8584-b4583fa6c582-image.png

    EDIT: Seems it is installed, but not correctly. You should be able to run this simply as composer. However, php composer.phar will work, but it’s clumsy to type…

    wrote on last edited by Hari
    #16

    @phenomlab

    i followed these two guides

    php composer.phar

    https://getcomposer.org/download/
    https://getcomposer.org/doc/00-intro.md

    i think i installed it in multiple places root and public_html

    how can i fix it?

  • @phenomlab

    i followed these two guides

    php composer.phar

    https://getcomposer.org/download/
    https://getcomposer.org/doc/00-intro.md

    i think i installed it in multiple places root and public_html

    how can i fix it?

    wrote on last edited by
    #17

    @Hari Ok. Let me have a look at this for you.

  • wrote on last edited by phenomlab
    #18

    @Hari done. You should now be able to run composer directly as any user (preferably not root) inside the public_html directory.

    Essentially, it needs to be installed as php composer-setup.php --install-dir=/usr/bin --filename=composer

  • @Hari done. You should now be able to run composer directly as any user (preferably not root) inside the public_html directory.

    Essentially, it needs to be installed as php composer-setup.php --install-dir=/usr/bin --filename=composer

    wrote on last edited by
    #19

    @phenomlab sir, do i need to move any files now? or did you fix it ?

  • @phenomlab sir, do i need to move any files now? or did you fix it ?

    wrote on last edited by
    #20

    @Hari Fixed. No need to move anything. It should just “work” 🙂


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee ☕
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • 5 Votes
    13 Posts
    3k Views
    DownPW
    'use strict'; const winston = require('winston'); const user = require('../user'); const notifications = require('../notifications'); const sockets = require('../socket.io'); const plugins = require('../plugins'); const meta = require('../meta'); module.exports = function (Messaging) { Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser Messaging.notifyUsersInRoom = async (fromUid, roomId, messageObj) => { let uids = await Messaging.getUidsInRoom(roomId, 0, -1); uids = await user.blocks.filterUids(fromUid, uids); let data = { roomId: roomId, fromUid: fromUid, message: messageObj, uids: uids, }; data = await plugins.hooks.fire('filter:messaging.notify', data); if (!data || !data.uids || !data.uids.length) { return; } uids = data.uids; uids.forEach((uid) => { data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0; Messaging.pushUnreadCount(uid); sockets.in(`uid_${uid}`).emit('event:chats.receive', data); }); if (messageObj.system) { return; } // Delayed notifications let queueObj = Messaging.notifyQueue[`${fromUid}:${roomId}`]; if (queueObj) { queueObj.message.content += `\n${messageObj.content}`; clearTimeout(queueObj.timeout); } else { queueObj = { message: messageObj, }; Messaging.notifyQueue[`${fromUid}:${roomId}`] = queueObj; } queueObj.timeout = setTimeout(async () => { try { await sendNotifications(fromUid, uids, roomId, queueObj.message); } catch (err) { winston.error(`[messaging/notifications] Unabled to send notification\n${err.stack}`); } }, meta.config.notificationSendDelay * 1000); }; async function sendNotifications(fromuid, uids, roomId, messageObj) { const isOnline = await user.isOnline(uids); uids = uids.filter((uid, index) => !isOnline[index] && parseInt(fromuid, 10) !== parseInt(uid, 10)); if (!uids.length) { return; } if (roomId != 11) { // 5 Is the ID of the ID of the global chat room. Messaging.getUidsInRoom(roomId, 0, -1); // Proceed as normal. } else { user.getUidsFromSet('users:online', 0, -1); // Only notify online users. } const { displayname } = messageObj.fromUser; const isGroupChat = await Messaging.isGroupChat(roomId); const notification = await notifications.create({ type: isGroupChat ? 'new-group-chat' : 'new-chat', subject: `[[email:notif.chat.subject, ${displayname}]]`, bodyShort: `[[notifications:new_message_from, ${displayname}]]`, bodyLong: messageObj.content, nid: `chat_${fromuid}_${roomId}`, from: fromuid, path: `/chats/${messageObj.roomId}`, }); delete Messaging.notifyQueue[`${fromuid}:${roomId}`]; notifications.push(notification, uids); } };
  • MailGun Not Working NodeBB

    Solved Configure mail mailgun
    6
    1 Votes
    6 Posts
    2k Views
    cagatay
    @phenomlab did it i did not create smtp user on mailgun. everything is working now. [image: 6cc6061f-ed5d-41f6-8eb7-5d98f98b3706-image.png]
  • iFramely self host help

    Solved Configure iframely hosting
    10
    9 Votes
    10 Posts
    4k Views
    phenomlab
    @DownPW https://sudonix.com/topic/331/how-to-install-a-self-hosted-instance-of-iframely-for-use-with-nodebb
  • auto create flarum new discussions in wordpress

    Configure flarum wordpress
    2
    1 Votes
    2 Posts
    1k Views
    phenomlab
    @Hari I think you’re referring to this https://sudonix.com/topic/170/creating-posts-from-rss-feeds-in-flarum However, this code was never designed to work with WordPress, but you could leverage the WP-CLI to do something similar without too much effort.
  • how to change flarum configuration from apache to nginx?

    Solved Configure flarum
    3
    0 Votes
    3 Posts
    1k Views
    phenomlab
    See https://sudonix.com/topic/226/issues-getting-flarum-to-work-on-new-host/28?_=1645013723672
  • SSl expired on virtualmin

    Solved Configure virtualmin ubun server ssl
    18
    3 Votes
    18 Posts
    7k Views
    phenomlab
    @justoverclock Not necessarily. You only need to use this if it fails from the Virtualmin window
  • VirtualMin create virtual server

    Solved Configure
    4
    2 Votes
    4 Posts
    2k Views
    phenomlab
    @justoverclock correct. You only need to keep an eye on the resources of the droplet itself
  • Virtualmin Letsencrypt Renewal

    Solved Hosting
    13
    1 Votes
    13 Posts
    6k Views
    phenomlab
    @gotwf said in Virtualmin Letsencrypt Renewal: I favor KISS engineering Then I think you’ll be able to appreciate this https://content.sudonix.com/keep-it-simple-stupid/