My rails app will only display the public directory when I go to the url.
I'm using apache, passenger and ubuntu.
My apache virtualhosts file is;
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
<Directory /websites/phusion>
Allow from all
</Directory>
# These have been added:
Alias /subapp /websites/rails/public
<Location /subapp>
PassengerBaseURI /subapp
PassengerAppRoot /websites/rails
</Location>
<Directory /websites/rails/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
I think everything is installed properly, my config.ru is;
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
I've added the following to apache2.conf;
LoadModule passenger_module /home/vps/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.35/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/vps/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.35
PassengerDefaultRuby /home/vps/.rvm/gems/ruby-2.0.0-p353/wrappers/ruby
</IfModule>
the apache error.log gives;
All Phusion Passenger agents started!
[ 2014-01-19 09:05:23.8076 12140/7f1e3695c740 agents/Watchdog/Main.cpp:526 ]:
Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/vps/.rvm/gems/ruby-2.0.0-p353/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/vps/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.35', 'passenger_version' => '4.0.35', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.35', 'web_server_pid' => '12137', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
duh...
I had PassengerAppRoot set to the public folder, not rails root.
This issue may be because of the way you installed the Passenger module
Wrong way : sudo passenger-install-apache2-module
Right way : rvmsudo passenger-install-apache2-module
I am just guessing you used the first one which is leading to this issue, please correct me if i'm wrong.
Related
I am trying to install passenger for my rails app, but i dont know where is the problem. I already try do chmod 775 in my app folder, nothing works. Fallow the files:
sites-avaliable and enable
"meuapp.conf"
<VirtualHost *:80>
ServerName meuapp,localhost
ServerAlias meuapp.localhost
ServerAdmin webmaster#localhost
DocumentRoot "/home/pedro/projects/meuapp/public"
<Directory "/home/pedro/projects/meuapp/public">
Options FollowSymLinks
AllowOverride None
</Directory>
RailsEnv development
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
"hosts"
127.0.0.1 localhost
127.0.0.1 meuapp,localhost
127.0.1.1 pedro-pcl
"apache2.conf"
LoadModule passenger_module /home/pedro/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/pedro/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.45
PassengerDefaultRuby /home/pedro/.rvm/gems/ruby-1.9.3-p194/wrappers/ruby
</IfModule>
My log:
[ 2014-07-15 19:26:32.8459 1368/7ff21372a780 agents/HelperAgent/Main.cpp:649 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1358/generation-0/request
[ 2014-07-15 19:26:32.8519 1374/7f6b9f6ac780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.1358/generation-0/logging
[ 2014-07-15 19:26:32.8522 1359/7f5ef2f45780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Tue Jul 15 19:26:32.870422 2014] [so:warn] [pid 1358] AH01574: module passenger_module is already loaded, skipping
[ 2014-07-15 19:26:32.8745 1387/7f657ffb6780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/pedro/.rvm/gems/ruby-1.9.3-p194/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/pedro/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.45', 'passenger_version' => '4.0.45', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.37', 'web_server_pid' => '1385', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2014-07-15 19:26:32.8787 1391/7f21df2fe780 agents/HelperAgent/Main.cpp:649 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1385/generation-0/request
[ 2014-07-15 19:26:32.8858 1397/7fa1e768c780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.1385/generation-0/logging
[ 2014-07-15 19:26:32.8861 1387/7f657ffb6780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Tue Jul 15 19:26:33.387955 2014] [mpm_prefork:notice] [pid 1385] AH00163: Apache/2.4.7 (Ubuntu) Phusion_Passenger/4.0.37 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
[Tue Jul 15 19:26:33.388003 2014] [core:notice] [pid 1385] AH00094: Command line: '/usr/sbin/apache2'
And i try the "Require all granted" thing, still dosent work
You may be encountering the same problem as the StackOverflow user describing his 403 Error with Passenger.
The recommendation, after checking your error log (the way you have configured it, it is likely in /var/log/apache2/error.log) and confirming that you are seeing a client denied by server configuration issue, would be to add Require all granted within your <Directory> block in the virtual host file. So, your block would look like this:
<Directory "/home/pedro/projects/meuapp/public">
Require all granted
Options FollowSymLinks
AllowOverride None
</Directory>
i installed Ruby using RVM on a Ubuntu 13.10 Server. The same thing i do with rubygems and Rails. When i start my application with
rails server
and enter
localhost:3000
in my Browser it works.
Now i want to make the application visible for other users.
So i checked rubyonrails.org/deploy-Site and decided to install nginx with Passenger.
gem install passenger
rvmsudo passenger-install-nginx-module
After this i downloaded stuff who was missing and do
rvmsudo passenger-install-nginx-module
again.
Before i runned
sudo service nginx start
i edit my .conf-File in /opt/nginx/conf/nginx.conf
server {
listen 80;
server_name example.com;
passenger_enabled on;
root /var/www/my_awesome_rails_app/public;
}
As server name i take the ip-Adress for the domain.
The passenger_enabled Line i added and as root i take /home/ServerName/AppName/public
My Problem is that i doesn't see anything when i open the server-ip-page.
When i run 'top' i see that nginx is running.
The Ruby on Rails Application is also running.
AND i restartet nginx after editing the .conf-File.
Anybody know i solution
OR
how i can test nginx?
Thanks
Update - error.log, access.log
access.log: file is empty (no content inside)
error.log:
[ 2014-05-13 14:08:18.9450 2548/7fc38986d740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.42', 'web_server_pid' => '2547', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:08:18.9501 2551/7fbf96162740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2547/generation-0/request
[ 2014-05-13 14:08:18.9590 2556/7fcd93dab780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2547/generation-0/logging
[ 2014-05-13 14:08:18.9604 2548/7fc38986d740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:10:33.6645 2592/7f40a1fe8740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.42', 'web_server_pid' => '2591', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:10:33.6693 2595/7fc930750740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2591/generation-0/request
[ 2014-05-13 14:10:33.6777 2600/7f645bf0f780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2591/generation-0/logging
[ 2014-05-13 14:10:33.6780 2592/7f40a1fe8740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:18:19.9938 2638/7fae3ef32740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.42', 'web_server_pid' => '2637', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:18:19.9990 2641/7f6ed18af740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2637/generation-0/request
[ 2014-05-13 14:18:20.0074 2646/7fbb3494b780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2637/generation-0/logging
[ 2014-05-13 14:18:20.0077 2638/7fae3ef32740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:18:25.2711 2673/7f292be1d740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.42', 'web_server_pid' => '2656', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:18:25.2760 2676/7f26f5920740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2656/generation-0/request
[ 2014-05-13 14:18:25.2839 2681/7f0cf6b96780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2656/generation-0/logging
[ 2014-05-13 14:18:25.2847 2673/7f292be1d740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:18:35.0327 2709/7f19099b8740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.42', 'web_server_pid' => '2708', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:18:35.0374 2712/7f6ce241a740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2708/generation-0/request
[ 2014-05-13 14:18:35.0457 2718/7fba54563780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2708/generation-0/logging
[ 2014-05-13 14:18:35.0461 2709/7f19099b8740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
Update - ps aux | egrep '(PID|nginx)'
http://s1.directupload.net/images/140513/v2lv5dpe.jpg
Now its running.
Port 80 was blocked by the firewall of our university.
After unlocking Port 80 we get the nginx page when running the ip-adress of the server.
Finally we just needed to change the .conf of nginx with the following lines:
location / {
proxy_pass http://localhost:3000/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
Source: Link
This part is important if you don't want access your Application with ip-adress:3000
The old location-part can be deleted.
Now you can restart/reload the nginx:
sudo service nginx restart
and start the rails server (on Port 3000 - default):
rails server
If you want you can start the rails server i another mode with:
rails server -e ....
Now you can access your RoR-Application.
Good Luck :-)
Hello guys i have problem in ZF2 with htaccess.
I create vhost and all work good. when i call
my-vhost.localhost all work good but when i add some uri segment like /index.php or /1234
I get 404.
I edit .htaccess in public dir and put
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [NC,L]
Bur again i have 404. Any idea how i can i slow this?
My full .htaccess is :
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
VHOST
<VirtualHost *:80>
ServerName zf2-tutorial.localhost
DocumentRoot /var/www/html/zf2-tutorial/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/html/zf2-tutorial/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Who think problem is routing check my route mod.
<?php
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Album\Controller\Album',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view',
),
),
);
The contents of the shipped .htaccess file are as follows;
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
It differs very slightly from your copy, I have tried your .htaccess file on a working example and it appears fine.
Is the 404 you are getting a generic "server looking" 404 or is it a ZF2 themed page?
Might be a silly suggestion but have you tried http://my-vhost.localhost/public or http://my-vhost.localhost/public/album ???
As far as I know you shouldnt need to call .php files directly
Im not sure it is too late to answer this question, as Finbarr suggest to try with
http://my-vhost.localhost/public or http://my-vhost.localhost/public/album.
I had also the same problem everytime I type www.zf2-tutorial.loc it always was redirected to xampp main page.
Finally i read the comments froom Finbarr i changed to
http://www.zf2-tutorial.loc/zf2-tutorial/public/
after that the webspage: Welcome to Zend Framework 2 was loaded.
#the virtual host:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
<DocumentRoot "C:/xampp/htdocs/zf2-tutorial/public"
ServerName www.zf2-tutorial.loc zf2-tutorial.loc
ServerAlias zf2-tutorial.loc
<Directory "C:/xampp/htdocs/zf2-tutorial/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
in the host I made several combinations trying to find out which one was correct.
127.0.0.1 localhost
127.0.0.1 www.zf2-tutorial.loc zf2-tutorial.loc
127.0.0.1 www.zf2-tutorial.loc zf2-tutorial.loc localhost
127.0.0.1 www.zf2-tutorial.loc localhost
127.0.0.1 www.zf2-tutorial.loc
127.0.0.1 zf2-tutorial.loc localhost
127.0.0.1 zf2-tutorial.loc
the apache (httpd conf) has this settings some people suggest to delete he hash tag but I didn't work for me so left it as i found it:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
Also in the same file (httpd conf) I change the AllowOverride None to AllowOverride FileInfo as follows:
<Directory />
AllowOverride FileInfo
Require all denied
</Directory>
re started the xampp and it was displayed the congratulations web page.
I start passenger — rvmsudo passenger start -p 80 --user=support on Ubunto 12.10, and get this error:
Stopping web server... done
/usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller.rb:407:in
start_without_locking': [ 2013-08-22 13:19:09.5563 16334/7f245089a740
agents/Watchdog/Main.cpp:459 ]: Options: { 'analytics_log_user' =>
'nobody', 'default_group' => 'support', 'default_python' => 'python',
'default_ruby' =>
'/usr/local/rvm/wrappers/ruby-1.9.3-p429#rails32/ruby', 'default_user'
=> 'support', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' =>
'/tmp/passenger-standalone.1cjq616/locations.ini', 'pool_idle_time' =>
'300', 'prestart_urls' => 'aHR0cDovLzAuMC4wLjA6ODAA', 'temp_dir' =>
'/tmp', 'union_station_gateway_address' =>
'gateway.unionstationapp.com', 'union_station_gateway_port' => '443',
'user_switching' => 'false', 'web_server_pid' => '16333',
'web_server_type' => 'nginx', 'web_server_worker_gid' => '1000',
'web_server_worker_uid' => '1000' } (DaemonController::StartTimeout)
[ 2013-08-22 13:19:09.5610 16337/7f7a32f48740 agents/HelperAgent/Main.cpp:602 ]: PassengerHelperAgent online,
listening at unix:/tmp/passenger.1.0.16333/generation-0/request
[ 2013-08-22 13:19:09.5637 16342/7f7a14f71740 agents/LoggingAgent/Main.cpp:334 ]: PassengerLoggingAgent online,
listening at unix:/tmp/passenger.1.0.16333/generation-0/logging
[ 2013-08-22 13:19:09.5642 16334/7f245089a740 agents/Watchdog/Main.cpp:642 ]: All Phusion Passenger agents started!
/usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:105:in
initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:105:in
new'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:105:in
connect'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:86:in socket'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:90:inhead_request'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:145:in
<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller.rb:218:in
block in start'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller/lock_file.rb:68:in
block in exclusive_lock'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller/lock_file.rb:63:in
open'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller/lock_file.rb:63:in
exclusive_lock'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller.rb:217:in
start'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/start_command.rb:414:in
start_nginx'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/start_command.rb:71:in
run'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/main.rb:92:in
run_command'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/main.rb:62:in
run!'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/main.rb:39:in
run!'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/bin/passenger:34:in
'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/passenger:19:in load'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/passenger:19:in
'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/ruby_noexec_wrapper:14:in
eval'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/ruby_noexec_wrapper:14:in
'
What I do wrong, maby this is permission?
Ports below 1024 can be opened only, although you can use iptables to redirect the traffic:
# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
Since loopback devices (like localhost) do not use the prerouting rules, if you need to use localhost, etc., add this rule as well:
# iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3000
Or you can use passagener under apache http server or nginx, and use their configs to set the applications.
Actually, that is a bug in Phusion Passenger. The command rvmsudo passenger start -p 80 --user=support should just work, without the iptables changes that Paulo suggested. I've fixed this bug and the bug fix will be part of Phusion Passenger 4.0.15.
Hongli Lai
Phusion CTO
Phusion Passenger developer
I was working on realurl's in typo3 and spend hours on working out why typo3 is showing only one segment in url.
site structure looks like this:
and URL that I got for subpage 'munchen-maistrasse' is:
http://www.bernd-gruber.at/munchen-maistrasse/
I want it to be:
http://www.bernd-gruber.at/referenzen/munchen-maistrasse/
This is my server .htaccess file:
<FilesMatch "\.(js|css)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 7 days"
</IfModule>
FileETag MTime Size
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
RewriteRule ^typo3$ typo3/index_re.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]
</IfModule>
AddType video/x-m4v .m4v
AddType video/ogg .ogv
AddType video/webm .webm
AddType video/x-m4v .m4v
AddType application/ogg .ogg
I dont use config.baseURL in typoscript I use:
config.absRefPrefix = /
config.prefixLocalAnchors = all
on my root page. I have runned out of solutions.
You need your own configuration to reach this.
1) In the Extension Manager -> RealUrl -> Configuration you have to disable the automatic configuration and define there the path to your own realUrl configuration file.
2) You should make sure that (page).config.tx_realurl_enable = 1 is set.
3) After making the right realUrl configuration for your website you have to truncate all realUrl caching tables or just remove all ID to Path mappings.
Here some example of a standard realUrl configuration template:
<?php
$realurl_template = array(
'init' => array(
'appendMissingSlash' => 'ifNotFile,redirect',
'enableCHashCache' => 1,
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
'emptyUrlReturnValue' => '/'
),
'preVars' => array(
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fileName' => array(
'index' => array(
),
),
'postVarSets' => array(
'_DEFAULT' => array (
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 3,
)
);
# Configurate domain names
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
'_DEFAULT' => $realurl_template,
'domain.com' => $realurl_template,
'www.domain.com' => $realurl_template,
);
$TYPO3_CONF_VARS['EXTCONF']['realurl']['domain.com']['pagePath']['rootpage_id'] = 1;
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain.com']['pagePath']['rootpage_id'] = 1;
# Unset template
unset($realurl_template);
?>