New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set up 2 ghost instances on one domain #857

Open
sneurgaonkar opened this Issue Nov 28, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@sneurgaonkar

sneurgaonkar commented Nov 28, 2018

Server - AWS EC2
OS - Ubuntu 18.04.1
Node - 8.13.0
NPM - 6.4.1
MySQL - 14.14
Nginx - 1.14.0

I tried setting up two Ghost Instances on a single domain.

http://example.com/blog1
http://example.com/blog2

I created two directories blog1 and blog2 in my www folder. I installed Ghost via ghost install command in both of them.

The installation in the first folder executes flawlessly. But when I'm trying to install in the second folder, it overwrites the nginx conf file.

So when I start ghost, it starts the second instance and not the first one.

PS - I fixed this problem by setting up the nginx and systemd configuration files manually.

@sneurgaonkar sneurgaonkar changed the title from Setting up 2 blogs on one domain to Cannot set up 2 ghost instances on one domain Nov 28, 2018

@acburdine

This comment has been minimized.

Member

acburdine commented Dec 1, 2018

@sneurgaonkar tested this locally - I figured out what the issue is here.

Ghost-CLI by default creates the configuration file and names it with the base url. When you run ghost install on a new blog, it checks to see if any configuration file with the base url already exists. Because you're setting up two blogs on the same domain, it sees that you've already got a nginx config file for the domain and skips setup.

This is something we probably can fix in the CLI at some point, but it's a bit of a complicated fix as it involves modifying the existing nginx config file and adding a new location block for the second subfolder. It's also somewhat tricky because ghost uninstall by default removes the nginx config, so if you have two blogs using the same nginx config, then uninstalling one would break the other.

@sneurgaonkar

This comment has been minimized.

sneurgaonkar commented Dec 2, 2018

@acburdine yes, I understand that this might be a complicated fix.

So far, I didn't get any error when I uninstalled only one instance of Ghost. The other one was still running. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment