开发者

Can't get passenger to serve pages (steps I used inside)

开发者 https://www.devze.com 2023-02-21 13:23 出处:网络
I have been struggling to get passenger to run my Rails/Rack apps. Steps I used (as root): Clean Debian 6 installation

I have been struggling to get passenger to run my Rails/Rack apps.

Steps I used (as root):

Clean Debian 6 installation

  • aptitude install apache2, (Ruby requirements taken from RVM), git-core, curl, (and some more packages too I guess)
  • getting rvm installed (system wide)
  • installing ruby 1.9.2-p180, and setting it to be used as default
  • installing passenger gem, and running the apache2 module installation (getting apache2 prequisites along the way)
  • creating /etc/apache2/mods-available/passenger.load and placing:

LoadModule passenger_module ... (the one printed after apache2 passenger module got installed)

  • creating

    /etc/apache2/mods-available/passenger.conf and placing:

PassengerRuby ...

PassengerRoot ... (the ones printed after apache2 passenger modu开发者_StackOverflow中文版le got installed)

  • ap2enmod passenger (and getting apache restarted afterwards)

mkdir /var/www

setting /var/www to be user: root, group: www-data

creating /var/www/testapp and copying my rails app there

creating /etc/apache2/sites-available/testapp and placing in there:

 <VirtualHost *:80>
     ServerName localhost/testapp
     DocumentRoot /var/www/testapp/public
     <Directory /var/www/testapp/public>
         AllowOverride all
        Options -MultiViews
     </Directory>
  </VirtualHost>
  • ap2ensite testapp
  • bundle install from within /var/www/testapp
  • /etc/init.d/apache2 restart

After opening in the browser: localhost/testapp I can only see my rails app structure (it didnt fire the page)

I don't know what I have done wrong. It seems to be pretty much okay. I am concerned about file permissions, groups and so on, although I have no clue how should I set these up. How should permissions be structured? Apart from that, anything else that looks suspicious?

Thanks!


ServerName can't have slashes in it. Just make ServerName localhost, and go to http://localhost to visit your site.

If you need multiple websites deployed on localhost, you can do that, but you need to follow the extra steps here:

http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri

0

精彩评论

暂无评论...
验证码 换一张
取 消