Tag Info

Hot answers tagged

7

Thin, or Passenger, or WEBrick, or any other such web server, has a single purpose. It takes an HTTP request from the network and passes it up to Rack, and returns the application's response onto the network. (Typically, Rack is used as one component of a complete Ruby application written with a framework such as Rails or Sinatra. It processes incoming HTTP ...


5

UNIX domain sockets are for local connections only. Exporting the file-system that they are on to another machine won't make that socket accessible over the network. See the Wikipedia article on Unix domain sockets for a little more information.


4

A coworker emailed the author of thin who confirmed 1 thin instance per core. Gets more interesting for hyperthreaded cores, but that is probably another question. Colleagues have said that mongrel blocks on IO. Thin uses eventmachine to not block on IO and uses Mongrel as the HTTP library.


4

You'll be configuring Apache as a "reverse proxy" - that search term will point you to a wealth of information regarding the configuration, but here's an example that should get you most of the way to the deployment you're looking for. If you'll be using a different hostname and different <VirtualHost>, then you can do something like this: ...


3

If you press F5 in htop you see the process hierarchy, which helps explain what you're seeing here. They're probably ordered like this 586 -> 677 -> 1077 -> 1082. 586 'su' - spawns 677 'export ...; cd ...; thin start ...' which spawns 1077 'thin start ...' which spawns 1082


2

Look in /var/www/chat/public/tmp/sockets/ - does thin.0.sock actually exist? As far as I know, Thin only supports TCP sockets, not Unix sockets. If you copied the Unix socket thing from a Unicorn-specific example, that would explain it, since Unicorn does support them. I suggest changing the upstream definition block to say server http://127.0.0.1:4567 or ...


2

While using RVM you have to create an rvm wrapper for thin with rvm wrapper <ruby_version>@<gemset> bootup thin and edit DAEMON variable at /etc/init.d/thin. The actual solution I found here


2

Theoretically, nc can take traffic on port 80 and ship it off to port 443. However, that's not going to work for you. You need a reverse proxy like nginx, apache, or other HTTP-aware bit that can do an HTTP-level redirect to instruct the browser to connect using HTTPS. nc can't operate at that level. Heck, you could even start up a very simple ruby app ...


2

Close port 3000 in your firewall. Then make sure you start thin in such a way that it is bound only to the localhost. This absolutely prevents inbound connections not originating from the local machine itself. For instance: rails server -b ::1 Or the old IPv4 way: rails server -b 127.0.0.1


2

The proxy_set_header and proxy_redirect directives should be in location @ruby block. For upstream block, you should use localhost and the actual port of your Ruby server. Without port, the upstream would connect to this nginx server instance, which is a loop.


2

include directive is what you're looking for. /etc/nginx/proxy.conf 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_redirect off; proxy_pass http://thin; /etc/nginx/nginx.conf server { server_name example.name; root ...


2

Try adding a source of the profile directory to your init script near the top. Looks like the $HOME variable isn't defined. . /etc/profile


2

newl in the #puppet channel suggested modifying ssl_verify_client to be 'optional', rather than 'on'. I've done this and everything's peachy now. I had myself convinced that this was a Bad Thing to do, but after newl's suggestion I couldn't recall why. If anyone does believe this to be a less than ideal configuration setting, do let me know.


2

You could create binstubs. using these the init-script should be like any other. thin just needs --damonize as parameter if you do not specify it in your thin.yaml. With thin install thin generates an init-script for you BUNDLE INSTALL --BINSTUBS If you use the --binstubs flag in bundle install(1), Bundler will automatically create a directory ...


2

If there's no option to feed thin a certificate path, then you'll want to create a single-file bundle which includes your certificate and the full path up to the root. However, I wouldn't advise doing it with the bundle downloaded from GoDaddy - that bundle has an invalid certificate signing path - GoDaddy messed it up (see my answer discussing this here). ...


2

