w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Install Nginx Passenger Rails on Ubuntu Failed
Try following the advice in Debugging application startup problems on the Phusion Passenger wiki.

Categories : Ruby On Rails

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

error on installing passenger nginx module on ubuntu with ruby 2.0.0 via rvm
You have to install development tools first. Most likely you're missing some libraries just like the error is indicating. I ran into the same thing a couple weeks back. Here is a nice tutorial similar to the one that helped me out. http://alexpearce.me/2012/06/setting-up-a-vps/ With a little bit of luck, I believe that this line will solve your current issues, but be sure to look over the whole document. sudo apt-get -y install curl git-core python-software-properties build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libcurl4-openssl-dev Also: I've also always had troubles when using rvm and have found that rbenv works with less hiccups, which is actually mentioned in this tutorial. For databases, if you aren't using postgres then you should be able to just swap out the

Categories : Ruby On Rails

nginx + passenger + rails - 403 forbidden
You cannot use the symlink that way. See How Phusion Passenger detects whether a virtual host is a web application

Categories : Ubuntu

How to use sub uri to login in rails 3.2.12 with passenger/nginx
Try: namespace :nbhy do match '/signin', :to => 'authentify::sessions#new', :as => "signin" match '/signout', :to => 'authentify::sessions#destroy', :as => "signout" root :to => "signin" end And remove the base uri from passenger. Alternatively You can change the server root: server { listen 80; server_name mysite.com; root /var/www/nbhy; passenger_enabled on; rails_env production; } Which is very acceptable and thats what I do in all of my websites. bacuse it connectes between the domain and the root path. Than all of your rotes are normal.

Categories : Ruby On Rails

