I have successfully installed the new blogging platform Ghost on my MediaTemple VPS server. It works fine, but I'm having trouble configuring the port numbers. You see, I host about 10 domains on the VPS, so I must have Apache enabled at all times, which means that Ghost has to run on a different port number, i.e. 2368. This means that for me to be able to access the Ghost installation, I have to navigate to my site by specifying that port number: http://my-domain.com:2368. Well, I don't want to. It looks bad. I want to have a nice, clean URL. I scoured the web for a solution and I found one. It works, but can potentially affect my SEO, as the port number might be indexed too, which is duplicate content.

Hmm, I really have no idea how to run Ghost without stopping Apache...

有帮助吗?

解决方案 2

After much investigation and messing about with my server setup, I have figured it out :) Now, my Ghost install runs on Ubuntu 12.04, with nginx 1.4.x. Here's the directive that I'm using:

[...]

 location / {
        alias /var/www/site;                                                             
        proxy_pass http://localhost:2368/;                               
        proxy_set_header Host $host;                                     
        proxy_buffering off;                                       
}

[...]

其他提示

There is a blog post on http://0x1a.us/blog/2013/10/14/ghost-on-apache.html on how to run Ghost with Apache. The suggested virtual host configuration is:

<VirtualHost *:80>
    ServerName your.blog.com
    ProxyPass / http://127.0.0.1:2368/
    ProxyPassReverse / http://127.0.0.1:2368/
    ProxyPreserveHost On
</VirtualHost>

It uses a virtual host configuration for apache and all traffic from port 80 is redirected to the local installation of Ghost which is running on port 2368. Using the virtual port configuration you could also redirect subdomains or subfolders to your Ghost blog.

I had the exact same problem and solved it using ProxyPass directive like the other answer suggested. There are actually a few other ways, see details here: http://blog.daniellam.name/ghost-playing-nice-with-apache-on-multi-site-server/

Also, as of Ghost v0.3.3, subdirectory in your Ghost blog URL will not work yet (e.g. http://www.yoursite.com/ghostblog/). It should be fixed in v0.4.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top