2014-10-13 3 views
0

Я установил Phusion Passenger несколько месяцев назад, и я только сейчас начал Apache, и я запросил страницу, расположенную в/USR/местные/apache2/HTDOCS:Почему Phusion Passenger завинчивает мой Apache2?

http://localhost:8080/2.htm 

А примерно через 30 секунд, я получил фиолетовый и черный Phusion Passenger страницу в браузере с указанием:

WEB APPLICATION COULD NOT BE STARTED 

Application root 
    /Users/7stud/ruby_programs/phusion_passenger_programs/1app 

Но я не хочу, чтобы начать мое приложение Sinatra находится по адресу:

/Users/7stud/ruby_programs/phusion_passenger_programs/1app 

Все, что я хочу сделать, это заставить Apache отвечать на запрос моего браузера, возвращая html-страницу 2.htm - как я мог это сделать.

Вот что я сделал, чтобы установить 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. 

Вот некоторые соответствующие части моего файла httpd.conf:

<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:

я решил просто чтобы избавиться от Phusion Passenger, поэтому я прочитал деинсталляцию документов:

https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#uninstalling

Я установил с помощью программы установки:

$ passenger-install-apache2-module 

... и деинсталляция документы не сказать вам, как удалить, если вы установили с установщиком. Большой!

Так что если я просто прокомментирую что-либо в файле httpd.conf, в котором упоминается Phusion Passenger, тогда я должен быть в порядке, не так ли? Я сделал это, а затем перезапустить apache2, и теперь на каждой странице я пытаюсь получить доступ (в директории/HTDOCS apache2) с URL, как:

http://localhost:8080/2.htm 

я получаю:

Not Found 

The requested URL /2.htm was not found on this server. 

Еще:

/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 

Благодаря Phusion Passenger я не могу заставить apache больше обслуживать страницы.

Следующий шаг, удалите пассажирскую перл:

$ 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 

Тот же результат. Перезагрузили компьютер. Тот же результат. Apache2 больше не обслуживает страницы.

ответ

0

Я смог снова запустить Apache, изменив следующую строку в apache2/conf/http.конф:

Listen 8080 

в

Listen 8181 

Видимо, Phusion Пассажир постоянно облажался порт 8080 каким-то образом.

Как ни странно, если я затем сменил порт на 8080, остановите apache, запустите apache, затем используйте url http://localhost:8181/2.htm, apache все еще обслуживает страницу. Да ??

И если я использую URL: http://localhost:8080/2.htm, я получаю обычную Phusion Passenger облажались:

Not Found 

The requested URL /2.htm was not found on this server. 
Смежные вопросы