System Information
-
Strapi Version: 3.4.1
-
Operating System: macOS Catalina
-
Database: sqllite3 (latest)
-
Node Version: 12.16.3
-
NPM Version: 6.14.4
-
Yarn Version: 1.22.10
Hello all,
I’m a total newbie at Strapi/OpenLiteSpeed, so I feel like I have to resort to posting on here in the hopes that someone can provide me guidance at a solution.
So this is where I am now…
I’ve posted to the OpenLiteSpeed forums already with little to no response, so I feel like I have to post here next because it doesn’t seem clear if the issue lies with Strapi or OLS.
I have Strapi built into my project (website) and have since configured its virtual host through FileZilla to the DigitalOcean droplet as well as OLS. Along with that, I have configured its listener through OLS. Under the virtual hosts ‘context’ section of OLS, I have also designated a startup file to be what the Strapi docs designate to be:
const strapi = require('strapi'); strapi().start();
When going to the ip address of my project. When I try going to that ip address all I receive in response is a 500 internal server error/requested timeout.
Please let me know if you need more info on my current environment, etc. as this has been a problem for me for over a week now. Thanks for your help, good people.
Can you check with curl from your droplet if your app is running?
curl http://localhost:1337
Replace with your host/port if they are different.
There is no need to use the server.js file. I would also recommend using pm2 to run your project in production by using ecosystem config:
module.exports = {
apps: [
{
name: 'your-app-name',
script: 'npm',
args: 'start',
env: {
NODE_ENV: 'production',
},
exp_backoff_restart_delay: 100,
},
],
};
Then you can check the logs with pm2 logs
.
You can take a look at the useful tutorial from digitalocean on how to set-up a nodejs app with pm2, but instead of using the
I did a curl
at the IP address of my droplet (if that’s what you meant) and got this:
<html>
<head>
<title>500 Internal Server Error</title>
</head>
<body>
<h2>Request Timeout</h2>
<p>This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.
</p>
</body>
</html>
(I don’t know if I mentioned this before, but my goal is to run strapi in the browser at my droplet ip address without the need of ssh-ing into my droplet.)
So, I deleted the server.js file that I am guessing comes with the droplet, and I am messing around with pm2. I have my ecosystem.config.js file fully configured (according to the docs) at the moment, and I performed a pm2 start ecosystem.config.js
in my root folder (/usr/local/lsws/Strapi/html/node
) on my droplet. Not sure what next steps are, if any? I am still unable to access strapi at my droplet ip now in the browser, unfortunately.
Sunnyson, did you know your post cut off, though? I’d be interested to see what else you had to say.
Thanks for your help!
I just had a thought. I ran this on my droplet: sudo lsof -i -P -n | grep LISTEN
and noticed litespeed is listening on port 80, despite me setting up (via OLS) strapi to listen on port 80 at the droplet ip address and configuring virtual hosts? Is there some kind of conflict going on, though?
To troubleshoot your Strapi and OpenLiteSpeed setup:
- Check error logs for insights.
- Verify server configuration.
- Test the server without Strapi.
- Confirm proper Strapi setup.
- Check server requirements.
- Seek community or support help.
Include specific details when seeking assistance.