Skip to content

Issues getting Flarum to work on new host

Solved Configure
65 4 29.6k 1
  • @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” 🙂

  • wrote on last edited by phenomlab
    #21

    @Hari you can go ahead and use sudo apt install redis-server redis-tools to get Redis up and running now. After that, (hopefully) Flarum should boot.

  • @Hari you can go ahead and use sudo apt install redis-server redis-tools to get Redis up and running now. After that, (hopefully) Flarum should boot.

    wrote on last edited by Hari
    #22

    @phenomlab i should also setup cron jobs now searching

    a8d3cb68-e7e3-4176-aed6-33c0e2a65eda-image.png

  • @phenomlab i should also setup cron jobs now searching

    a8d3cb68-e7e3-4176-aed6-33c0e2a65eda-image.png

    wrote on last edited by phenomlab
    #23
  • wrote on last edited by Hari
    #24

    @phenomlab i have added cron job

    updated the config file but flarum is not running on IP
    when i disable redis its not loading inner pages

    c32c944d-3902-4758-85ad-425509ddac1d-image.png

  • @phenomlab i have added cron job

    updated the config file but flarum is not running on IP
    when i disable redis its not loading inner pages

    c32c944d-3902-4758-85ad-425509ddac1d-image.png

    wrote on last edited by
    #25

    @Hari That’s expected because you didn’t run sudo apt install redis-server redis-tools 🙂
    I’ve just done this, and the site now loads.

  • @Hari That’s expected because you didn’t run sudo apt install redis-server redis-tools 🙂
    I’ve just done this, and the site now loads.

    wrote on last edited by Hari
    #26

    @phenomlab i did execute that command, the inner discussion pages still not loading

    30fcfcea-fa3c-4705-96d8-b7cde08bf089-image.png

  • @phenomlab i did execute that command, the inner discussion pages still not loading

    30fcfcea-fa3c-4705-96d8-b7cde08bf089-image.png

    wrote on last edited by
    #27

    @Hari said in Issues getting Flarum to work on new host:

    i did execute that command, the inner discussion pages still not loading

    If you’d executed it, then it wouldn’t have installed when I ran it

    45402bd1-1aa2-4c63-9f2d-14e8225b7976-image.png

    @Hari said in Issues getting Flarum to work on new host:

    the inner discussion pages still not loading

    This is also expected as you haven’t included the .nginx.conf file. Hold on a second.

  • wrote on last edited by
    #28

    @Hari works now - see config below (highlighted section)

    0acbe69e-d9aa-4e72-973c-1a05ad89c0d8-image.png

  • phenomlab phenomlab referenced this topic on
  • @Hari works now - see config below (highlighted section)

    0acbe69e-d9aa-4e72-973c-1a05ad89c0d8-image.png

    wrote on last edited by
    #29

    @phenomlab is this config file?

  • @phenomlab is this config file?

    wrote on last edited by phenomlab
    #30

    @Hari Your NGINX site config file, yes. Essentially, we just include the .nginx.conf file in there so it’s loaded when the site is. You need mod_rewrite for Flarum to work 🙂

  • @Hari Your NGINX site config file, yes. Essentially, we just include the .nginx.conf file in there so it’s loaded when the site is. You need mod_rewrite for Flarum to work 🙂

    wrote on last edited by
    #31

    @phenomlab could you tell me the path of this file


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