I cannot access my main site after trying to install discourse

AI-generated summary

The user wp3 attempted to install Discourse on their main site, which runs WordPress on Ubuntu 20.04 with Nginx. After temporarily uninstalling Discourse, they were unable to access their WordPress site, receiving a privacy error with HTTPS and “Hello World!” with HTTP.

angus re-categorized the post and suggested breaking down the problem into smaller pieces. wp3 ran sudo netstat -tulpn and found no processes on ports 80 and 443, then killed two processes using port 80. However, this did not resolve the issue.

angus noted that Nginx appears not to be running and suggested starting it with sudo systemctl start nginx.

I tried to install discourage on my main site which already runs WordPress. So I run these:

sudo -s
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse


Now I see I have to follow this: Run other websites on the same machine as Discourse

I temporarily uninstalled discourse: ./launcher stop app & rm -r /var/discourse
I know this has to do with port 80 but nuginx configuration file remained unchanged.
When I visit my domain using https I get a privacy error. When I use HTTP, I get: Hello World!

Any idea how I can fix this to run my wordpress site again?

I use Ubuntu 20.04 + Nginx

The Support > WordPress category is for support with the WP Discourse plugin, so I’ve re-categorised this.

You have managed to get into a bit of a pickle! At the risk of pointing out the obvious, the solution will depend on how your server is configured, what commands you’ve run and what files you’ve changed.

I understand that the precipitating cause of this was your attempt to install Discourse, but your request here is not really Discourse-related, it’s more about how you’ve configured your server. That said, if I were in your position I would break down the problem into pieces:

  1. What’s using what ports? Is your wordpress webserver serving on port 80? You can use netstat to figure that out.

    sudo netstat -tulpn
    
  2. Is your webserver (i.e. nginx) correctly pointing to your wordpress files (probably in /var/www/html) ?

  3. Is your SSL certificate valid and properly configured?

Thank you very much for the detailed response! I highly appreciate your help and support.
After running sudo netstat -tulpn I see the below


Why I don’t see any processes on ports 80 and 443? Because I run:

sudo fuser 80/tcp

I saw two processes, I run:

sudo lsof -t -i tcp:80 -s tcp:listen | sudo xargs kill
echo kill $(sudo netstat -anp | awk '/ LISTEN / {if($4 ~ ":80$") { gsub("/.*","",$7); print $7; exit } }')

But even when these processes were running, the website was not accessible.
My webserver (i.e. Nginx) correctly points to my WordPress files. So the answer to the second question is yes.
The SSL is valid and properly configured. The answer to the third question is also yes.

It looks like nginx is not running? Try

sudo systemctl start nginx