Site & SSH inaccessible after Discourse installation


(JWT) #1

Hi,

I have rebuild discourse with a new app.yml and the site became inaccessible.
SSH is not connecting. Which means nothing I could do to make changes.
Any advice?

Thanks


(RĂ©gis Hanol) #2

What error are your getting when you’re trying to SSH into your server?


(JWT) #3

It is back alive now. Everything was inaccessible where both my website: phagerx.com and discourse site ask.phagerx.com keep showing waiting for … at browser status.

After a while the sites and the SSH access came back. I re-run ./discourse-setup and it bootstraps again… took a few minutes.
After that, nothing seem change, accessing discourse site routes to the usual website.
Did I set something incorrectly?


(RĂ©gis Hanol) #4

Looks like your server rebooted.


(JWT) #5

I see. Thanks and at least it is still accessible.
I’m having Discourse forum (ask.phagerx.com) and the website (phagerx.com, a Wordpress site) sharing the same AWS instance (server). Discourse forum is a subdomain of the site. Do I set things correctly that both forum and website domain names point to the same server IP address? And that app.yml will differentiate the traffic by having Discourse forum subdomain traffic routed to Discourse platform, not the website, main domain name?

I appreciate if you could shed some light on where I have got it wrong.


(Jay Pfaffman) #6

There are topics about running discourse with other servers. You need to have your main server reverse proxy to discourse.


(JWT) #7

Thanks, @pfaffman, can you suggest any resource I can use to perform reverse proxy?


(Bhanu Sharma) #8

Search for “Running other sites on the same server as discourse”


(JWT) #9

Yes, I have nginx installed in etc/nginx, changed app.yml as suggested. Added discourse.conf by saving in the directory /etc/nginx/sites-enabled/discourse.conf, rebuilt the app, the terminal response with:

bash: launcher: command not found

I then did ./discourse-setup but the process couldn’t be completed, many times it only prompts smtp password and email. Here is the trace of activities (ip address removed for security reason as this is a public forum):

Last login: Fri May 11 11:05:23 2018 from xxx.xxx.xxx.xxx

       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/
[ec2-user@ip-xxx.xxx.xxx.xxx ~]$ sudo su
[root@ip-xxx.xxx.xxx.xxx ec2-user]# cd ..
[root@ip-xxx.xxx.xxx.xxx home]# cd ..
[root@ip-xxx.xxx.xxx.xxx /]# cd var/discourse
[root@ip-xxx.xxx.xxx.xxx discourse]# launcher stop app || true
bash: launcher: command not found
[root@ip-xxx.xxx.xxx.xxx discourse]# sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@ip-xxx.xxx.xxx.xxx discourse]# sudo service nginx reload
[root@ip-xxx.xxx.xxx.xxx discourse]# launcher rebuild app
bash: launcher: command not found
[root@ip-xxx.xxx.xxx.xxx discourse]# ls
bin   containers       image     README.md  scripts  templates
cids  discourse-setup  launcher  samples    shared   Vagrantfile
[root@ip-xxx.xxx.xxx.xxx discourse]# launcher rebuild app
bash: launcher: command not found
[root@ip-xxx.xxx.xxx.xxx discourse]# ^C
[root@ip-xxx.xxx.xxx.xxx discourse]# ./discourse-setup
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin)
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin)
free: invalid option -- '-'
usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]
  -b,-k,-m,-g show output in bytes, KB, MB, or GB
  -l show detailed low and high memory statistics
  -o use old format (no -/+buffers/cache line)
  -t display total for RAM + swap
  -s update every [delay] seconds
  -c update [count] times
  -a show available memory if exported by kernel (>80 characters per line)
  -V display version information and exit
./discourse-setup: line 116: [: : integer expression expected
./discourse-setup: line 125: [: : integer expression expected
The configuration file containers/app.yml already exists!

. . . reconfiguring . . .


Saving old file as app.yml.2018-05-15-074644.bak
Stopping existing container in 5 seconds or Control-C to cancel.
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin)
+ /usr/bin/docker stop -t 10 app
app

free: invalid option -- '-'
usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]
  -b,-k,-m,-g show output in bytes, KB, MB, or GB
  -l show detailed low and high memory statistics
  -o use old format (no -/+buffers/cache line)
  -t display total for RAM + swap
  -s update every [delay] seconds
  -c update [count] times
  -a show available memory if exported by kernel (>80 characters per line)
  -V display version information and exit
Found GB of memory and 1 physical CPU cores
./discourse-setup: line 197: [: : integer expression expected
./discourse-setup: line 201: [: : integer expression expected
./discourse-setup: line 205: 256 *  : syntax error: operand expected (error token is "*  ")

SMTP password? []:
Let's Encrypt account email? (ENTER to skip) [me@example.com]:

Does this look right?

Hostname      :
Email         :
SMTP address  :
SMTP port     :
SMTP username :
SMTP password :

ENTER to continue, 'n' to try again, Ctrl+C to exit:
DISCOURSE_HOSTNAME change failed.
DISCOURSE_DEVELOPER_EMAILS change failed.
DISCOURSE_SMTP_ADDRESS change failed.
DISCOURSE_SMTP_PORT change failed.
DISCOURSE_SMTP_USER_NAME change failed.
DISCOURSE_SMTP_PASSWORD change failed.
web.ssl.template.yml NOT DISABLED--Are you using a non-standard template?
web.ssl.template.yml NOT DISABLED--Are you using a non-standard template?

Unfortunately, there was an error changing

-d This may happen if you have made unexpected changes.
[root@ip-xxx.xxx.xxx.xxx discourse]# launcher rebuild app
bash: launcher: command not found
[root@ip-xxx.xxx.xxx.xxx discourse]# 

Am I missing something? Can you help shed some light?


(Bhanu Sharma) #10

Are you certain that you’re in the /var/discourse directory?

You also have to run ./launcher rebuild app not launcher rebuild app


(JWT) #11

Thanks, @itsbhanusharma managed to rebuild app by manually editing app.yml. But Discourse still doesn’t appear as intend it to for the reason I describe in another Q&A.


(Bhanu Sharma) #12

Let’s continue discussion there.