Running two applications on a VPS using nginx passenger
You cannot do it only by defining another DNS address. You should run the other app on different URL. Then do something like this: upstream rails { server 127.0.0.1:8000; } upstream sinatra { server 127.0.0.1:7000; } server { location /rails { proxy_pass http://rails; } location /sinatra { proxy_pass http://sinatra; } }

Categories : Ruby On Rails

Deploying Rails applications with Passenger and Nginx to VPS (EC2)
I believe to start servers there's a specific cap command to start servers, but i don't know much about capistrano, just played with it a little bit before. As for the second part, this is where nginx takes part, nginx will handle forwarding each domain to the specific port, using proxy_pass, take a look at this example server { server_name: example1.com; proxy_pass: http://127.0.0.1:3000; } server { server_name: example2.com; proxy_pass: http://127.0.0.1:3001; }

Categories : Ruby On Rails

Forbidden - Ruby 2.0.0 Rails 4.0.0 Nginx Passenger on Ubuntu 12.04
maybe it is because of the passenger_spawn_method smart-lv2? according to http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_passenger_max_instances_per_app_lt_integer_gt : As of Phusion Passenger 4.0, conservative spawning was renamed to direct and smart-lv2 was renamed to smart. The old smart spawning has been removed in favor of the new version. And as: The default value is smart. try just removing it.

Categories : Ruby On Rails

nginx / passenger configuration to allows access to custom header
If you are using nginx proxy module to forward request to passenger, you need to explicitly forward this customized header: proxy_set_header auth_token $http_auth_token; References: http://wiki.nginx.org/HttpProxyModule#proxy_set_header http://wiki.nginx.org/HttpCoreModule#.24http_HEADER

Categories : Ruby On Rails

Missing assets on production mode - passenger on nginx
Try using image-url instead of url. background: #fff image-url('wallpaper.jpg') top left; From the Asset Pipeline documentation: When using the asset pipeline, paths to assets must be re-written and sass-rails provides -url and -path helpers (hyphenated in Sass, underscored in Ruby) for the following asset classes: image, font, video, audio, JavaScript and stylesheet.

Categories : Ruby On Rails

Multiple Ruby apps (Rails and Sinatra) deployed using Passenger for Nginx?
I believe you need to define local servers, that only listen on local port and define your passenger apps there. Your actual server listening on port should only act as proxy. server { listen localhost:8181; server_name test_app; root /var/www/test/public; passenger_enabled on; } server { listen localhost:8182; server_name demo_app; root /var/www/demo/public; passenger_enabled on; rails_env production; } server { listen 80; server_name localhost; location / { proxy_pass http://localhost:8182/; } location /test/ { proxy_pass http://localhost:8181/; } } I didn't have chance to test this config, so it might have some minor flaws, but it should be correct in high-level

Categories : Ruby On Rails

nginx + passenger + rails: do I need to start the rails server or just start nginx?
Set nginx to forward to my rails server using this https://gist.github.com/jeffrafter/1229497 worker_processes 1; error_log /usr/local/var/log/nginx.error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream dev { server 127.0.0.1:3000; } server { listen 80; # You could put a server_name directive here (or multiple) if # you have not setup wildcard DNS for *.dev domains # See http://jessedearing.com/nodes/9-setting-up-wildcard-subdomains-on-os-x-10-6 # If we choose a root, then we can't switch things around easily # Using /dev/null means that static assets are served through

Categories : Ruby On Rails

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

how to get output of rb_backtrace() in gdb for passenger process
I don't know the answer on the ruby end -- I'd guess it is going to the ruby process' stdout or stderr -- but gdb recently got a new feature that is designed to help with this scenario. The new feature is called "frame filters" and it lets you change how stack traces are presented by writing simple Python scripts that examine the state of the inferior process. For example, you could write such a script that understands the Ruby interpreter, and then have gdb's "bt" automatically interleave interpreted (Ruby) frames with C frames. For more information, start here and read the next few nodes: http://sourceware.org/gdb/current/onlinedocs/gdb/Frame-Filter-API.html#Frame-Filter-API I'd like to see this feature be adopted by the various interpreter projects. There's been pretty good adoptio

Categories : Ruby

How to Install Matplotlib Basemap Module on Windows 7 with WinPython (or any Python stack install)?
I use windows. And my installation failed with official guidance, too. Finally I installed Basemap using the following method. Although I am not sure if it will go right for you, I just offer mine. First of all, you must have pip in your computer. (It is much easier to install, compared with Basemap and other things. And it can be used to install many useful packages.) Then go this great link: http://www.lfd.uci.edu/~gohlke/pythonlibs/ And download the file named "basemap‑1.0.8‑cp27‑none‑win_amd64.whl". Remove the .whl file to directory "C:Python27". (Maybe you installed your python in different disk, then change it accordingly.) Open terminal. (Use cmd or Git Bash or something else.) Use command: pip install basemap‑1.0.8‑cp27‑none‑win_amd64.whl

Categories : Python

Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass http://127.0.0.1:81; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:81; } In apache you create a virtual host <Virtua

Categories : Apache

get ip and url from ngx_http_request_t in nginx module
A ngx_http_request_t is a typedef for ngx_http_request_s. See http://lxr.nginx.org/source/src/http/ngx_http.h#0016. It looks as follows (from http://lxr.nginx.org/source/src/http/ngx_http_request.h#0358): 0358 struct ngx_http_request_s { 0359 uint32_t signature; /* "HTTP" */ 0360 0361 ngx_connection_t *connection; 0362 0363 void **ctx; 0364 void **main_conf; 0365 void **srv_conf; 0366 void **loc_conf; 0367 0368 ngx_http_event_handler_pt read_event_handler; 0369 ngx_http_event_handler_pt write_event_handler; ... 0394 ngx_str_t request_line; 0395 ngx_str

Categories : C

Logging a variable set by nginx's Lua module
You need to define the variable $foo before the Lua module can use it. Check the doc for an example defining the variable within the location directive before utilizing it.

Categories : Nginx

nginx rewrite module not working?
You seem to have mixed different bits from different how-to's, without understanding them. Observe: rewrite ^(.*)$ index.php?/$1 last; #question mark, typo? location ~ .php$ # matches end of request_uri fastcgi_split_path_info ^(.+.php)(/.+)$; # matches .php followed by a slash For the third statement to match, .php is never at end of request_uri, so this statement will never match in this location. Remove the question mark from the first statement, remove the dollar sign from the location. Then add: fastcgi_param SCRIPT_FILENAME $document_root$ fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_split_pathinfo; to the location block. Try to understand from the documentation and try to further restrict the location block.

Categories : Nginx

Difference between nginx module and uWSGI plugin
To be nginx-friendly a module must be non-blocking and must not use calls like fork(). If you can write a nginx module like this, use the nginx approach. The problem is that all of the current available nginx modules for mongodb are blocking (they generally use threadpools but can potentially blocks). The only solution would be reimplementing the mongodb protocol (check this project http://mojolicio.us/perldoc/Mango) without using the currently available libraries. On the other side uWSGI has not such limits (it can use processes, threads and coroutines), and a gridfs module is already available: http://uwsgi-docs.readthedocs.org/en/latest/GridFS.html The problem is that there is no doc about writing uwsgi plugins, so you have to base yourself on the current available ones Btw, you ne

Categories : Nginx

"The gem ... has been deleted. It was installed at" Error. Bundle install doesn't install gems. How to re-install gems?
This solved it for me: "gem install" and "bundle install" do not install gem dependencies after manual gem deletion. How to inform Rubygems that gems were deleted manually? (Delete the .gemspec files for the gems you have removed).

Categories : Misc

Passenger: 100% CPU
This is a known issue and has been resolved. Though the fix is committed, it has not been released as a gem. Look for the next version, 4.0.6, which should contain the fix. For now, you may either downgrade passenger (I haven't pinpointed the version which introduces this problem, my guess is to try version <= 4.0.4) or work from the source repo. Here is the bug tracker page: https://code.google.com/p/phusion-passenger/issues/detail?id=908 We are experiencing this problem in FreeBSD (the base of OS X), and hope this will resolve it there as well.

Categories : Osx

Drupal module node type creation .install vs .module
you can create node_types using both node_type_save() and hook_node_info(). Drupal Core book module creates it in hook_install. But its more common practice to do so in hook_node_info() or hook_entity_info() ( node module uses hook_entity_info() ). if you implement using hook_node_info() you are more complaint with the way drupal works. For example node_type_rebuild() will only work with values defined in hook_node_info() and not node_type_save(). Imo you should be using hook_node_info() or hook_entity_info() and let drupal core handle the rest.

Categories : Drupal

Nginx no longer starts and doesn't give output
You seem to have a problem here: #server { listen 80 default; server_name anything; # Everything is a 404 location / { return 404; } } server is commented out, but the other lines in that set are not. If you intended on commenting out the entire server block, you'll need to use: #server { # listen 80 default; # server_name anything; # # Everything is a 404 # location / { # return 404; # } #}

Categories : Ruby On Rails

PassengerPoolIdleTime being ignored by Passenger
It turns out the cause of my issues was not Passenger, but Apache and DNS. It's a Mac OSX issue, and you can find out more about the problem/solution here: http://clauswitt.com/fixing-slow-dns-queries-in-os-x-lion.html Basically, if you have an entry in your /etc/hosts file called: 127.0.0.1 railsapp.local you need to add its IPv6 counterpart so that the system doesn't go performing a remote DNS query: fe80::1%lo0 railsapp.local

Categories : Apache

Why use Passenger with Apache?
passenger phusion is what was known mod_rails, it is the same as mod_php you use to run php scripts with Apache. Apache by default does not support processing of ruby code so you have to use a module for it.

Categories : Ruby On Rails

Passenger not start on 80 port
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.

Categories : Ruby On Rails

How to make passenger and rvm work together?
I just went through setting up passenger 4.0.17 on Ubuntu Precise using the apt approach. Here is what worked for me. In the /etc/nginx/nginx.conf passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; passenger_ruby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby; Try moving the passenger_ruby to outside of the server block. Good Luck

Categories : Ruby

RVM warning when installing Passenger on the Mac
Add to your ~/.profile or ~/.bash_profile export rvmsudo_secure_path=0 You may try to install passenger without sudo. $ passenger-install-apache2-module

Categories : Misc

I'm getting 403 error using passenger for rails in apache
First of all check your error log. By default, it placed at /var/log/apache2/. If you have client denied by server configuration issue, check your site conf file at /etc/apache2/sites-available/your-site.conf. It must be in compliance with Phusion Passenger User Guide. Take a look on Require all granted. <Directory "/home/user/folder"> Require all granted Options FollowSymLinks # This relaxes Apache security settings. AllowOverride None # MultiViews must be turned off. Order allow,deny Allow from all </Directory>

Categories : Ruby On Rails

Not able to serve my sinatra app with passenger/apache
Change DocumentRoot "/var/www/html/billomatic" to DocumentRoot "/var/www/html/billomatic/public" and <Directory "/var/www/html/billomatic"> to <Directory "/var/www/html/billomatic/public">

Categories : Ruby

Rails Passenger Error after replacing app
Try running: bundle exec rake assets:precompile in your production environment. The error occurs because in production environment assets should be precompiled in order to work. This is different than in development, where assets are served by rails app.

Categories : Ruby On Rails

Phusion Passenger is killing my process?
You shouldn't be creating threads within a Passenger hosted process. If Passenger doesn't think your process is busy servicing requests, it is free to shut it down without warning. Those background threads should be used only in the course of your request processing. What you want is a background job processing facility like delayed_job to offload this.

Categories : Ruby On Rails

Gitlab in a subdirectory with apache and passenger
I don't think that Passenger is the easiest way to configure Apache for GitLab. Using a local reverse proxy is actually more simple. The lastest version of GitLab (6.0) is using Unicorn, but it almost the same with Puma. In your config/unicorn.rb file, comment listen directive and add: listen "127.0.0.1:9242" In your Apache configuration, you can then add ProxyPass /gitlab http://127.0.0.1:9242 ProxyPassReverse /gitlab http://127.0.0.1:9242 Restart Apache and GitLab, and it should work.

Categories : Ruby On Rails

Execute ruby file on passenger
You should have a look at something like Sidekiq or Clockwork https://github.com/tomykaira/clockwork https://www.ruby-toolbox.com/categories/scheduling https://www.ruby-toolbox.com/categories/Background_Jobs Hope this helps

Categories : Ruby On Rails

Passenger affects cookie expires
It was passenger bug "Autogenerated Date header must be in GMT" https://code.google.com/p/phusion-passenger/issues/detail?id=913 Bug was fixed in passenger version 4.0.13 http://blog.phusion.nl/2013/08/15/phusion-passenger-4-0-13-released/ "Autogenerated HTTP Date headers are now in UTC instead of local time. This could cause cookies to have the wrong expiration time. Fixes issue #913."

Categories : Ruby On Rails

passenger 4 and the asset pipeline: gzip_static on?
This has got nothing to do with the Phusion Passenger version and everything to do with your Nginx settings. And yes, that single config will take care of it. You may also want to set the caching headers.

Categories : Nginx

Passenger with Apache working with Rails App
Apparently I was getting the 500 error because my assets weren't precompiled; I took a look at /var/log/apache2/error.log, and got a lot of the following kind of output: [ 2013-07-18 15:52:14.4139 26976/7f6ee2809700 Pool2/Implementation.cpp:1182 ]: [App 27049 stderr] ActionView::Template::Error (login_icons/facebook.png isn't precompiled): [ 2013-07-18 15:52:14.4139 26976/7f6ee2809700 Pool2/Implementation.cpp:1182 ]: [App 27049 stderr] 9: <h3> [ 2013-07-18 15:52:14.4140 26976/7f6ee2809700 Pool2/Implementation.cpp:1182 ]: [App 27049 stderr] 10: Log in with [ 2013-07-18 15:52:14.4140 26976/7f6ee2809700 Pool2/Implementation.cpp:1182 ]: [App 27049 stderr] 11: </h3> [ 2013-07-18 15:52:14.4140 26976/7f6ee2809700 Pool2/Implementation.cpp:1182 ]:

Categories : Ruby On Rails

Flask Passenger WSGI on Dreamhost
If your passenger_wsgi.py has the following code at the end of it: from foo.bar import app as application ... then you need a sub-directory named "foo" with two files in it: one file named bar.py and another file named __init__.py so that Python recognizes that the directory contains module code. In your example, remove the dash from the folder name (penguicon-trax), since modules should have short, all-lowercase names. Then, your Flask application code would be in a file in $HOME/flask_env/penguicontrax/penguicontrax.py Lastly, run the following to try it out: touch $HOME/flask_env/penguicontrax/__init__.py python $HOME/flask_env/passenger_wsgi.py

Categories : Python

Alternative to using Passenger for rails on FreeBSD9.1?
Note: I work at Phusion. You can use any of the other app servers described at Ruby on Rails Server options. Unicorn, Puma, Thin... they will all get the job done, though not necessarily as easy as Phusion Passenger. But if you prefer Phusion Passenger then there's still hope. A pull request came in a couple of days ago which works around the FreeBSD bug: https://github.com/phusion/passenger/pull/87 I haven't got time yet to review the pull request (I'm too busy doing my yearly taxes) but perhaps you can try it out yourself. Installation instructions for the git repo are documented in the readme.

Categories : Ruby On Rails



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.