Thursday, November 9, 2017

apache 2.2 - Using Passenger with dynamic mass virtual hosting/userdirs



I already have an apache webserver set up, and it is working for PHP.




It has no static VirtualHosts set up, and dynamically routes all requests.



A request for http://example.com/ would be served from the document root /var/www/example.com (VirtualDocumentRoot), and a request for http://example.com/~user/ would be served from the document root /home/user/public_html (mod_userdir). The latter works no matter what the domain.



I would like to be able to serve Ruby on Rails applications, from the root of a document root, or from a subdirectory, using Phusion Passenger. However, it requires me to add some lines to the directive, which obviously isn't there.



I would prefer a solution that does not require root to deploy an application, but this is not critical. I also do not mind a solution that does not use Passenger, if I have the same ease of deployment.


Answer



Unfortunately, this doesn't seem possible. Passenger is completely incompatible with userdirs, and with VirtualDocumentRoot, a separate VirtualHost is required.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...