简体   繁体   中英

Debian Jessie Apache 2.4 with PHP sites running & adding Ruby on Rails with Phusion Passenger with virtual hosts

Been at this for days, would appreciate any help.

I've got a web server (dev environment) which runs a few php sites on a working Apache 2.4 install (Debian 8).

Now I've tried multiple configs primarily using the offical guide but when trying the Rails apps location URI it will just display the content of folders - as if passenger isn't firing up.

I've set up a helloapp (rails new helloapp) in my web folder at default (var/www/html/helloapp). I want to reach it at localhost/helloapp. However, visiting that url just lists the directory.

The virtual host config:

<VirtualHost *:80>
ServerName localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
    Allow from all
    Options -MultiViews
    # Uncomment this if you're on Apache >= 2.4:
    #Require all granted
</Directory>

# These have been added:
Alias /helloapp /var/www/html/helloapp/public
<Location /helloapp>
    PassengerBaseURI /helloapp
    PassengerAppRoot /var/www/html/helloapp
</Location>
<Directory /var/www/html/helloapp/public>
    Allow from all
    Options -MultiViews
    # Uncomment this if you're on Apache >= 2.4:
    #Require all granted
</Directory>

I want to run this at localhost, in a sub directory url just like the php sites. This way I can easily reach them internally and also on a external domain I've set up. Running rails s in the rails app folder worksaccording to the terminal (but can't reach it on webrack port 3000 either which seems default, no physical screen connected to server, only ssh shell).

welp, as of this writing, phusion passenger doesn't have official support for Debian 8 [or jessie]. There are a couple debian modules one could try ruby-passenger or apache2-mod-passenger, or even try compiling passenger yourself.. but there's little to no support out there for it, and my guess is you either have the old wheezy repos in your sources.list[.d] (which don't work) or otherwise no longer have passenger installed. Jessie was stabilized late last month. Let's just hope Phusion Passenger takes notice and updates their support pages & repos.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM