Status
Not open for further replies.

xandor

Active Member
209
2011
21
0
I have a dedicated server.
Yesterday at ~07:00 my websites on it suddenly became unavailable, I didn't think much about it because I had to leave home and when I came back it was working fine.
But then it stopped working again at midnight, it is still not available now 10 hours later so it is a serious problem.

I can: Use SSH, webmin and SFTP.
I can't: view my websites (got 2 on it, none work). use phpmyadmin.

There is no difference if I use domain name or ip.
The server is not overloaded and it does not have many connections on it.
~5 users are able to load a page every 5 min (it shows even if it lacks formatting or something like that so it looks a bit wierd).
I don't think any ip have been banned since it is possible to view a page every now and then.

Anyone have any idea what the problem is?
I asked my hosting provider and they said it was a issue that several applications used port 80 and that they fixed it, although it is still the same issue.
 
11 comments
Check if Apache is running.

service httpd status

If not use service httpd restart

well that's probably the solution.

but.
I asked my hosting provider and they said it was a issue that several applications used port 80 and that they fixed it, although it is still the same issue.
this looks like you have apache and another service running at the same time.
just check what services are listening to port 80

Code:
 netstat -an | grep ':80'

of course logs are helping, too ^^
 
check your server load
It is at 0% and 0.00.

Check if Apache is running.
Tried with "/etc/init.d/apache2 restart" but it didnt help.



What my hosting provider said:
We see that your server is listninig at port 80, netstat shows that apache2 is listening on port 80
Is this bad? Not sure how I should change it if I should change it.
Also it was working fine before...

server reached MaxClients setting, consider raising the MaxClients setting
Not sure how I can reach maxclients with no users online? or maybe it is the search engines that is messing up my website. Google is fetching 5-10k pages per day. Not sure how many the other search engines fetch but a widget I have that shows online users show ~500 users online.

My apache settings:
Code:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>
<IfModule mpm_event_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>
Should I change the apache settings? Should probably raise max clients since I got that error, but not sure exactly what I should change.

EDIT: Tried with changing max clients in all 3 areas to 256, but still cant access website. Not sure what to do.
 
Last edited:
First of all the only approach you may have to this is to change max clients to 1000 in case you are receiving a ddos attack.
This way if the page loads then you know its a ddos or your traffic has increased.

At the same time once you have changed the amount of clients restart apache via ssh and keep ssh open so if you notice your server is reaching its limits you can stop apache fast via ssh.

Only reason i say 1000 is because you mentioned a widget your using says 500 which could mean anything from a spoofed ddos to increased traffic.
 
I think that widget is over a longer time than what apache see. Max clients for apache is 256 it seems, i tried setting it to 350 but it showed a error and told to use max 256. (and it didnt help, maybe too low, think search engines might be visiting my website too much, a few days ago they started to index my new posts within 10 min)
 
Your host said other applications are using port 80, you may have more than one web server installed and they cant both run on the same port.

When the site is down check what is using port 80
netstat -netpula | grep -E ":80"
 
Tried the command.
It showed a list that is longer than putty shows.
All it is showing are either apache2 or has no value there with TIME_WAIT or CLOSE_WAIT.

Not sure what this list really means.


I tried to disable iptables. Not sure if I did it properly though.
Used this:
Code:
iptables-save > /root/firewall.rules iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
Also, the website is working better than before now (I don't think it is anything I have done to it, I think it was more overloaded or similar in some kind of way. Not the cpu but maybe network or something)
It still shows offline now and then and all images are not always loading when it works.
I am pretty sure the server will became very unavailable again soon, think it is just temporary that it is less bad.
 
Common issues causing apache to fail would be "log files" are too big. Sometimes if they're 2 GB it will cause your apache to fail.

Find the root patch of your apache directory and then find the logs folder.

Code:
du -sh *

This will show the space of all files within that directory, Anything larger than 2GB, I'd consider you to delete.

After you done so, I'd advise:

Code:
killall -9 httpd

Then will killall processes of apache, if none are found you might have to change it to apache2 or the proper name.

Hopefully this will be a solution for you!
 
Status
Not open for further replies.
Back
Top