Check nginx install without dpkg
See original GitHub issueSummary
Regarding https://github.com/TryGhost/Ghost-CLI/blob/master/extensions/nginx/index.js#L282
isSupported() {
try {
execa.shellSync('dpkg -l | grep nginx', {stdio: 'ignore'});
return true;
} catch (e) {
return false;
}
}
We check Nginx by using a third-party command called dpkg
that is available only on Debian-based distributions.
I use Arch linux and I have nginx installed. I can check it with
isSupported() {
try {
execa.shellSync('nginx -v', {stdio: 'ignore'});
return true;
} catch (e) {
return false;
}
}
Then the command ghost setup nginx
can do everything it needs:
/v/w/ghost> ghost setup nginx
✔ Creating nginx config file at /var/www/ghost/system/files/servername.conf
+ sudo ln -sf /var/www/ghost/system/files/servername.conf /etc/nginx/sites-available/servername.conf
+ sudo ln -sf /etc/nginx/sites-available/servername.conf /etc/nginx/sites-enabled/servername.conf
+ sudo nginx -s reload
✔ Setting up Nginx
Can we not consider using nginx -v
to check for the presence of nginx?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How To Install Nginx on Ubuntu 20.04 - DigitalOcean
Step 1 – Installing Nginx · Step 2 – Adjusting the Firewall · Step 3 – Checking your Web Server · Step 4...
Read more >How to Install and Configure Nginx on Ubuntu 20.04
Step 1: Update Software Repositories · Step 2: Install Nginx From Ubuntu Repositories · Step 3: Verify the Installation · Step 4: Controlling...
Read more >Install and configure Nginx - Ubuntu
Nginx (pronounced as “Engine-X”) is an open source web server that is often used as reverse proxy or HTTP cache. It is available...
Read more >How To Find Out Nginx Version using command line - nixCraft
Check Nginx version command · See if Nginx is compiled with a particular module or not · What to do if I get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you very much @acburdine for following up on this modification request which is clearly not proprietary but which I am very pleased with!
@enguerran I’ve refactored the stack check to use systeminformation’s
services
utility to check ifnginx
is installed by iterating over the list of installed services, rather than distro-specific command likedpkg
.This change will be released with Ghost-CLI 1.15.0.