You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The nginx part of the setup process fails as the Ghost CLI relies on the presence of the /etc/nginx/sites-available folder and the SSL part fails due to the reliance on the presence of the /etc/nginx/snippets folder. I assume this reliance is because of how Ubuntu and some other package repositories maintain this convention in their version of nginx in their PPA.
Reproduce by installing nginx from nginx.org for Ubuntu, or the corresponding distro's pre-built package. Even before running ghost setup or ghost install, you can see that the two folders do not exist. Ghost-CLI does not create these directories either, but assume their presence. This can be fixed by simply creating them with mkdir -p.
The underlying cause is that different package repositories distribute nginx with different configuration patterns. Some have a conf.d/*.conf pattern (official nginx.org release), some have the sites-available, sites-enabled pattern (older releases that follow this Apache-like style), some have neither and have only the default nginx.conf file (RHEL does this, and the core nginx source code has only this as well).
Both problems are solved simply by creating those directories before running ghost, so sudo mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets resolves this.
Steps to Reproduce
Install any version of nginx distributed without the /etc/nginx/sites-available and /etc/nginx/snippets folder. For Ubuntu, follow these steps. Logs below are from nginx-1.24.0
Run ghost install, or ghost install --no-setup followed by ghost setup
Log file
First, the nginx part:
ghost_server@instance-20240223-1343:~$ cat .ghost/logs/ghost-cli-debug-2024-02-28T20_04_38_506Z.log
Debug Information:
OS: Ubuntu, v22.04.4 LTS
Node Version: v18.19.1
Ghost Version: 5.79.6
Ghost-CLI Version: 1.25.3
Environment: production
Command: 'ghost setup'
Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#' mv /tmp/blog-knravish-me/blog.knravish.me.conf /etc/nginx/sites-available/blog.knravish.me.conf
mv: cannot move '/tmp/blog-knravish-me/blog.knravish.me.conf' to '/etc/nginx/sites-available/blog.knravish.me.conf': No such file or directory
Exit code: 1
--------------- stderr ---------------
mv: cannot move '/tmp/blog-knravish-me/blog.knravish.me.conf' to '/etc/nginx/sites-available/blog.knravish.me.conf': No such file or directory
Then, the SSL part"
ghost_server@instance-20240223-1343:/var/www/blog.knravish.me$ cat ~/.ghost/logs/ghost-cli-debug-2024-02-28T20_11_24_271Z.log
Debug Information:
OS: Ubuntu, v22.04.4 LTS
Node Version: v18.19.1
Ghost Version: 5.79.6
Ghost-CLI Version: 1.25.3
Environment: production
Command: 'ghost setup'
Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#' openssl dhparam -dsaparam -out /etc/nginx/snippets/dhparam.pem 2048
Can't open "/etc/nginx/snippets/dhparam.pem" for writing, No such file or directory
20F0B78BFFFF0000:error:80000002:system library:BIO_new_file:No such file or directory:../crypto/bio/bss_file.c:67:calling fopen(/etc/nginx/snippets/dhparam.pem, w)
20F0B78BFFFF0000:error:10000080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:75:
Exit code: 1
--------------- stderr ---------------
Can't open "/etc/nginx/snippets/dhparam.pem" for writing, No such file or directory
20F0B78BFFFF0000:error:80000002:system library:BIO_new_file:No such file or directory:../crypto/bio/bss_file.c:67:calling fopen(/etc/nginx/snippets/dhparam.pem, w)
20F0B78BFFFF0000:error:10000080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:75:
Technical details
This is automatically output by Ghost-CLI if an error occurs, please copy & paste:
OS: Ubuntu, v22.04.4 LTS
Node Version: v18.19.1
Ghost Version: 5.79.6
Ghost-CLI Version: 1.25.3
Environment: production
Command: 'ghost setup'
Bug submission checklist
Please fill out this checklist to acknowledge that you followed the requirements to submit a bug report.
Tried to find help in the forum & docs
Checked for existing issues
Attached log file
Provided technical details incl. operating system
The text was updated successfully, but these errors were encountered:
Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂
Summary
The nginx part of the setup process fails as the Ghost CLI relies on the presence of the
/etc/nginx/sites-available
folder and the SSL part fails due to the reliance on the presence of the/etc/nginx/snippets
folder. I assume this reliance is because of how Ubuntu and some other package repositories maintain this convention in their version of nginx in their PPA.The reliance can be seen here on /etc/nginx/sites-available and sites-enabled and here on /etc/nginx/snippets which throw errors
Reproduce by installing nginx from nginx.org for Ubuntu, or the corresponding distro's pre-built package. Even before running
ghost setup
orghost install
, you can see that the two folders do not exist. Ghost-CLI does not create these directories either, but assume their presence. This can be fixed by simply creating them withmkdir -p
.The underlying cause is that different package repositories distribute nginx with different configuration patterns. Some have a
conf.d/*.conf
pattern (official nginx.org release), some have thesites-available, sites-enabled
pattern (older releases that follow this Apache-like style), some have neither and have only the defaultnginx.conf
file (RHEL does this, and the core nginx source code has only this as well).Both problems are solved simply by creating those directories before running ghost, so
sudo mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets
resolves this.Steps to Reproduce
/etc/nginx/sites-available
and/etc/nginx/snippets
folder. For Ubuntu, follow these steps. Logs below are from nginx-1.24.0ghost install
, orghost install --no-setup
followed byghost setup
Log file
First, the nginx part:
Then, the SSL part"
Technical details
This is automatically output by Ghost-CLI if an error occurs, please copy & paste:
Bug submission checklist
Please fill out this checklist to acknowledge that you followed the requirements to submit a bug report.
The text was updated successfully, but these errors were encountered: