I installed Phusion Passenger a few months ago, and I just now started Apache, and I requested a page located in /usr/local/apache2/htdocs:
http://localhost:8080/2.htm
And after about 30 seconds, I got a purple and black Phusion Passenger page in my browser stating:
WEB APPLICATION COULD NOT BE STARTED
Application root
/Users/7stud/ruby_programs/phusion_passenger_programs/1app
But I don't want to start my Sinatra application located at:
/Users/7stud/ruby_programs/phusion_passenger_programs/1app
All I want to do is have Apache respond to my browser's request by returning the html page 2.htm--as I used to be able to do.
Here is what I did to install Phusion Passenger:
~/ruby_programs/phusion_passenger_programs/1app$ passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v4.0.48.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort.
--------------------------------------------
Which languages are you interested in?
Use <space> to select.
If the menu doesn't display correctly, press '!'
‣ ⬢ Ruby
⬢ Python
⬢ Node.js
⬡ Meteor
--------------------------------------------
Warning: some directories may be inaccessible by the web server!
The web server typically runs under a separate user account for security
reasons. That user must be able to access the Phusion Passenger files.
However, it appears that some directories have too strict permissions. This
may prevent the web server user from accessing Phusion Passenger files.
It is recommended that you relax permissions as follows:
sudo chmod o+x "/Users/7stud"
Press Ctrl-C to return to the shell. (Recommended)
After relaxing permissions, re-run this installer.
***I CHANGED PERMISSIONS, THEN RERAN INSTALLER****
…
…
Sanity checking Apache installation...
Multiple Apache installations detected!
You are about to install Phusion Passenger against the following
Apache installation:
Apache 2.2.24
apxs2 : /usr/sbin/apxs
Executable: /usr/sbin/httpd
However, 1 other Apache installation(s) have been found on your system:
* Apache 2.4.3
apxs2 : /usr/local/apache2/bin/apxs
Executable: /usr/local/apache2/bin/httpd
Are you sure you want to install against Apache 2.2.24 (/usr/sbin/apxs)? [y/n]: n
--------------------------------------------
* To compile against Apache 2.4.3 (/usr/local/apache2/bin/apxs):
Re-run this installer with: --apxs2-path "/usr/local/apache2/bin/apxs"
You may also want to read the "Installation" section of the manual for
installation troubleshooting:
***I RERAN INSTALLER AGAIN***
$ passenger-install-apache2-module --apxs2-path "/usr/local/apache2/bin/apxs"
…
…
Sanity checking Apache installation...
Multiple Apache installations detected!
You are about to install Phusion Passenger against the following
Apache installation:
Apache 2.4.3
apxs2 : /usr/local/apache2/bin/apxs
Executable: /usr/local/apache2/bin/httpd
However, 1 other Apache installation(s) have been found on your system:
* Apache 2.2.24
apxs2 : /usr/sbin/apxs
Executable: /usr/sbin/httpd
Are you sure you want to install against Apache 2.4.3 (/usr/local/apache2/bin/apxs)? [y/n]: y
===LOT'S OF OUTPUT HERE FOR COMPILATION, THEN ERRORED OUT:
Undefined symbols:
"___fork", referenced from:
Passenger::asyncFork() in Utils.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
rake aborted!
Command failed with status (1): [c++ buildout/agents/PassengerHelperAgent.o -o buildout/agents/PassengerHelperAgent buildout/common/libpassenger_common/Logging.o buildout/common/libpassenger_common/Exceptions.o buildout/common/libpassenger_common/Utils/SystemTime.o buildout/common/libpassenger_common/Utils/StrIntUtils.o buildout/common/libpassenger_common/Utils/IOUtils.o buildout/common/libpassenger_common/Utils.o buildout/common/libpassenger_common/Utils/Base64.o buildout/common/libpassenger_common/Utils/CachedFileStat.o buildout/common/libpassenger_common/Utils/LargeFiles.o buildout/common/libpassenger_common/ApplicationPool2/Implementation.o buildout/common/libpassenger_common/ApplicationPool2/AppTypes.o buildout/common/libpassenger_common/AgentsBase.o buildout/common/libpassenger_common/Utils/MD5.o buildout/common/libpassenger_common/Utils/fib.o buildout/common/libpassenger_common/Utils/jsoncpp.o buildout/common/libboost_oxt.a buildout/libev/.libs/libev.a buildout/libeio/.libs/libeio.a -lpthread -Wl,-dead_strip ]
/Users/7stud/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.48/build/cplusplus_support.rb:51:in `run_compiler'
/Users/7stud/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.48/build/cplusplus_support.rb:77:in `create_executable'
/Users/7stud/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.48/build/agents.rb:101:in `block in <top (required)>'
/Users/7stud/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/7stud/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => apache2 => buildout/agents/PassengerHelperAgent
(See full trace by running task with --trace)
--------------------------------------------
It looks like something went wrong
Please read our Users guide for troubleshooting tips:
/Users/7stud/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.48/doc/Users guide Apache.html
https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html
If that doesn't help, please use our support facilities. We'll do our best to help you.
https://www.phusionpassenger.com/documentation_and_support
==========
The error is because Passenger no longer supports Snow Leopard.
Next I uninstalled the current passenger gem:
$ gem uninstall passenger -v 4.0.48
and installed version 4.0.5
$ gem install passenger -v 4.0.5
Then:
$ passenger-install-apache2-module --apxs2-path "/usr/local/apache2/bin/apxs"
And passenger installed successfully:
====
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /Users/7stud/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.5/libout/apache2/mod_passenger.so
PassengerRoot /Users/7stud/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.5
PassengerDefaultRuby /Users/7stud/.rvm/wrappers/ruby-2.1.2/ruby
***I MODIFIED apache2/conf/http.conf ACCORDING TO THE ABOVE***
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
Press ENTER to continue.
--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:
<VirtualHost *:80>
ServerName www.yourhost.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /somewhere/public
<Directory /somewhere/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:
/Users/7stud/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.5/doc/Users guide Apache.html
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
https://www.phusionpassenger.com
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.
Here are some relevant parts from my httpd.conf file:
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/usr/local/apache2/htdocs"
<Directory "/usr/local/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "/Users/7stud/ruby_programs/phusion_passenger_programs">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
EDIT:
I decided just to get rid of Phusion Passenger, so I read the uninstall docs here:
https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#uninstalling
I installed using the installer:
$ passenger-install-apache2-module
...and the uninstall docs don't tell you how to uninstall if you installed with the installer. Great!
So if I just comment out anything in my httpd.conf file that mentions Phusion Passenger, then I should be alright, right? I did that, then restarted apache2, and now every page I try to access (in the apache2/htdocs directory) with urls like:
http://localhost:8080/2.htm
I get:
Not Found
The requested URL /2.htm was not found on this server.
Yet:
/usr/local/apache2/bin$ sudo ./apachectl -k stop
Password:
/usr/local/apache2/bin$ sudo ./apachectl -k start
/usr/local/apache2/bin$ cd ../htdocs
/usr/local/apache2/htdocs$ ls
1.htm html.html mysql2.php
1.php index.html page1.html
2.htm js.js page2.html
2.php js2.js q
3.htm js3.js test.html
4.htm lib test.php
A.html mail.php xhr.js
B.html my.htm xml2.xml
css my_manifest.appcache
home.html mysql.php
Thanks to Phusion Passenger, I can't get apache to serve up pages anymore.
Next step, uninstall the passenger gem:
$ gem uninstall passenger
Remove executables:
passenger, passenger-install-apache2-module, passenger-install-nginx-module, passenger-config, passenger-status, passenger-memory-stats
in addition to the gem? [Yn] Y
Removing passenger
Removing passenger-install-apache2-module
Removing passenger-install-nginx-module
Removing passenger-config
Removing passenger-status
Removing passenger-memory-stats
Successfully uninstalled passenger-4.0.5
Same result. Restarted my computer. Same result. Apache2 no longer serves up pages.