I got it. http://articles.slicehost.com/2009/4/17/centos-thin-web-server-for-ruby http://articles.slicehost.com/2009/4/17/centos-nginx-rails-and-thin http://cloudservers.rackspacecloud.com/index.php/CentOS_-_Adding_an_Nginx_init_script http://cloudservers.rackspacecloud.com/index.php/CentOS_-_Nginx_from_source_layout


2

More than it is sane or not, if you are not a sysadmin and will take care of it, you will become a sysadmin, real fast. Are you up to it? :) I might be missing the point here, but let me tell a bit of my experience being a ruby dude playing as sysadmin on amazon: There is a lot of tricks that you need to do to run on amazon: - The ELB (Elastic load ...


2

This is a guess, but I think you might need to use this: SSLProxyEngine ON before the block. From here: http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#sslproxyengine


1

Have a look at thin -h. By the default, it located at log/thin.log.


1

Thin logging is rather sparse and not very flexible compared to usual suspects like Apache / Nginx. You could enable debug level logging in the standard log file by passing --debug option in the command line during Thin's execution, or adding debug: yes option to Thin's application configuration .yml file. For more gory details, you can also add --trace / ...


1

Mongrel instances may handle concurrent connections, but are you sure that all codepaths will never block? I recall that some gems still exist which block, which could cause you trouble. Instead of looking for hard rules, I defer to measurements in these kind of situations. Design a test which offers a reasonable approximation of expected traffic and ...


1

You can use sudo to run a command as any user:group with these options: sudo -u www-data -g www-data /etc/init.d/thin start -u sets the www-data user and -g sets the www-data group


1

How about two thin processes? One without --ssl, and hence bound to port 80, and the other with --ssl and bound to port 443? To be honest, I'd probably be more tempted to use Apache as a reverse proxy between the users and thin, and then have 2 virtualhost sections in your apache configuration.


1

After realizing that the error was from rails and not nginx or thin the issue was resolved fairly quickly by checking log/production.log in my Rails application. I had two problems. First the socket for my production db in config/database.yml was incorrect. I had to change it from the incorrect socket: tmp/mysql.sock to where it actually is on my system, ...


1

If you run a puppet agent on the master, you should make sure that they do NOT share SSL directories. I have seen Weird Stuff result from that configuration. Snippets from my /etc/puppet/puppet.conf: [main] # Where SSL certificates are kept for the puppet master and other # subcommands. # Note that this is a global setting because most of the subcommands # ...


1

The path that the client node is requesting is: /production/file_content/modules/supervisor/logrotate While the nginx config as written seems to be expecting: /production/file_content/supervisor/logrotate So, modules is caught by the first capture and supervisor/logrotate is caught by the second capture; the files that needs to go between the module ...


1

No, this is not possible. Either run it from inside Apache (e.g. with passenger) or use Apache as a proxy to route it to another port. However, if you don't use SSL at all on Apache (and that port is unused), you can run your app on port 443 if it also does the SSL, as port 443 is assumed if you give an HTTPS URL.


1

If you are using passenger here is what I had to use to get it working on www.mysite.com without using www.mysite.com:80 on a centos server: In etc/httpd/conf the key was to uncomment the NameVirtualHost *:80 and change the * to my server's IP address. Make sure Listen 80 is uncommented. Also add your ip to the VirtualHost tag. It must be running on port ...


1

I used the instructions here: http://jordanhollinger.com/2011/04/22/how-to-use-thin-effectivly to create a configuration file and start thin as a normal service at server boot. To get started, one would run: thin install It should set up a start up file in hopefully the proper directory, and tell you where it is. For me, in CentOS/Fedora I had to move ...


1

Servers like thin and webrick are great for prototyping, and unicorn and passenger are great application servers, but they are not designed to be full featured web servers. For this sort of thing you really should use an actual web server (e.g. apache or nginx with passenger) as it provides enough flexibility to do these sorts of redirects and other complex ...



Only top voted, non community-wiki answers of a minimum length are eligible