1
2
3
|
#Redirect your Homepage from HTTPS to HTTP
RewriteCond %{HTTPS} on
RewriteRule ^$ http://%{HTTP_HOST} [L,R]
|
Category Archives: Linux
Exim Error :File size limit exceeded
While working on one of the vps client issue we came across the following error
“Starting exim: /bin/bash: line 1: 28406 File size limit exceeded/usr/sbin/exim -bd -q1h -oP ”
root@server [/]# /etc/init.d/exim restart
Shutting down exim: [FAILED]
Shutting down spamd: [ OK ]
Starting exim: /bin/bash: line 1: 28406 File size limit exceeded/usr/sbin/exim -bd -q1h -oP /var/spool/exim/exim-daemon.pid
[FAILED]
0 processes (antirelayd) sent signal 9
The error is due to exim_mainlog file exceeding capacity of 2GB
-rw-r—– 1 mailnull mail 2147483647 Oct 1 15:54 exim_mainlog
We truncated this exim_mainlog and restarted exim to fix this issue
root@server [/var/log]# /etc/init.d/exim restart
Shutting down exim: [FAILED]
Shutting down spamd: [ OK ]
Starting exim: [ OK ]
0 processes (antirelayd) sent signal 9
Starting spamd: [ OK ]
Got error 28 from storage engine (1030) Mysql
While working on clients server today I got the error on database while making backup of all the database using mysql dump
The error was ” Got error 28 from storage engine (1030)”
root@hostonline [/tmp]# mysqldump –all-databases > all_databases.sql &
[1] 19341
root@hostonline [/tmp]# mysqldump: Couldn’t execute ‘SHOW TRIGGERS LIKE ‘phpbb\_posts”: Got error 28 from storage engine (1030)
After doing bit of googling I could see the error is due to lack of disk space or inodes in the hard disk or partition
I could see it was due to lack of space in /tmp
I increased the /tmp size using below steps
root@hostonline [/tmp]# /etc/init.d/cpanel stop
Stopping tailwatchd: [30832] [2015-09-10 01:27:18 -0500] [main] Current process ‘25903’ stopped
[ OK ]
Stopping cPanel services: [ OK ]
Stopping cPanel dav services: [ OK ]
Stopping cPanel queue services: [ OK ]
Stopping cPanel brute force detector services: [ OK ]
Stopping cPanel log services:
Stopping cPanel Chat services: [FAILED]
Stopping cPanel ssl services: Waiting for (?^:^(?:stunnel$|stunnel-[0-9\.]+local)) to shutdown … not running.
[ OK ]
root@hostonline [/tmp]# /etc/init.d/mysql stop
Shutting down MySQL…… [ OK ]
root@hostonline [/tmp]# /etc/init.d/httpd stop
httpd stopped
root@hostonline [/tmp]# umount -l /tmp
root@hostonline [/tmp]# umount -l /var/tmp
root@hostonline [/tmp]#
root@hostonline [/tmp]#
root@hostonline [/tmp]# mv /usr/tmpDSK /usr/tmpDSK_back
root@hostonline [/tmp]# vi /scripts/securetmp
Now change tmpdsksize paramater to 2048000
Save file and now run below command
root@hostonline [/tmp]# /scripts/securetmp
Would you like to secure /tmp & /var/tmp at boot time? (y/n) y
Would you like to secure /tmp & /var/tmp now? (y/n) y
Securing /tmp & /var/tmp
Calculating size on /tmp
/tmp calculated to be 4096 M based on available disk space in /usr
No separate partition for tmp!
Building /usr/tmpDSK…4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB) copied, 37.5703 seconds, 114 MB/s
mke2fs 1.39 (29-May-2006)
/usr/tmpDSK is not a block special device.
Proceed anyway? (y,n) Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
524288 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.39 (29-May-2006)
Creating journal inode: done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Done
Setting up /tmp… Done
Setting up /var/tmp… Done
Checking fstab for entries …Done
Logrotate TMPDIR already configured
Process Complete
root@hostonline [/tmp]# /etc/init.d/cpanel start
Starting cpanel:
Waiting for cpaneld to shutdown … not running.
Waiting for webmaild to shutdown … not running.
Waiting for cpdavd-ssl to shutdown … not running.
Waiting for cpanellogd to shutdown … not running.
Waiting for entropychat to shutdown … not running.
Waiting for eximstats to shutdown … not running.
mailmanctl: no process killed
Waiting for eximstats to shutdown … not running.
[+] No running cPGreyList process found.
You may be running this update interactively from within WHM.
It is necessary we restart cpsrvd, but this will kill the session displaying update progress.
Please see the logs in /var/cpanel/updatelogs/ for further information if the update progress stops
==> SMTP Mail protection has been enabled.
All outbound SMTP connections will be redirected to localhost except:
uid is root (ports: 25,26,465,587)
uid is cpanel (ports: 25,26,465,587)
gid is mail (ports: 25,26,465,587)
gid is mailman (ports: 25,26,465,587)
The “cphulkd” service is disabled.
root@hostonline [/tmp]# /etc/init.d/httpd start [ OK ]
httpd starting
root@hostonline [/tmp]# /etc/init.d/mysql start
Starting MySQL [ OK ]
root@hostonline [/home]# mysqldump –all-databases > all_databases6.sql
Mysqldump is ready now 🙂
vzquota : (error) Quota on syscall for id 248: Device or resource busy
While working on Virtualizor I could come across an error where vps was not starting
I could get below error
[root@hostonline lock]# vzctl start 248
Starting container…
Warning: configuration file for distribution cpanel-Centos64 not found, using defaults from /etc/vz/dists/default
vzquota : (error) Quota on syscall for id 248: Device or resource busy
vzquota : (error) Possible reasons:
vzquota : (error) – Container’s root is already mounted
vzquota : (error) – there are opened files inside Container’s private area
vzquota : (error) – your current working directory is inside Container’s
vzquota : (error) private area
vzquota : (error) Currently used file(s):
/vz/private/248/var/spool/exim/input/T/1ZMogT-0000tf-4T-D
vzquota on failed [3]
The issue was due to some process locking the file in container which was not allowing vps to be started or rebooted
The solution to this issue is to find the process locking up the vm on node
The command is mentioned below which is lsof ( list of open file )
[root@hostonlinevar]# lsof 2> /dev/null | egrep ‘/vz/root/248|/vz/private/248’
bash 95741 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
lsof 125649 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
egrep 125650 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
lsof 125652 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
Kill the respective processes mentioned above
And again check if there is any process still active locking vps
[root@hostonine ~]# lsof 2> /dev/null | egrep ‘/vz/root/248|/vz/private/248’
Now VM is starting fine after killing the process locking the vm
[root@hostonline ~]# vzctl restart 248
Restarting container
Starting container…
Warning: configuration file for distribution cpanel not found, using defaults from /etc/vz/dists/default
Container is mounted
Adding IP address(es): 193.114.189.47 193.114.189.48
Setting CPU limit: 10
Setting CPU units: 1000
Setting CPUs: 2
Setting devices
Container start in progress…
[root@hostonine ~]#
Maildelivery Report blank cPanel/WHM
Maildevery Report sometimes does not seem to work in WHM .
The issue is due to corruption in exims stats database and tables in it
Below is the fix for same
#Login to Mysql as root
root@host [/var/lib/mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 646659
Server version: 5.5.42-cll MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
#Drop database eximstats
mysql> drop database eximstats;
Query OK, 4 rows affected (0.05 sec)
Create new database eximstats;
mysql> create database eximstats;
Query OK, 1 row affected (0.00 sec)
mysql> quit
Bye
Now restore eximstats tables using below command
root@host [/var/lib/mysql]# mysql eximstats < /usr/local/cpanel/etc/eximstats_db.sql
#Update stats using below command
root@host [~]# /usr/local/cpanel/bin/updateeximstats
updateeximstats: database schema is up to date.
Now delivery report in WHM should show results 🙂
Can’t create new tempfile Mysql
While working today came across new error in Mysql
”
[myfuncol_student.ow_base_config] error: Can't create new tempfile: './myfuncol_student/ow_base_config.TMD
Repairing the Mysql didn’t fix this issue
mysql> repair table ow_base_config;
+———————————+——–+———-+——————————————————————–+
| Table | Op | Msg_type | Msg_text |
+———————————+——–+———-+——————————————————————–+
| myfuncol_student.ow_base_config | repair | error | Can’t create new tempfile: ‘./myfuncol_student/ow_base_config.TMD’ |
| myfuncol_student.ow_base_config | repair | status | Operation failed |
+———————————+——–+———-+——————————————————————–+
I ran below command to fix this issue
root@hostonl [/var/lib/mysql]# myisamchk -r -f myfuncol_student/ow_base_config.MYI
– recovering (with sort) MyISAM-table ‘myfuncol_student/ow_base_config.MYI’
Data records: 228
– Fixing index 1
– Fixing index 2
Now database is working fine
mysql> repair table ow_base_config;
+———————————+——–+———-+———-+
| Table | Op | Msg_type | Msg_text |
+———————————+——–+———-+———-+
| myfuncol_student.ow_base_config | repair | status | OK |
+———————————+——–+———-+———-+
1 row in set (0.01 sec)
Blank PHPmyadmin page in cpanel
While working with one hosting client we came across an issue where PHPmyadmin was blank
On checking logs on /usr/local/cpanel/logs/error_log we could see below error
root@hosonline [~]# tail -n 10 /usr/local/cpanel/logs/error_log
Cpanel::Server::write_buffer(Cpanel::Server=HASH(0x4abf5d8), “HTTP/1.1 401 Access Denied\x{d}\x{a}Set-Cookie: cprelogin=no; HttpOnl”…) called at /usr/local/cpanel/Cpanel/Server.pm line 1132
Cpanel::Server::write_content_to_socket(Cpanel::Server=HASH(0x4abf5d8), IO::Socket::SSL=GLOB(0x4a9c208), 0, “HTTP/1.1 401 Access Denied\x{d}\x{a}Set-Cookie: cprelogin=no; HttpOnl”…, SCALAR(0x20f8ae8)) called at /usr/local/cpanel/Cpanel/Server.pm line 626
Cpanel::Server::badpass(Cpanel::Server=HASH(0x4abf5d8), __CPANEL_HIDDEN__, 1) called at cpsrvd.pl line 2997
cpanel::cpsrvd::badpass(__CPANEL_HIDDEN__, 1) called at cpsrvd.pl line 5278
cpanel::cpsrvd::handle_auth() called at cpsrvd.pl line 1222
cpanel::cpsrvd::handle_one_connection() called at cpsrvd.pl line 1073
cpanel::cpsrvd::script() called at cpsrvd.pl line 437
PHP Fatal error: Class ‘AuthenticationCpanel’ not found in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/common.inc.php on line 876
PHP Fatal error: Class ‘AuthenticationCpanel’ not found in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/common.inc.php on line 876
PHP Fatal error: Class ‘AuthenticationCpanel’ not found in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/common.inc.php on line 876
The issue was diagnosed to missing libraries
We resolved the issue using below command by upgrading PHPmyadmin
/usr/local/cpanel/bin/updatephpmyadmin –force
Now PHPmyadmin works like Charm 🙂
configure: error: * uuid support not found (this typically means the uuid development ackage is missing)
While working on Asterisk on cpanel server I could come across below error while compiling Asterisk
configure: error: * uuid support not found (this typically means the uuid development ackage is missing)
The issue was due to missing module.
It was resolved by using below libraries
#yum install uuid-devel
#yum install libuuid-devel
Now compile in working fine for Asterisk
eth0: Timesync Tx Control register not set as expected
While working on Centos 6 install I had a new guest today
Guest being but with error ” eth0: Timesync Tx Control register not set as expected”
Amazed to see this error for first time in centos 6 I google around finally to see its a bug and fix for it
I restarted networking using /etc/init.d/network restart and checked logs in
tail -n 100 /var/log/messages
e1000e: eth0 NIC Link is Down
e1000e 0000:03:00.0: eth0: Reset adapter
e1000e 0000:03:00.0: eth0: Reset adapter unexpectedly
e1000e 0000:03:00.0: eth0: Timesync Tx Control register not set as expected
A quick workaround is as follows:-
1. SSH into affected server
2. Add pcie_aspm=off kernel parameters to grub config, e.g.:-
# cd /boot/grub
# vim grub.conf
….
kernel /vmlinuz-2.6.32-431.5.1.el6.x86_64 ro root=/dev/mapper/vg_server-LogVol00 nomodeset rd_MD_UUID=c8cb6527:97bad21d:75373cd1:0dd9261b KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_LVM_LV=vg_server21/LogVol00 rd_LVM_LV=vg_server21/LogVol01 rd_NO_LUKS rd_MD_UUID=ec1c1858:b6c1ad58:6562ea8b:0e8113e2 crashkernel=auto SYSFONT=latarcyrheb-sun16 rd_NO_DM rhgb quiet pcie_aspm=off
– (Add pcie_aspm=off at the end of the kernel parameters)
3. Save and reboot
Now network should work fine
Then this is indicative of the CentOS 6.x kernel Intel e1000e driver issue, as described here:-
http://bugs.centos.org/view.php?id=6810
http://bugs.centos.org/view.php?id=6814
wkhtmltopdf install
if you are facing issues with install of wkhtmltopdf
please follow below steps
Download the zip file using wget
root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]#
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
–2015-07-20 03:15:00– http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
Resolving wkhtmltopdf.googlecode.com… 64.233.168.82, 2607:f8b0:4003:c07::52
Connecting to wkhtmltopdf.googlecode.com|64.233.168.82|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 8218260 (7.8M) [application/x-bzip2]
Saving to: `wkhtmltopdf-0.9.9-static-amd64.tar.bz2′
100%[====================================================================================================================================================================================================>] 82,18,260 15.3M/s in 0.5s
2015-07-20 03:15:00 (15.3 MB/s) – `wkhtmltopdf-0.9.9-static-amd64.tar.bz2′ saved [8218260/8218260]
FINISHED –2015-07-20 03:15:00–
Downloaded: 1 files, 7.8M in 0.5s (15.3 MB/s)
Unzip the file using tar
root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]#
tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
wkhtmltopdf-amd64
root@host234 [/home/fantasti/public_html/mealmerge.com/cgi-bin]# ls -la
total 54640
drwxr-xr-x. 2 fantasti fantasti 4096 Jul 20 03:15 ./
drwxr-x—. 5 fantasti nobody 4096 Jul 20 02:36 ../
-rwxr-xr-x. 1 fantasti fantasti 39419552 Jun 26 05:26 wkhtmltopdf*
-rw-r–r–. 1 root root 8218260 May 24 2010 wkhtmltopdf-0.9.9-static-amd64.tar.bz2
-rwxr-xr-x. 1 1000 1000 8301444 May 24 2010 wkhtmltopdf-amd64*
Rename wkhtmltopdf-amd64 to wkhtmltopdf
root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]# mv wkhtmltopdf-amd64 wkhtmltopdf
Change Permissions using chmod to executable
root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]# chmod +x wkhtmltopdf1
Now execute the file to see if any errors
# ./wkhtmltopdf1
You need to specify atleast one input file, and exactly one output file
Use – for stdin or stdout
Name:
wkhtmltopdf 0.9.6
Synopsis:
wkhtmltopdf [OPTIONS]… <input file> [More input files] <output file>
Description:
Converts one or more HTML pages into a PDF document, using wkhtmltopdf patched
qt.
General Options:
-b, –book Set the options one would usually set when
printing a book
–collate Collate when printing multiple copies
–copies <number> Number of copies to print into the pdf
file (default 1)
–cover <url> Use html document as cover. It will be
inserted before the toc with no headers
and footers
-H, –default-header Add a default header, with the name of the
page to the left, and the page number to
the right, this is short for:
–header-left='[webpage]’
–header-right='[page]/[toPage]’ –top 2cm
–header-line
–extended-help Display more extensive help, detailing
less common command switches
-h, –help Display help
-O, –orientation <orientation> Set orientation to Landscape or Portrait
-s, –page-size <size> Set paper size to: A4, Letter, etc.
–password <password> HTTP Authentication password
-p, –proxy <proxy> Use a proxy
-q, –quiet Be less verbose
-t, –toc Insert a table of content in the beginning
of the document
–username <username> HTTP Authentication username
-V, –version Output version information an exit
Contact:
If you experience bugs or want to request new features please visit
<http://code.google.com/p/wkhtmltopdf/issues/list>, if you have any problems
or comments please feel free to contact me: see
<http://www.madalgo.au.dk/~jakobt/#about>
now test conversion using below command
root@hostonlinesupport4u.in[/home/online/public_html/onlinesupport4u.in/cgi-bin]#
./wkhtmltopdf www.google.com google.pdf
Loading pages (1/5)
Resolving links (2/5)
Counting pages (3/5)
Printing pages (5/5)
Done