I tried using this perl script which supposedly restarts apache when server load reaches 5 and above
Code:
#!/usr/bin/perl -w
#use strict;
$|++;
open(LOAD,"/proc/loadavg") || die "couldn't open /proc/loadavg: $!
";
my @load=split(/ /,<LOAD>);
close(LOAD);
if ($load[0] > 5) {
`/sbin/service httpd restart`;
}
and placed it in /usr/local/script/loadavg.pl and chmod to 755
and added this to my crontab
*/1 * * * * root /usr/local/script/loadavg.pl
my server load went up to 20 and waited if it will automatically go down via the script but it seems it's not working. I had to restart apache manually.
I have installed image::magick perl module but its not running error is :--
Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230. at flickr.pl line 55 Compilation failed in require at flickr.pl line 55. BEGIN failed--compilation aborted at flickr.pl line 55.
an inexpensive VPS host and based on reviews on this forum, went with Web Wide Hosting.
I had a smooth signup and thanks to Jon at WWH, managed to get a payment snafu with Paypal resolved smoothly.
However, I've been struggling a lot with getting most recommended steps to actually work in my VPS and I'm getting increasingly frustrated.
The latest problem I have is that trying to install Perl modules fails with a "cannot allocate memory" error. First google hits suggest increasing memory, which really isn't an option for me right now. More puzzling is the fact that both HyperVM and user_beancounters suggest I have enough headroom atleast to install perl modules!
Output from session:
cpan> install Authen::PAM CPAN: Storable loaded ok Going to read /root/.cpan/sources/authors/01mailrc.txt.gz Going to read /root/.cpan/sources/modules/02packages.details.txt.gz Database was generated on Mon, 11 Aug 2008 07:02:52 GMT HTTP::Date not available
There's a new CPAN.pm version (v1.9205) available! [Current version is v1.7602] You might want to try install Bundle::CPAN reload cpan without quitting the current session. It should be a seamless upgrade while we are running...
Going to read /root/.cpan/sources/modules/03modlist.data.gz Could not pipe[/bin/gzip --decompress --stdout /root/.cpan/sources/modules/03modlist.data.gz |]: Cannot allocate memory at /usr/lib/perl5/5.8.8/CPAN.pm line 5726.
Running programs named Perl with Heavy CPU usage, with the ownership of user apache.
We found the problem on Fedora 3 and Fedora 6.
In our case, it was the result of a Trojan activity.
Quick Solution
Check the cron jobs of user apache crontab -u apache -e */1 * * * * perl /tmp/.tmp/tmpfile delete the cronjob entry. Also delete the file /tmp/.tmp/tmpfile also added "apache" to the file /etc/cron.deny
*/5 * * * * /usr/local/bin/php -c /home/USER/php.ini /home/USER/public_html/poller.php > /dev/null 2>&1 I've checked my logs, and I can find no errors anywhere. When I run the commands manually via SSH, they work perfectly, they simply are not being run automatically the way they are supposed to be.
I have checked, and the crond service is running. I have tried restarting it, but it seams to have no affect. I really have no idea what the issue is. The only thing I seam to have found at one point, was the possibility that the files within the /etc/cron.d directory might be CHMOD'ed wrong, but I haven't found anything to confirm this either way.
[root@server cron.d]# ls -all total 60 drwxr-xr-x 2 root root 4096 Dec 17 03:07 . drwx--x--x 94 root root 12288 Jan 3 09:28 .. -rw-r--r-- 1 root root 61 Jun 22 2007 csf_update -rw-r--r-- 1 root root 81 Apr 11 2007 lsm -rw-r--r-- 1 root root 79 Jun 22 2007 prm -rw------- 1 root root 366 Feb 23 2007 sa-update -rw-r--r-- 1 root root 82 Jun 22 2007 spri -rw-r--r-- 1 root root 188 Nov 16 23:14 sysstat [root@server cron.d]#
I have just recently moved to Plesk web admin from cpanel. I have been trying to get the cron to run for the past 48 hours but no luck. Bellow is the code i have been trying to execute via cron but It does not run.
"/usr/bin/php /var/www/ vhosts/mydomain. com /httpdocs/billing/index.php cron"
This one's pretty simple really, but given the fact that I'm constantly running into crond stops with CPanel servers (no clue why, or where, but it's happening), I'll post this here. If it helps someone, then great, if not, hey, no worries.
Firstly, login as root to your server through ssh, however you usually do .
Next, the script (we'll call it /bin/croncheck.sh). Use whatever editor you choose to create the file.
A client's server's password was guessed, and the hacker conveniently uninstalled perl. I can't seem to get perl reinstalled. Any ideas on how this would be done? RPM, TAR's and YUM don't work, as they require perl!
all we know that perl language its using in alot of scripts and alot of system admins stop it why this why u dont try stopp the problems from it and make ur client have perl to used it in scripts lets try this if some one need to see passwd he will do cat /etc/passwd what about make this chmod 700 /bin/cat and he will used wget to get files what about this chmod 700 /usr/bin/wget and lynx what about chmod 700 /usr/bin/lynx in this case we make root only can using this commands any system admin sure know now the idea and he can use it as he want ,, this secured method not only in perl its in another programing language put i give this as a clear exampel.
I have a Centos VPS with Cpanel. I have begun receiving some email notifications, apparantly from my cpanel... The latest one says that the version of perl I am running is too old.
Subj: [checkperlmodules] perl version too old (v5.8.8 required, v5.8.7 is installed.)
Are there any problems or dire consequences from upgrading or side effects? What version should I upgrade to?
ive been trying to install it for about 3 hours and ive finally got it working. now, how do i configure it to be nice and secure?
first thing is that i want to restrict which paths people can use in scripts. my site needs to access any paths but site users can only access their own directories. i want the exact same thing as in this thread but with perl instead of php
how do i block certain functions and which ones do i block? i heard perl and php are very similar so im guessing i want to block similar functions to the ones listed here
Code: PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 9488 nobody 25 0 1612 1280 1108 S 21.1 0.2 619:37 1 perl bodyb3 200.101.193.42 0 5000 I also ran netstat -n and found this: Code: udp 15184 0 server.host.com:55936 ns1.datacenter.net:domain ESTABLISHED
Testing connection speed...(this could take a while)...Done Ping:2.016 Testing connection speed to cpan.erlbaum.net using pureperl...(157450.00 bytes/s)...Done Ping:2.316 Testing connection speed to cpan.belfry.net using pureperl...(157450.00 bytes/s)...Done Ping:1.911 Testing connection speed to cpan.glines.org using pureperl...(104300.00 bytes/s)...Done Three usable mirrors located Mirror Check passed for cpan.erlbaum.net (/index.html) Unknown config variable 'less' commit: wrote '/usr/lib/perl5/5.8.8/CPAN/Config.pm' CPAN: File::HomeDir loaded ok (v0.65) CPAN: Storable loaded ok (v2.16) Going to read /home/.cpan/Metadata Database was generated on Wed, 15 Aug 2007 01:38:08 GMT Acme:pork is up to date (0.0.7). perlmod--Install done