Reputation: 6863
My server runs on apache, but Ghost requires node.js to be hosted. Rest of my website runs on apache. How can I make it run on a subdomain of my website without it interfering with other applications?
Upvotes: 1
Views: 341
Reputation: 1
Using mod proxy will be a good choice. Here is a small template:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName your-url.com
ServerAlias www.your-url.com
ProxyRequests off
ProxyPass / http://127.0.0.1:2368/
ProxyPassReverse / http:/127.0.0.1:2368/
</VirtualHost>
But if you haven't use Proxy mode before, please use this command:a2enmod proxy
before you restart your Appache service.
Upvotes: 0
Reputation: 1497
You can rewrite the url to redirect on the port of your nodejs-app:
RewriteEngine On
RewriteRule ^nodeapp/(.*) http://localhost:3000/$1 [P]
If your app starts at port 3000, you can access it at: http://www.your-domain.com/nodeapp/...
Upvotes: 1
Reputation: 2418
Use apache mod proxy.
Setup your virtual host configuration to proxypass it to the port which ghost is listening on.
Upvotes: 0