Scripts To Auto Restart Server When CPU Reaches A Limit
Jun 17, 2009way to restart httpd when my CPU or http connection is reaching a limit? I would rather have it restarted then having it down.
View 14 Repliesway to restart httpd when my CPU or http connection is reaching a limit? I would rather have it restarted then having it down.
View 14 RepliesIs there any scripts that can warn ( as email ) when maxheld reaches barrier/limit in openvz
View 0 Replies View RelatedIs anyone experiencing that cpanel automatically restarts mysql at 2AM?
I'm curious is that new feature or something has gone wrong?
This has started after cpanel upgrade mysql to 5.0.67 version.
I'm not so good with cpanel so please can somebody tell me where cpanel holds its crons?
I cannot find nothing in /etc/cron.* or in cron -l, and I want to turn this option off.
is there a way to automate apache restart when my server's load reached 5+ sever load?
View 8 Replies View RelatedApache service auto restart many times ( every minute ).
View 10 Replies View RelatedI woke up this morning and saw my site say "500 internal server error".
I restarted lighttpd and it works again. I check the logs and see:
2008-01-05 08:39:16: (mod_fastcgi.c.2885) backend died; we'll disable it for 5 seconds and send the request to another backend instead: reconnects: 2 load: 1
2008-01-05 08:39:21: (server.c.1470) server stopped by UID = 0 PID = 6391
Is there a way to get lighttpd to restart automatically when it has these errors?
ive got a fairly beefy server but at the moment its hosting alot of resource intensive sites (unfortunatly i dont currently have a choice on where to run them all) and apache is crashing to the point its taking upto 2 mins to load pages within about 24hours but once restarted is fine again. so im wondering if anyone can suggest a way to automaticly restart apache via a cron job every 24hours or so?
View 6 Replies View RelatedI am getting a bsod on a windows 2003 server but its so quick I can't even read it just know the color of the screen when it pops up its that quick. F8 to bring up safe mode options but to disable automatic restart on system failure... its not there. Everything else is but that so how am I to stop the auto reboot?
View 3 Replies View RelatedI have root ssh access to a server and we notice when doing a bash ./mysq-backup script to dump the data from the web site's databases into .sql and .tgz them that httpd goes down sometimes. That, and sometimes it seems that httpd goes down in other situations. All fine, we will figure out why. But ..
It would be nice to run a crontab to check every 15 minutes if httpd is running, if not, to restart it.
Right now I when I notice the site is down I log into the ssh as root and type: service httpd restart. If it is up it will then first stop it, and restart it. I can look at the screen and see it happen, so I feel pretty safe doing this. One of my concerns is that when I am not at the screen and it stays down .. I do not notice this and downtime increases. And we don't want to just crontab service httpd restart, so a bash script to check for the pid and restart if it down .. would be nice.
I thought this would work:
(chmod 755 httpdcheck)
Code:
delta:~ root# cat httpdcheck
#!/bin/bash
if [ ! "$(pidof httpd)" ]
then
echo "Could not find pid of httpd - restarting"
service httpd restart
else
echo "Found pid of httpd - NO need to restart"
fi
delta:~ root#
And I have this crontab entry:
Code:
delta:~ root# crontab -l
*/5 * * * * /root/httpdcheck | mail my@email
delta:~ root#
When testing, I did service httpd stop and waited 5 minutes and I received the email : could not find it, restarting. But when I go to the web site in browser it remains down. I have to login to ssh and do service httpd start manually to really load it.
Manually loading btw .. shows it works as bash script just fine, so I dont't know why it won't work when run from cron?
Code:
delta:~ root# ./httpdcheck
Could not find pid of httpd - restarting
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
delta:~ root#
So .. when is it going wrong? Am I forgetting something?
I'm using a Virtuozo - Plesk 8.6 based VPs. Since the first day I'm suffering hundreds of brute force ssh atacks. I decided to use BFD in combination with APF, and other security measures (thanks to the tutorial aboput securing VPS of this forum )
Since I installed APF, the value of numiptents reaches the maximum every few hours. The maximum value allowed in my vps is 256, and my provider says that he can not increase it (unless I upgrade to a more expensive plan ).
Is there any thing I can do to fix this problem? Perhaps an cron iptables flush every two hours or something like that?
What problems can I have when the numiptents value reachs the maximum?
I am using apache 2.2 webserver and tomcat 6 as app server.
I have two unix boxes (let say A and B) where apache is installed for load balancing purpose.
The issue is now and then I see that on both the server reaches to 250 busy servers which makes my site very slow and after some time the site is unaccessible.
When I see this I restart apache on both unix boxes and also restart my app server.
But that does not work. As soon as I start apache the httpd process ramps up to 12 (ps -ef | grep httpd) within a minute and the busy servers still remains at 250.
The only I have to do is wait and watch till the busy servers goes down to 250 and then site is back to normal.
Some times it takes hours for busy servers to go down below 250.
I dont understand that why even restarting apache and tomcat doesn't work. why the busy servers are still at 250. even after I restart.
This is what I have in httpd.conf
<IfModule worker.c>
ServerLimit 80
StartServers 2
MaxClients 250
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
I tried to increase MaxClients to 300, which also didn't work and apache or httpd process shuts down by itself.
I migrated from one server running Plesk 10.4.4 Update #59 to a new server running Plesk 11 which I then updated to 12.0.18 Update #32. Since moving to Plesk 12 the "Notify when disk space/traffic usage reaches" emails have been being sent to our customers set up on the server whereas previously they were sent to the server admin email address.
Is this a change with this version?
I'm on my first VPS with Virtuozzo / WHM and I'm wondering about what some general guidelines regarding best practices are in regards to restarting services and or the server. Specifically, I'm wondering what a good time frame it to restart the server and sevices.
I've been told VZ doesn't need to be restarted, but I figured that by restarting VZ, I restart everything at once... is this bad? How often should I do this or not do this?
Alternatively, if I just restart specific services, what is your experience on a good timeline and what services are important to restart?
I've read that mysql doesn't need to be restarted, but am wondering EXIM, http server, dns server, pop3 server, imap server, etc.... specifically what good schedule would be regarding restarting.
I'm simply trying to avoid issues that may occur due to not restarting and trying to be proactive as my clients are extremely important to me... ...
I don't know if this is possible after searching on the internet for solutions. Here is the problem. I recently logged off my colocated server 2 days ago, and have been trying to log into it again like I always do using remote desktop. Each time I try it gives me this following error: "This computer can't connect to the remote computer. Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator."
I've had this server colocated for about 5 months now and I've never had any issues connecting remotely to it. Seems like Remote Desktop got broken somehow, or it's being blocked? I am an admin with logins/passwords etc. The OS is Windows Server 2003 R2, I'm not connected to a remote reboot console. I don't want to have to call the data center for remote hands on support for a restart if that's not going to fix the issue, from what I've heard they charge quite a bit.
anyway to auto reboot server every 6 hours?
will this effect on the server?
i'm running on CentOS 5 and whm
I am not being able to restart the server, or MySQL or httpd via SSH.
PHP Code:
root@server [~]# /etc/init.d/httpd fullstatusLooking up localhostMaking HTTP connection to localhostAlert!: Unable to connect to remote host.lynx: Can't access startfile http://localhost/server-statusroot@server [~]#
PHP Code:
root@server [~]# /etc/init.d/mysql reload/etc/init.d/mysql: line 244: kill: (3375) - No such processtouch: cannot touch `/var/lib/mysql/server.lubnan.us.pid': Read-only file system
I have a problem with time at one RHEL 4 server, it is a plain box, and from time to time the time (hours) seems to be auto modified, no one is touching the box and then from once it got modified to a few hours less than what we specified, to change time and date we always use:
Code:
date --set "2007-10-24 13:35"
hwclock --set --date="2007-10-24 13:35"
The only thing that I noted is that ntpd daemon was running, while in the rest of our plain box it is not running, maybe this is the reason the system is auto chaning the time?
i've added a few bits to my hosts file, via ssh, and every time i restart the server, it resets the host file,
View 5 Replies View Relatedi have strange problem in my server
in some times all sites stopped and didn't work
when i do restart to DNS Server (BIND)
after done it works good
I try to upload a big file between 300 and 500 MB by FTP to my dedicated server but connection is broken and when I try to do the resume it's not allowed how can I enable upload big files and resume files in ProFTPD 1.3.0a or am I missing something inthe conf file ?.
Here is the log: ..........
My host is experiencing "issues" with my WordPress. It keeps going above their upper limit of open MySQL connections. So, while I am diagnosing it, I need to restart the server every few hours to avoid it going down.
How do I write a cron to restart Apache every 3 hours?
Anyone know a good script that I can run with cron or something? Mysql seems to be the #1 problem with a lot of my web sites, a restart usually fixes it right away for me, but I can't keep restarting my servers everyday manually.
View 1 Replies View Relatedhow to automatically enable nginx by default for all domains/subscriptions and or even just as a whole since we do not use apache at all.
View 18 Replies View RelatedWhen I restart my server all my domains opens at apache test page. Suspending and reactivating any domain fixes all domains.
View 4 Replies View RelatedI have an address that receives hundreds and hundreds of e-mails a day. It's an address people aren't supposed to use (basically noreply@mydomain.com), but people do. I'd like to stop being the guy that gets these and routes them as appropriate, but we can't just turn it off and cause a hard bounce, because that will bewilder too many people who don't get that replying to noreply@mydomain.com is a bad idea. (Our website sends out notifications to people. A lot of people reply for various strange reasons, and we also get a lot of autoresponders sending us junk.)
I'm a Linux admin, so I'm a bit out of my league -- this needs to be configured on our Exchange box.
What I'd really like is an auto-responder for this address that will tell people that they e-mailed a mailbox that no one uses, and give them directions on how to contact a real person if need be.
However, fully half of the e-mails we receive are people's auto-responders. Is an Exchange auto-responder going to reply to their auto-responder? This will completely bewilder people.
And if this will auto-respond to auto-responders, is there a cleaner solution here? Again, it's got to be Exchange, but I'm a Postfix guy, so I have very little experience here.
An automatic backup in plesk has filled up the disk space in my VPS. It seemed to crash first of all - couldn't access my website, then i tried to restart it. It wont restart and comes up with the error below.
As i can't get into plesk i don't know how to delete these old backup files, seem to be in a catch 22. Help
Jul 17, 2008 01:05:33 PM Start Process Completed
Jul 17, 2008 01:05:33 PM Click here to open/close operation details.Start VPS #48606643 Failed
Jul 17, 2008 01:05:33 PM Operation start with the VPS(s) VEID48606643 is started.
Jul 17, 2008 01:05:33 PM Starting VE ...
Jul 17, 2008 01:05:33 PM vzquota : (warning) block_soft_limit [10000100] < block_current_usage [10099244]
Jul 17, 2008 01:05:33 PM VE is mounted
Jul 17, 2008 01:05:33 PM Setting devperms 20002 dev 0x7f00
Jul 17, 2008 01:05:33 PM Setting devperms 20007 dev 0xac8
Jul 17, 2008 01:05:33 PM Adding port redirection to VE(1): 4643 8443
Jul 17, 2008 01:05:33 PM Adding IP address(es): 212.227.251.151
Jul 17, 2008 01:05:34 PM ERROR: Can't write to file /etc/sysconfig/network-scripts/ifcfg-venet0
Jul 17, 2008 01:05:34 PM bash: line 264: echo: write error: Disk quota exceeded
Jul 17, 2008 01:05:35 PM vzquota : (warning) block_soft_limit [10000100] < block_current_usage [10099244]
Jul 17, 2008 01:05:35 PM VE is unmounted
Jul 17, 2008 01:05:35 PM VE start failed
Jul 17, 2008 01:05:35 PM Operation start with the VPS(s) VEID48606643 is finished with errors: #1004 Error invoking vzctl utility: Starting VE ... vzquota : (warning) block_soft_limit [10000100] < block_current_usage [10099244] VE is mounted Setting devperms 20002 dev 0x7f00 Setting devperms 20007 dev 0xac8 Adding port redirection to VE(1): 4643 8443 Adding IP address(es): 212.227.251.151 ERROR: Can't write to file /etc/sysconfig/network-scripts/ifcfg-venet0 bash: line 264: echo: write error: Disk quota exceeded vzquota : (warning) block_soft_limit [10000100] < block_current_usage [10099244] VE is unmounted VE start failed . Failed
Jul 17, 2008 01:05:35 PM Complete Process Failed
What could I fix by trying to start mysql server, recieve following errors:
plesk interface:
Code:
Failed to restart the "mysql" service.
Cannot start/stop/restart service: Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mysql ; start mysql. The restart(8) utility is also available.
start: Job failed to start
from the console:
Code:
sudo service mysql start
start: Job failed to start
Code:
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
output of plesk_11.5.30_reset_instance_data.log:
[Code] ...
If you rename a domain, fail2ban will stop working, since it still tries to open the old path the the web access log.
One workaround is to restart the server after renaming the domain, then fail2ban paths are updated.
I'm using plesk 12.0.18.