Why would you start multiple thin servers? [closed] - thin

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
In the Thin website: http://code.macournoyer.com/thin/usage/ it says that you can start multiple servers using:
thin start --servers 3
Why would you need to do this?
Is each server assigned a different port or something?

You would start more than one instante of thin if you may have concurrent requests to process. To manage concurrent requests (Simultaneous connections) you need a cluster of "thin".
Yes,
you can easily see this:
let's try a single-server thin
thin start -R fart.ru
Thin web server (v1.5.0 codename Knife)
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
check:
netstat -an | grep 300
tcp4 0 0 *.3000 *.* LISTEN
ok, we have a thin listening on one port.
now let's try a --servers 3
thin start -R fart.ru --servers 3
Starting server on 0.0.0.0:3000 ...
Starting server on 0.0.0.0:3001 ...
Starting server on 0.0.0.0:3002 ...
check:
netstat -an | grep 300
tcp4 0 0 *.3002 *.* LISTEN
tcp4 0 0 *.3001 *.* LISTEN
tcp4 0 0 *.3000 *.* LISTEN
voilĂ  you have 3 port listening.
ps -ef | grep thin
reports 3 processes running, each one can manage a concurrent request.
Ultimately to concurrently process requests you have to start a cluster of thin and reverse proxy your virtual host then load balance the request on the various thin you've started.
This blogpost can make the point: Scaling Rails with Apache 2, mod_proxy_balancer and Thin Clusters

Related

XAMPP 5.5.28 doesn't work on OS X 10.11 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
My iMac' OS was upgraded last night, to OS X El Capitan(version 10.11).
I use XAMPP 5.5.28. MySQL and ProFTPD are working, but the Apache Web Server doesn't work after the upgrade.
Even though the application log says..
Starting Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started
Then tried to start it on Terminal
$ sudo /Applications/XAMPP/xamppfiles/bin/httpd
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
I checked whether any other app uses the same port by
$ netstat -anp tcp | grep :80
And nothing uses it.
Anyway, to avoid the error, I changed the port 80 to 8888 by
$ vi /Applications/XAMPP/etc/httpd.conf
Then tried to start the web server on Terminal again, and it worked.
Now wondering
Which process uses port 80?
How can I start the web server via Application Manager of XAMPP?
Any help is appreciated.
I had the same problem
And I thought this is a dead end for El Capitan
BUT i got it working now:
The problem was apache was already running, no idea how.
So just go to terminal and type (Login as root user)
sudo su -
cd /etc/apache2/
apachectl stop
exit
Then go to XAMPP and try to start apache from there.
If this doesn't work, restart your system, then go to terminal:
sudo su -
cd /etc/apache2/
apachectl start
apachectl stop
exit
Then go to XAMPP and try to start apache from there.

