How do I get the passenger port switch (from 80 up to 3000) to work?

69 views
Skip to first unread message

xper...@gmail.com

unread,
Mar 26, 2014, 2:06:04 PM3/26/14
to munkise...@googlegroups.com
Hello again. 

I was here the other day (on this thread: https://groups.google.com/forum/#!topic/munkiserver-dev/CFpaOfyaQvQ) and you guys were very helpful.

I have the server running fine on <FQDN>:3000. Now I am trying to get the apache/passenger proxy bit to work, so I can just use the FQDN.

At the moment when I go to the FQDN in my local network I just get a list of all the files in my /munkiserver/ folder.

Of course this means the apache is serving the correct folder structure. I just need to know what to look for to get passenger to step in the middle and do its thing.

I'm not sure where passenger is supposed to step in though, so I'm probably just editing the wrong .conf.

Here are links to my relevant .conf files, i'll just host em on my home owncloud server so this post won't be crazy long.

-The apache .conf (it's the one used by Server.app): 
Location: /Library/Server/Web/Config/apache2/

-The virtual host file I have edited: 
Location: /Library/Server/Web/Config/apache2/sites/

Additional data:

-On the page that shows the /munkiserver/ file I see the following line at the bottom. It has passenger mentioned so I think apache knows its there somewhere.

"Apache/2.2.26 (Unix) Phusion_Passenger/4.0.40 mod_ssl/2.2.26 OpenSSL/0.9.8y DAV/2 PHP/5.3.28 mod_wsgi/3.3 Python/2.7.2 Server at managed.xperteks.com Port 80"

----------------------

What am I missing?

Thanks in advance!

Ricky Chilcott

unread,
Mar 26, 2014, 2:33:55 PM3/26/14
to munkise...@googlegroups.com
It looks like you’re close.  Passenger must be getting loaded, so that’s not it.

Change your site config, to have the following:

DocumentRoot "/Library/WebServer/Documents/munkiserver/public”

You need to serve up the public folder as discussed here: https://github.com/jnraine/munkiserver/wiki/Using-Apache-with-munki-server

Change 
Ricky Chilcott



--
You received this message because you are subscribed to the Google Groups "munkiserver-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munkiserver-d...@googlegroups.com.
To post to this group, send email to munkise...@googlegroups.com.
Visit this group at http://groups.google.com/group/munkiserver-dev.
For more options, visit https://groups.google.com/d/optout.

xper...@gmail.com

unread,
Mar 26, 2014, 3:09:57 PM3/26/14
to munkise...@googlegroups.com
Ricky,

Thanks, we are getting closer. I updated the 0000….conf file and added /public to the document root path.

No when I go the FQDN page I get a full page Passenger error, so I know passenger is working (yay!). 

The error is the following:

-----------------------------------------------------------------------
It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:
bundle install
If that didn't work, then the problem is probably caused by your application being run under a different environment than it's supposed to. Please check the following:
  1. Is this app supposed to be run as the Xperteks user?
  1. Is this app being run on the correct Ruby interpreter? Below you will see which Ruby interpreter Phusion Passenger attempted to use.
  1. Please check whether the correct RVM gemset is being used.
  1. Sometimes, RVM gemsets may be broken. Try resetting them.
-------- The exception is as follows: -------
Could not find rake-10.0.4 in any of the sources (Bundler::GemNotFound)
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/spec_set.rb:92:in `block in materialize'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `map!'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `materialize'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/definition.rb:133:in `specs'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/definition.rb:178:in `specs_for'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/definition.rb:167:in `requested_specs'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/environment.rb:18:in `requested_specs'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/runtime.rb:13:in `setup'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>'
/Users/Xperteks/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require'
/Users/Xperteks/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
/Users/Xperteks/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/lib/phusion_passenger/loader_shared_helpers.rb:245:in `block in run_load_path_setup_code'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/lib/phusion_passenger/loader_shared_helpers.rb:348:in `running_bundler'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/lib/phusion_passenger/loader_shared_helpers.rb:243:in `run_load_path_setup_code'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/helper-scripts/rack-preloader.rb:100:in `preload_app'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/helper-scripts/rack-preloader.rb:28:in `<main>'
------------------------------------------------------------------------

I could have sworn I fixed that "can't find rake 10.0.4" the other day. Will try the 'bundle install' as suggested, but do you have any other ideas? 

xper...@gmail.com

unread,
Mar 26, 2014, 3:12:06 PM3/26/14
to munkise...@googlegroups.com
Gem says I have Rake 10.2:

managedsoftwareupdate:munkiserver Xperteks$ gem install rake 
Fetching: rake-10.2.1.gem (100%)
Successfully installed rake-10.2.1
Installing ri documentation for rake-10.2.1
1 gem installed

Is there somewhere in the munkiserver code I can tell it to use the newer version of rake?

Riley Shott

unread,
Mar 26, 2014, 3:40:59 PM3/26/14
to munkise...@googlegroups.com
Go to the root of the munkiserver application (i.e. the same directory where the Gemfile file exists) and run:

bundle install

Also, you can use `bundle show gemname` at the root of your munkiserver application to see if bundler has installed that particular gem, as well as exactly where it is on the file system. 

-Riley


--

xper...@gmail.com

unread,
Mar 26, 2014, 3:51:21 PM3/26/14
to munkise...@googlegroups.com
Riley,

I go to the root directory and run your command and get the following:

-----------------------------------------------------------------
managedsoftwareupdate:munkiserver Xperteks$ pwd
/usr/local/munkiserver
managedsoftwareupdate:munkiserver Xperteks$ bundle show rake
/Users/Xperteks/.rvm/gems/ruby-1.9.3-p448@munkiserver/gems/rake-10.0.4
managedsoftwareupdate:munkiserver Xperteks$ 
 -----------------------------------------------------------------

Which seems to indicate that rake-10.0.4 is there. 

I run the 'bundle install' from the same location and get the following:

-----------------------------------------------------------------
managedsoftwareupdate:munkiserver Xperteks$ bundle install
Using rake (10.0.4)
Using i18n (0.6.4)
Using multi_json (1.7.6)
Using activesupport (3.2.12)
Using builder (3.0.4)
Using activemodel (3.2.12)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.12)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
Using mail (2.4.4)
Using actionmailer (3.2.12)
Using arel (3.0.2)
Using tzinfo (0.3.37)
Using activerecord (3.2.12)
Using activeresource (3.2.12)
Using addressable (2.3.4)
Using callsite (0.0.11)
Using cancan (1.6.10)
Using mini_portile (0.5.0)
Using nokogiri (1.6.0)
Using ffi (1.9.0)
Using childprocess (0.3.9)
Using rubyzip (0.9.9)
Using websocket (1.0.7)
Using selenium-webdriver (2.33.0)
Using xpath (0.1.4)
Using capybara (1.1.4)
Using choice (0.1.6)
Using chronic (0.9.1)
Using client_side_validations (3.2.5)
Using climate_control (0.0.3)
Using cocaine (0.5.1)
Using coderay (1.0.9)
Using coffee-script-source (1.6.2)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Using json (1.8.0)
Using rdoc (3.12.2)
Using thor (0.18.1)
Using railties (3.2.12)
Using coffee-rails (3.2.2)
Using colorize (0.5.8)
Using rest-client (1.6.7)
Using simplecov-html (0.7.1)
Using simplecov (0.7.1)
Using coveralls (0.6.7)
Using safe_yaml (0.9.3)
Using crack (0.4.0)
Using daemon_controller (1.2.0)
Using diff-lcs (1.2.4)
Using dynamic_form (1.1.4)
Using factory_girl (3.3.0)
Using highcharts-rails (2.1.9)
Using highline (1.6.19)
Using jquery-rails (2.0.3)
Using jquery-ui-rails (4.0.3)
Using libv8 (3.11.8.17)
Using rack-contrib (1.1.0)
Using meta_request (0.2.6)
Using method_source (0.8.1)
Using paperclip (3.4.2)
Using passenger (4.0.40)
Using plist (3.1.0)
Using slop (3.4.5)
Using pry (0.9.12.2)
Using pry-rails (0.3.1)
Using bundler (1.5.3)
Using rails (3.2.12)
Using ruby-graphviz (1.0.9)
Using rails-erd (1.1.0)
Using ref (1.0.5)
Using rspec-core (2.13.1)
Using rspec-expectations (2.13.0)
Using rspec-mocks (2.13.1)
Using rspec-rails (2.13.2)
Using sass (3.2.9)
Using sass-rails (3.2.6)
Using sequel (3.20.0)
Using sinatra (1.0)
Using sqlite3 (1.3.7)
Using sqlite3-ruby (1.3.3)
Using taps (0.3.24)
Using textmate_backtracer (1.0.0)
Using therubyracer (0.11.4)
Using uglifier (2.1.1)
Using vcr (2.4.0)
Using webmock (1.8.11)
Using whenever (0.8.2)
Using will_paginate (3.0.4)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
managedsoftwareupdate:munkiserver Xperteks$ 
-----------------------------------------------------------------

Which shows Rake 10.0.4 there as well.

Now the question is how can I convince passenger that it really is there? Permissions on a folder? Setting in a .conf somewhere? Can I set a folder into the PATH variable? I just don't know where Passenger is looking...

Riley Shott

unread,
Mar 26, 2014, 4:32:01 PM3/26/14
to munkise...@googlegroups.com
Ensure your passenger settings look similar to below. Ignore the fact that I've installed RVM system-wide (i.e. /usr/local/rvm), it shouldn't matter:

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
  PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.37
  PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.0.0-p451/wrappers/ruby
</IfModule>

From what you posted earlier, you're not pointing your passenger LoadModule declarative to mod_passenger.so. To build it, you need to run:

passenger-install-apache2-module

It should spit out what you need to add when it's finished. If you've already done this, append '--snippet' to that command to see it again.

-Riley


From: xper...@gmail.com
To: munkise...@googlegroups.com
Sent: Wednesday, 26 March, 2014 12:51:21
Subject: Re: [munkiserver-dev] How do I get the passenger port switch (from 80 up to 3000) to work?

xper...@gmail.com

unread,
Mar 26, 2014, 4:42:33 PM3/26/14
to munkise...@googlegroups.com
Riley,

I've been google-fu-ing and came to the same point: checking where the virtual host is loading the module.

I ran your command (with the --snippet):

--------------------------------------------------------------------
managedsoftwareupdate:apache2 Xperteks$ passenger-install-apache2-module --snippet
LoadModule passenger_module /Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
  PassengerRoot /Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40
  PassengerDefaultRuby /Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/wrappers/ruby
</IfModule>
managedsoftwareupdate:apache2 Xperteks$ 
--------------------------------------------------------------------

My virtual host definition:

--------------------------------------------------------------------
<VirtualHost *:80>
        ServerName managed.xperteks.com
        ServerAdmin ad...@example.com
        DocumentRoot "/Library/WebServer/Documents/munkiserver/public"
        DirectoryIndex index.html index.php /wiki/ default.html
        CustomLog /var/log/apache2/access_log combinedvhost
        ErrorLog /var/log/apache2/error_log
        <IfModule mod_ssl.c>
                SSLEngine Off
                SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
                SSLProtocol -ALL +SSLv3 +TLSv1
                SSLProxyEngine On
                SSLProxyProtocol -ALL +SSLv3 +TLSv1
        </IfModule>
        <Directory "/Library/WebServer/Documents/munkiserver/public">
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>
LoadModule xsendfile_module   /usr/libexec/apache2/mod_xsendfile.so
RequestHeader Set X-Sendfile-Type X-Sendfile
ProxyPassReverse / http://localhost:8001/
XSendFile on
XSendFilePath /usr/local/munkiserver/packages

LoadModule passenger_module /Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
        PassengerRoot /Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.40
        PassengerDefaultRuby /Users/Xperteks/.rvm/gems/ruby-1.9.3-p448/wrappers/ruby
</IfModule> 
--------------------------------------------------------------------

I'm not insane, right? They are already the same…

That virtual host file is the one I edited earlier to add the /public folder to the document root, and I know it is the correct one.

I know Apple loves to hide config files in multiple locations. Is there one I'm missing somewhere? This is driving me nuts.

Riley Shott

unread,
Mar 26, 2014, 5:01:23 PM3/26/14
to munkise...@googlegroups.com
Just to clarify. Where is your munkiserver application? I see from your vhost declaration that you're using /usr/local/munkiserver/packages to store packages, but your public folder is coming from /Library/WebServer/Documents/munkiserver/public. Are you using symlinks?

I think your other problem may be that you're unfamiliar with RVM gemsets. My recommendation would be not to use them.  If you want to try this, the following steps should more or less get you to that point:

* Delete the .rvmrc file in your munkiserver app root
* rvm gemset delete munkiserver
* rvm use ruby-1.9.3-p448@default
* rvm gemset empty
* cd into your munkiserver app root
 # May not be necessary but here just incase
* gem install bundler
# I like to store an app's gems inside the vendor folder, but feel free to not include --path.
* bundle install --path vendor
# You'll probably have to install passenger again
* gem install passenger
* passenger-install-apache2-module
* Copy and paste into httpd conf file

-Riley


From: xper...@gmail.com
To: munkise...@googlegroups.com
Sent: Wednesday, 26 March, 2014 13:42:33
Subject: Re: [munkiserver-dev] How do I get the passenger port switch (from 80 up to 3000) to work?

--

xper...@gmail.com

unread,
Mar 27, 2014, 11:34:04 AM3/27/14
to munkise...@googlegroups.com
Riley,

You've hit the nail on the head. I'm not a designer, just a sysadmin trying to implement this at my bosses request. 

For your question:

The files are located at /usr/local/munkiserver with a symlink to /Library/WebServer/Documents/munkiserver

I set this up following the guide here: https://gist.github.com/wbs75/6562498

All the work I've done past the steps in that guide are in the other thread I linked

I will try your suggestion and report back.
Message has been deleted

xper...@gmail.com

unread,
Mar 27, 2014, 12:14:15 PM3/27/14
to munkise...@googlegroups.com
Ok, last stupid question (for now): How do I log into this thing? I didn't see a 'setup username/password' step in the setup guide. Its not responding to the sql user I made, and I can't get to the <FQDN>/phpmyadmin without logging in…

Is there a settings file I can edit?

Riley Shott

unread,
Mar 27, 2014, 1:07:11 PM3/27/14
to munkise...@googlegroups.com
Deploying Rails can be tricky, and it will become easier with time & familiarity :) I am by no means an expert, and am also a sysadmin.

The following rake task should have prompted you to enter a password for the root user.

rake bootstrap:all RAILS_ENV=production

-Riley


From: xper...@gmail.com
To: munkise...@googlegroups.com
Sent: Thursday, 27 March, 2014 09:14:15
Subject: Re: [munkiserver-dev] How do I get the passenger port switch (from 80 up to 3000) to work?

Ok, last stupid question (for now): How do I log into this thing? I didn't see a 'setup username/password' step in the setup guide. Its not responding to the sql user I made, and I can't get to the <FQDN>/phpmyadmin without logging in…

Is there a settings file I can edit?

--
Reply all
Reply to author
Forward
0 new messages