1

I'm trying to install Phusion Passenger on Ubuntu 12.04.

When I try:

sudo passenger-install-apache2-module

...I get:

sudo: passenger-install-apache2-module: command not found

However, when I omit the sudo, it works fine. Also, when I log in as root and run passenger-install-apache2-module, it works fine as well. Why would sudo passenger-install-apache2-module not work when logged in as my non-root user, yet work fine when logged in as root?

bevanb
  • 8,201
  • 10
  • 53
  • 90
  • Try as root: which `passenger-install-apache2-module` and post output here. Understanding what exactly the command is may help. – Alexey Malev Apr 24 '14 at 12:33

1 Answers1

3

This is because passenger-install-apache2-module is not on your path as a normal user, but it is as root. (it's probably in /usr/sbin - see below)

run which passenger-install-apache2-module as root and it will tell you where it is (which you can then run using sudo /full/path/to/passenger-install-apache2-module

sbin directories (/sbin and /usr/sbin normally) contain the commands that are used for system administration. Typically these require elevated privileges or just don't make sense for ordinary users to be running them. This is why by default these directories are not on ordinary user's paths - it would just clutter things up.

Oliver Matthews
  • 7,497
  • 3
  • 33
  • 36
  • Ah, that explains it. It's located at `/usr/local/rvm/gems/ruby-1.9.3-p545/bin/passenger-install-apache2-module`. Still strange that the non-root user couldn't find it, considering I installed it with `gem install passenger` (no sudo). Perhaps my rvm isn't configured correctly (I did a multi-user install). – bevanb Apr 24 '14 at 12:41