Apache Cannot bind to port 80 [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 months ago.
Improve this question
I'm trying to use Bitnami MAPP Stack 5.5.30-0
(For Apache Web Server, PostgreSQL)
When I try to configure the Apache Web Server I get this error: "Cannot bind to port 80. It is probably taken by another application or you don't have enough privileges.
I don't want to change and use another port. I really want to use the port 80.
I don't know what app is using the port 80.
I am running MAC OS X Yosemite
I tried this command:
sudo lsof -i ':80'
But nothing is running on this port.
I opened the httpd.conf and I tried to change the listen port to 80. But still not working.
Can someone help me?
Thank you
Maybe you already have Apache or Nginx running but you need to stop both of them before starting Apache with XAMPP. You can do this with:
To stop Apache: sudo /etc/init.d/apache2 stop
To stop Nginx: sudo nginx -s stop
This means that you either have another process that is already using port 80 or you don't have enough privileges. The following unix command might shed some light. You can run it in terminal:
sudo lsof -i ':80'
Check out this link as well.
If it turns out that you don't have enough privileges, try to configure / run apache using sudo. (sudo stands for superuser do). Note: this maybe a quick fix to get you going on your local machine, but it is not recommended on a production machine.

Why can I ping a server but not connect via SSH? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
When I ping my server, it responds:
user#localhost:~$ ping my.server
PING my.server (111.111.111.11) 56(84) bytes of data.
64 bytes from my.server (111.111.111.11): icmp_req=1 ttl=42 time=38.4 ms
64 bytes from my.server (111.111.111.11): icmp_req=2 ttl=42 time=50.0 ms
64 bytes from my.server (111.111.111.11): icmp_req=3 ttl=42 time=58.6 ms
^C
--- my.server ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 38.419/49.037/58.637/8.287 ms
but when I try to ssh (something that I always do, and have been doing for the past few hours on the same connection), it hangs:
user#localhost:~$ ssh my.server
http://speedtest.net says that my connection has 1.5 Mbps download and 0.4 Mbps upload speed.
Is there a reason that ssh hangs?
Results from suggestions provided in answers
from #nsfyn55
user#localhost:~$ telnetmy.server 22
Trying 111.111.111.11...
Connected to my.server
Escape character is '^]'.
SSH-2.0-OpenSSH_4.3
Connection closed by foreign host.
from #vahid:
user#localhost:~$ nc -v -w 1 111.111.111.111 -z 22
nc: timeout cannot be negative
ping (ICMP protocol) and ssh are two different protocols.
It could be that ssh service is not running or not installed
firewall restriction (local to server like iptables or even sshd config lock down ) or (external firewall that protects incomming traffic to network hosting 111.111.111.111)
First check is to see if ssh port is up
nc -v -w 1 111.111.111.111 -z 22
if it succeeds then ssh should communicate if not then it will never work until restriction is lifted or ssh is started
Find out two pieces of information
Whats the hostname or IP of the target ssh server
What port is the ssh daemon listening on (default is port 22)
$> telnet <hostname or ip> <port>
Assuming the daemon is up and running and listening on that port it should etablish a telnet session. Likely causes:
The ssh daemon is not running
The host is blocking the target port with its software firewall
Some intermediate network device is blocking or filtering the target port
The ssh daemon is listening on a non standard port
A TCP wrapper is configured and is filtering out your source host
On the server, try:
netstat -an
and look to see if tcp port 22 is opened (use findstr in Windows or grep in Unix).

Nginx wont leave! how to remove it [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've run nginx once and now I cannot get rid of it. when I run apache on my server localhost still point to that welcome to nginx i dont know why. I'm on windows 7.
To kill nginx process.
If you are sure nginx is actually running, You just need to kill nginx.exe process and re-run apache.
Open Run (Window key + R) OR commend prompt (cmd.exe) and Paste below command,
taskkill /F /IM nginx.exe
To find which process is holding port 80.
Here is netstat command & output to find which process is holding port 80.
C:\> netstat -n -a -o | findstr "0.0.0.0:80"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1588
^ Here, 1588 is PID of process holding port 80.
So, below is sample command to get Process name from PID 1588.
C:\> tasklist /svc /FI "PID eq 1588"
Image Name PID Services
========================= ======== ============================================
nginx.exe 1588 N/A
So, it shows that nginx.exe is holding port 80.

Sometimes, SSH stop to listen on port 22 on my dedicated server [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I don't know why but sometimes, on my server, i can't connect to my server with ssh on the port 22. So, in the sshd_config file, i add the line "Port 2233" after the line "port 22" which make me able to connect on this port even when the 22 doesn't answer.
Thus i'd like to know why sometimes, ssh on port 22 doesn't work, and after a while, without intervention, it's back
Thank you all.
You have rate-limiting active in your iptables. I didn't analyze them, but if you retry without those rules, it will probably work.
Like this, only 10 connections in 5 minutes:
REJECT tcp -- anywhere anywhere tcp dpt:ssh state NEW recent: UPDATE seconds: 300 hit_count: 10 name: DEFAULT side: source reject-with icmp-port-unreachable