Need help for self-hosted vps for discourse

Here is my ip: http://120.79.54.248

I have followed this toturial: https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md

everytime I /var/discourse# ./discourse-setup , it just works fine without error:

...
I, [2019-03-05T07:43:52.540576 #14]  INFO -- : > echo "Beginning of custom commands"
I, [2019-03-05T07:43:52.542860 #14]  INFO -- : Beginning of custom commands

I, [2019-03-05T07:43:52.543191 #14]  INFO -- : > echo "End of custom commands"
I, [2019-03-05T07:43:52.545003 #14]  INFO -- : End of custom commands

I, [2019-03-05T07:43:52.545270 #14]  INFO -- : Terminating async processes
I, [2019-03-05T07:43:52.545456 #14]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 69
I, [2019-03-05T07:43:52.546551 #14]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 185
185:signal-handler (1551771832) Received SIGTERM scheduling shutdown...
2019-03-05 07:43:52.547 UTC [69] LOG:  received fast shutdown request
185:M 05 Mar 2019 07:43:52.616 # User requested shutdown...
185:M 05 Mar 2019 07:43:52.616 * Saving the final RDB snapshot before exiting.
2019-03-05 07:43:52.680 UTC [69] LOG:  aborting any active transactions
2019-03-05 07:43:52.686 UTC [69] LOG:  worker process: logical replication launcher (PID 78) exited with exit code 1
2019-03-05 07:43:52.687 UTC [73] LOG:  shutting down
185:M 05 Mar 2019 07:43:52.688 * DB saved on disk
185:M 05 Mar 2019 07:43:52.688 # Redis is now ready to exit, bye bye...
2019-03-05 07:43:52.723 UTC [69] LOG:  database system is shut down
sha256:4047942b8750238d1fc4162bd9b00c2d88f736d8070e41b05d23e52a6462c25e
0284faaf5e514e76ad3fe3eb07f2d1049a1734fd764389defef524086f8428e0
Removing old container
+ /usr/bin/docker rm app
app

+ /usr/bin/docker run --shm-size=512m -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=4 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 -e RUBY_GC_HEAP_INIT_SLOTS=400000 -e RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e DISCOURSE_HOSTNAME=forums.firstlove.life -e DISCOURSE_DEVELOPER_EMAILS=chenli@firstlove.life -e DISCOURSE_SMTP_ADDRESS=smtp.mailgun.org -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=postmaster@sandbox4966eb6a7cfc41eda6aa30b8fd667f6d.mailgun.org -e DISCOURSE_SMTP_PASSWORD=9e9d9cf8f5c95d581334a83e8113a2f5-7caa9475-98ccb58a -e LETSENCRYPT_ACCOUNT_EMAIL=c941968215@gmail.com -h iZwz9amnwgbey2jczh8jntZ-app -e DOCKER_HOST_IP=172.18.0.1 --name app -t -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:76:cc:91:cc:86 local_discourse/app /sbin/boot
05f76dc70b3d8049faa20c607c89410f50158fd90a53187602615e984b75a914

Here is my /var/www/html/:

root@iZwz9amnwgbey2jczh8jntZ:/var/www/html# ls
index.nginx-debian.html

Besides, there is no /var/www/discourse dir on my vps after ./discourse-setup, which can be seen from output of

I, [2019-03-05T07:56:29.201316 #14]  INFO -- : 
I, [2019-03-05T07:56:29.201587 #14]  INFO -- : > cd /var/www/discourse && bash -c "mkdir -p           /shared/{uploads,backups}"
I, [2019-03-05T07:56:29.206025 #14]  INFO -- : 
I, [2019-03-05T07:56:29.206449 #14]  INFO -- : > cd /var/www/discourse && bash -c "ln    -s           /shared/{uploads,backups} /var/www/discourse/public"
I, [2019-03-05T07:56:29.211468 #14]  INFO -- : 
I, [2019-03-05T07:56:29.211752 #14]  INFO -- : > cd /var/www/discourse && bash -c "mkdir -p           /shared/tmp/{backups,restores}"
I, [2019-03-05T07:56:29.216922 #14]  INFO -- : 

I’m not familiary with web(apache/nginx) world, but I heard that the server will display /var/www/html by default. So, where goes wrong?

1 Like

I believe this is fairly straightforward: you are forgetting docker :slight_smile:

Try this:

in /var/discourse:

./launcher enter app

That should get you to the in app directory /var/www/discourse

To come out again just do:

exit

2 Likes

thanks! this is my first time to use docker haha. One more question, ./launcher enter app will lead me into the docker, but how to tell my vps to display the content inside docker’s /var/www/discouorse? As you can see, my ip http://120.79.54.248 is still using var/www/html/

1 Like

If you can the easiest way is to remove the web server on your VPS. Discourse’s docker image has a built in nginx web server that is automatically set up the right way.

4 Likes