Discourse + VestaCP


(Hosein Naseri) #1

I have found two topics, first and second, about installing discourse alongside VestaCP control panel; but in both of them, the issue seems to have not been solved, or at least it’s not posted.

I have followed these steps:

1- installed discourse on a fresh Ubuntu 14 according to the 30 minutes installation guide.

2- Did
cd /var/discourse ./launcher stop app
according to this guide.

3- Installed VestaCP.

4- Changed the container definition and created discourse.conf file according to the mentioned guide.

5- restart nginx and rebuilt the app.

However It sounds like something is wrong and I can’t access my discourse forum at talk.zabanshenas.com .

I really like VestaCP and I had a great experience with it. So any help to solve this problem would be so much appreciated.


Preview-digest error
Problem with discourse in a subfolder
How should I enable letsencrypt while discourse is beside other websites
(Hosein Naseri) #2

I thought it might help. When I add another website in vestacp, its nginx.conf is like this:

server {
    listen      130.185.73.12:80;
    server_name server.zabanshenas.com www.server.zabanshenas.com;
    error_log  /var/log/apache2/domains/server.zabanshenas.com.error.log error;

    location / {
        proxy_pass      http://130.185.73.12:8080;
        location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|odt|ods|odp|odf|tar|wav|bmp|rtf|js|mp3|avi|mpeg|flv|html|htm)$ {
            root           /home/admin/web/server.zabanshenas.com/public_html;
            access_log     /var/log/apache2/domains/server.zabanshenas.com.log combined;
            access_log     /var/log/apache2/domains/server.zabanshenas.com.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }

    location /error/ {
        alias   /home/admin/web/server.zabanshenas.com/document_errors/;
    }

    location @fallback {
        proxy_pass      http://130.185.73.12:8080;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include /home/admin/conf/web/nginx.server.zabanshenas.com.conf*;
}

server {
    listen      130.185.73.12:80;
    server_name zabanshenas.com www.zabanshenas.com;
    error_log  /var/log/apache2/domains/zabanshenas.com.error.log error;

    location / {
        proxy_pass      http://130.185.73.12:8080;
        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
            root           /home/admin/web/zabanshenas.com/public_html;
            access_log     /var/log/apache2/domains/zabanshenas.com.log combined;
            access_log     /var/log/apache2/domains/zabanshenas.com.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }

    location /error/ {
        alias   /home/admin/web/zabanshenas.com/document_errors/;
    }

    location @fallback {
        proxy_pass      http://130.185.73.12:8080;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include /home/admin/conf/web/nginx.zabanshenas.com.conf*;
}


(Daffy Chu) #3

I was able to install discourse along with other control panels with the use of Haproxy. Maybe you could give Haproxy a try? It’s quite simple. I had a support thread on this before, maybe u can take a look at it? There’s the configuration that I also used before in that thread

Hope this helps a little. Haproxy solves quite a lot of issues for me :smiley:


#4

This was my config when I was running discourse beside VestaCP

server {
listen      22.222.22.222:80;
server_name discourse.mydomain.xyz www.discourse.mydomain.xyz;
error_log  /var/log/apache2/domains/discourse.mydomain.xyz.error.log error;
access_log     /var/log/apache2/domains/discourse.mydomain.xyz.log combined;
access_log     /var/log/apache2/domains/discourse.mydomain.xyz.bytes bytes;

location / {
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
proxy_http_version 1.1;
}

include /home/admin/conf/web/nginx.discourse.mydomain.xyz.conf*;
}

Of course make sure to install nginx with vestacp. And you need to use web socket template for discourse to make this work.


How should I enable letsencrypt while discourse is beside other websites
(Hosein Naseri) #5

thank you very much. Now I have Discourse running alongside VestaCP :slight_smile:


#6

Hey could someone help me with this same installation? VestaCP is already installed with nginx but im new to these things. Tried the 30-minute guide but had some errors during the ‘Install Docker / Git’ part. Running Ubuntu 16.04… i can give ssh access for trusted person.


(Hosein Naseri) #7

I made it working but I installed discourse first, then installed vestacp.