cPanel, General, Linux, Litespeed

Reset Litesped admin password

You should need root access to the backend for the server to make this done.

>Login as root via SSH

>Go to the directory by

cd /usr/local/lsws/admin/misc

>Execute the below command

./admpass.sh

I will now prompt for a user like below.Fill the user as “admin” and then it will prompt for the password,from where it can be reset.

===

root@server [/usr/local/lsws/admin/misc]# ./admpass.sh

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: admin

===

Standard
cPanel, General, Linux, Litespeed, Php

Max retries has been reached, 503! in Litespeed

Hi Guys,

If you are seeing such an error for particular pages for a website in a Lite speed :

===

2014-09-26 04:10:26.557 [ERROR] [208.xx.xx.xx:43214-0#APVH_xxx.com] Failed to initialize VMemBuf, response body len: 21638041.2014-09-26 04:10:26.558 [INFO]

2014-09-26 04:10:29.710 [INFO] [208.xx.xx.xx:43214-0#APVH_xxx.com] connection to [/tmp/lshttpd/APVH_xxx.com_Suphp.sock.798] on request #0, confirmed, 1, associated process: 682806, running: 1, error: Illegal seek!2014-09-26 04:10:29.711 [NOTICE] [208.xx.xx.xx:43214-0#APVH_xxx.com] Max retries has been reached, 503!

2014-09-26 04:10:29.766 [NOTICE] [208.116.10.33:43214-0#APVH_xxx.com] oops! 503 Service Unavailable

===

Here the error is saying “Max retries has been reached, 503!” so we should check whether litespeed swap directory got filled . The directory is:

/tmp/lshttpd/swap/

You can check this using:

du -sch /tmp/lshttpd/swap/

It might be filled, so clear the files in it and load the page having the error once  more.

Standard
cPanel, General, Linux, Mysql

Error: Token mismatch in phpmyadmin

This can be due to many problems.Check the below things

>>Check whether disk quota for the account is exceeded

>>Check whether server /tmp directory have the correct permissions and got filled

>>Check users /tmp directory permissions. ie /home/username/tmp.Correct permission is 755.

chmod 755 /home/username/tmp

>>Check “session.save_path” in php.ini file. It should be like below

session.save_path = /tmp

Standard
Linux, OpenVz

Unable to fork: Cannot allocate memory

You can see this error while;e trying to access the vps from node.

[root@vps15 ~]# vzctl enter 293
Unable to fork: Cannot allocate memory

It means one of the resources controlled by OpenVZ has hit the limit. Also you can see strange failures from some programs inside your container like services may fail.

check the contents of the /proc/user_beancounters file in your container.The last column of output is the fail counter. Each time a resource hits the limit, the fail counter is incremented. So, if you see non-zero values in the failcnt column that means something is wrong.

Check the vps paramaters using the below command on node

cat /proc/user_beancounters

uid resource held maxheld barrier limit

numproc 240 240 240 240

dgramrcvbuf 261632 261632 262144 262144

numfile 6459 6663 9312 9312

From this result you need to check the “barrier” and “limit” values. Check the above example and see that they are same,which means limit has reached. To see only the failed parameters of all vps,execute the below command

vzubc -c -q
[root@vps15 ~]# vzubc -c -q
—————————————————————-
CT 293 | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
————-+—————+—————+—–+—–+——
shmpages| 596K 0.5% 0.5%|99.1M 84% 84%| 117M| 117M| 76
numproc| 240 100% 100%| 240 100% 100%| 240 | 240 | 2.42K
oomguarpages|1003M 983% – |1.07G 1076% – | 102M| – | –
numtcpsock| 232 64% 64%| 234 65% 65%| 360 | 360 | –
tcprcvbuf| 963K 57% 36%|1.65M 100% 64%|1.64M|2.58M| 39
dgramrcvbuf| 255K 99% 99%| 255K 99% 99%| 256K| 256K| 60.2K
numfile|6.31K 69% 69%|6.51K 71% 71%|9.09K|9.09K| –
Now,we need to increase the paramaters to set everything back to normal like below. Change the parameter name in the below command according to the scenario.
—————

vzctl set 293 –dgramrcvbuf 8000000:8000000 –save

vzctl set 293 –numfile 25000:25000 –save

You can validate the configuration using the below command.
———————————————————–

vzcfgvalidate /etc/vz/conf/293.conf
Now reboot the vps
—————-

vzctl enter 293

Standard
cPanel, General, Innodb, Linux, Mysql

Mysql restarting frequently ?

If you are seeing/getting complaints that the mysql is down on the server and when you check this from your end you can see everything is fine. This might be due to frequent automatic restarts.Check the mysql uptime and also let see the what the log says.

root@server [~]# mysql -e “\s”

This will display the mysql uptime like below.You can see the uptime on the bottom.

===

mysql Ver 14.14 Distrib 5.1.73, for unknown-linux-gnu (x86_64) using readline 5.1

Connection id: 3304
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ”
Using delimiter: ;
Server version: 5.1.73-cll MySQL Community Server (GPLv2)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 4 min 3 sec

====

From this you can conclude the mysql is just started and no one manually done that.No check the logs.

tail -f  /var/lib/mysql/hostname.err (replace hostname with your server hostname) . You may be seeing an error like below. Usually this type of reboot is caused when there is an incorrect entry on my.cnf or due to innodb crash. Below is the error.

=============<<<<<<<<<<<<<>>>>>>>>>>>>>================

This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=157286400
read_buffer_size=1048576
max_used_connections=10
max_threads=500
thread_count=5
connection_count=5
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1182947 K bytes of memory
Hope that’s ok; if not, decrease some variables in the equation.

Thread pointer: 0x1cfa8f20
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong…
stack_bottom = 2b7da1cf4f08 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x86e6be]
/usr/sbin/mysqld(handle_fatal_signal+0x380)[0x6c0630]
/lib64/libpthread.so.0[0x2b7d8e91aca0]
/lib64/libc.so.6(gsignal+0x35)[0x2b7d8f431265]
/lib64/libc.so.6(abort+0x110)[0x2b7d8f432d10]
/usr/sbin/mysqld(fil_io+0x3be)[0x78876e]
/usr/sbin/mysqld[0x772d04]
/usr/sbin/mysqld(buf_read_page+0x200)[0x773200]
/usr/sbin/mysqld(buf_page_get_gen+0x144)[0x76c974]
/usr/sbin/mysqld(btr_cur_open_at_rnd_pos+0x227)[0x75fbb7]
/usr/sbin/mysqld(btr_estimate_number_of_different_key_vals+0x1ae)[0x75ffce]
/usr/sbin/mysqld(dict_update_statistics_low+0x75)[0x775765]
/usr/sbin/mysqld(dict_table_get+0x156)[0x77a436]
/usr/sbin/mysqld(_ZN11ha_innobase4openEPKcij+0x133)[0x755713]
/usr/sbin/mysqld(_ZN7handler7ha_openEP8st_tablePKcii+0x3f)[0x6b37ef]
/usr/sbin/mysqld(_Z21open_table_from_shareP3THDP14st_table_sharePKcjjjP8st_tableb+0x54b)[0x62cafb]
/usr/sbin/mysqld[0x6205cb]
/usr/sbin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootPbj+0x683)[0x624db3]
/usr/sbin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjj+0x372)[0x625712]
/usr/sbin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTj+0x1e)[0x625a4e]
/usr/sbin/mysqld[0x6df12b]
/usr/sbin/mysqld(_Z14get_all_tablesP3THDP10TABLE_LISTP4Item+0x4fb)[0x6df68b]
/usr/sbin/mysqld(_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state+0x1d0)[0x6d7650]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x439)[0x64d7a9]
/usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x1b9)[0x64f799]
/usr/sbin/mysqld(_Z13handle_selectP3THDP6st_lexP13select_resultm+0x169)[0x6500a9]
/usr/sbin/mysqld[0x5de5f4]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x545)[0x5e1c05]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjPPKc+0x418)[0x5e7be8]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x732)[0x5e8322]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x120)[0x5e9300]
/usr/sbin/mysqld(handle_one_connection+0x7ed)[0x5dae9d]
/lib64/libpthread.so.0[0x2b7d8e91283d]
/lib64/libc.so.6(clone+0x6d)[0x2b7d8f4d627d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (1cfb4e90): SELECT data_free FROM tables WHERE ENGINE = ‘InnoDB’ LIMIT 1
Connection ID (thread ID): 332
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
140920 07:30:09 mysqld_safe Number of processes running now: 0
140920 07:30:09 mysqld_safe mysqld restarted
140920 7:30:09 [Warning] ‘record_buffer’ is deprecated and will be removed in a future release. Please use ‘read_buffer_size’ instead.
140920 7:30:09 [Note] Plugin ‘FEDERATED’ is disabled.
140920 7:30:09 InnoDB: Initializing buffer pool, size = 8.0M
140920 7:30:09 InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
140920 7:30:09 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files…

================>>>>>>>>>>>><<<<<<<<<<<====================

To resolve this we need to add the below parameters on the /etc/my.cnf file .

[mysqld]
max_allowed_packet=1G
innodb_fast_shutdown=0
innodb_thread_concurrency=0

and then restart the mysql service. Please monitor the log again to see if there is any further issue. Hope this help you 🙂

 

Standard
cPanel, General, Linux

Find last modified files in Linux

In certain cases we need to know the files that are lastly modified. Below commands will help you to find this in minutes and days.

Go to the particular directory and execute this. You can change the parameters(minutes/days) according to your need.

To know the modification before minutes.

find . -type f -mmin -120 (in minutes)

To know the modification before days.

find . -type f -mtime -5 (day)

Standard
Uncategorized

Enable SSI on cPanel server

Apache handlers allow you to control what Apache will do with certain file types. When Apache sees a file, it has an action built in for that file type, and will perform that action. If you wish Apache to do a different action, you will need to make a handler to tell Apache to perform that action.

You can enable SSI support for a cPanel account via cPanel:

Go to : cPanel >> Apache Handlers

Here you can see two fields: Handler and Extension(s). Give it as below and restart apache on the server.

Handler : server-parsed
Extension(s): .html .htm

Some times you may need to add some custom rules like below on your .htaccess file to make this work.

AddType text/html .shtml
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes
AddHandler server-parsed .html .htm

Standard
cPanel, General, Linux

Response: 421 Too many connections (8) from this IP Error: Could not connect to server Status: Delaying connection for 5 seconds due to previously failed connection attempt…

While trying to connect via ftp, the below error may occur

===

Response: 421 Too many connections (8) from this IP
Error: Could not connect to server
Status: Delaying connection for 5 seconds due to previously failed connection attempt…
Response: 421 Too many connections (8) from this IP

===

Fix:

Go to /etc/pure-ftpd.conf where you can see a parameter like below:

MaxClientsPerIP 8

Change this to a bit higher value like:

MaxClientsPerIP 30

Restart ftp.

/etc/init.d/pure-ftpd restart

That’s all. You just fixed this issue.

Standard