How to check inode usage

]# df -i
Filesystem       Inodes    IUsed   IFree IUse% Mounted on
/dev/vda3      50044928 50044928       0  100% /
tmpfs           1950595        1 1950594    1% /dev/shm
/dev/vda1        128016       39  127977    1% /boot
/usr/tmpDSK      262144       20  262124    1% /tmp

for d in *; do echo -n "$d: "; find $d -type f | wc -l; done /home

By the way, if you’re looking for the directories that contain lots of files, this script may help:


#!/bin/bash
# count_em - count files in all subdirectories under current directory.
echo 'echo $(ls -a "$1" | wc -l) $1' >/tmp/count_em_$$
chmod 700 /tmp/count_em_$$
find . -mount -type d -print0 | xargs -0 -n1 /tmp/count_em_$$ | sort -n
rm -f /tmp/count_em_$$

Also…

# find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n

Try to find if this is an inodes problem with:


# df -ih

Try to find root folders with large inodes count:


# for i in /*; do echo $i; find $i |wc -l; done

Try to find specific folders:


# for i in /src/*; do echo $i; find $i |wc -l; done

Symptoms

When I use Plesk Migration Manager to migrate data manually I get the following error:

# tail -f /usr/local/psa/admin/logs/panel.log
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in /usr/local/psa/admin/plib/backup/Conflicts/Detector/ConflictDetector.php on line 495

I get this error after starting import from the migration file /work_dir/dump.xml.
Resolution

There is not enough memory for Plesk Panel php. You need to increase memory_limit for Plesk Panel php in /usr/local/psa/admin/conf/php.ini file up to 512 Mb.

To check if settings were applied correctly you can run


/usr/local/psa/admin/bin/php -info | grep memory_limit
memory_limit => 1024 => 1024

Change to:

# memory_limit = 1024M

Symptoms

Migration hangs

Migration fails with error:


    [2015-04-19 22:36:29.393|52103] INFO: tError_ParseFile[9b85e473-5336-4e8b-8212-aa706386adbd]: The XML file - was not parsed successfully with the following errors:
    Entity: line 6:parsererror :Opening and ending tag mismatch: hr line 5 and body</body>       ^Entity: line 7:parsererror :Opening and ending tag mismatch: body line 3 and html</html>       ^Entity: line 7:parsererror :Premature end of data in tag html line 1</html>       ^ [./xml_parse.cpp:126]
    plesk::tXmlDocument::tXmlDocument(const string&)

Migration fails with error


    INFO: FailedDomainDeployment[8b8adf25-291f-4e3b-8624-63c3a4989bba]: Failed deployment of domain domain.tld [./domain_deploy.cpp:410]
    void plesk::tDomainDeployer::operator()(plesk::XmlNode) const
    Inner exception:
    ExecCliGate::GateError[a0116883-7cd4-42c8-8f90-08c786e41318]: Error during CLI Gate interface usage: transfer closed with outstanding read data remaining [./cmd_exec.cpp:192]
    void plesk::CliExec::makePostRequest(const string&)

Plesk becomes unaccessible during migration, error in migration logs:


    [2015-04-19 22:36:29.393|52103] INFO: Normalized HTTP response: <html>
    <head><title>504 Gateway Time-out</title></head>

Cause

sw-enginer stuck on destination server.
Resolution

Increase limit for open files:

Modify ‘/etc/init.d/sw-engine’, add the following into the startup script:


    ulimit -n 65536

Restart the services:


    #service sw-engine restart
    #service sw-cp-server restart

If Nginx alredy service stuck:

a. Kill alll nginx processes using the below command:


    # killall nginx

b. Restart nginx service:


    # systemctl start nginx.service

Disable and re-enale nginx using nginxmng:


    # /usr/local/psa/admin/bin/nginxmng -d
    # /usr/local/psa/admin/bin/nginxmng -e
    # /usr/local/psa/admin/bin/nginxmng -s
    Enabled

Unable to create subscription/domain: IP address does not exist

Symptoms
An attempt to create a subscription / domain fails with the following error:
Error: Unable to find service node for ip address with id=2
Error: Failed domain creation: Unable to update domain data: IP address with ID ‘2’ does not exist
It is not possible to manage Web Hosting Access. An attempt fails with the following error:
Error: Unable to find service node for ip address with id=2

Cause

Database inconsistency.
Resolution

Create a backup of the psa database:


# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa  > /root/psa.sql

Check if the IP_Addresses table has record(s) with an IP address that does not exist in the ip_pool tables:


    mysql> select * from ip_pool where ip_address_id not in (select id from IP_Addresses);
    +----+---------------+--------+
    | id | ip_address_id | type   |
    +----+---------------+--------+
    |  1 |             2 | shared |
    +----+---------------+--------+
    1 row in set (0.00 sec)


    mysql> select * from IP_Addresses where id =2;
    Empty set (0.00 sec)


    mysql> select id, serviceNodeId, ip_address from IP_Addresses;
    +----+---------------+--------------+
    | id | serviceNodeId | ip_address   |
    +----+---------------+--------------+
    |  1 |             1 | x.x.x.x      |
    +----+---------------+--------------+
    1 rows in set (0.00 sec)

As can be seen in this example, the ip_pool table includes an entry regarding a nonexistent IP address ( ip_address_id = 2);

Delete this record from the ip_pool table:


    mysql> delete from ip_pool where ip_address_id=2;
    Query OK, 1 row affected (0.00 sec) 

Here are a few articles that mention it:

https://documentation.cpanel.net/display/EA/Custom+Modules
https://forums.cpanel.net/threads/how-to-easy-php4-php5-side-by-side-after-removal-of-php4-from-easyapache.304942/
http://www.liquidweb.com/kb/the-end-of-php-4/
https://www.siteground.com/kb/how_to_have_different_php__mysql_versions/

You can set the handler for the site using a .htaccess file in the domains webroot with the following contents:
Code:
AddHandler application/x-httpd-php4 .php .php4 .php3

http://kb.odin.com/en/118352

Just run in command line


# /usr/local/psa/bin/domain -u yourdomain.com -cgi-mode webspace

or


# /usr/local/psa/bin/domain -u yourdomain.com -cgi-mode www-root

or


# /usr/local/psa/bin/domain -u yourdomain.com -cgi-mode ols-style

and check results.

Site is being load balanced and you get this error is different locations:

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

This is using apache vs Nginx.

Restart nginx fails:

root@web2:/var/log/nginx# tail -f error.log
2015/09/11 01:00:13 [emerg] 5190#5190: bind() to [::]:80 failed (98: Address already in use)
2015/09/11 01:00:13 [emerg] 5190#5190: bind() to 0.0.0.0:80 failed (98: Address already in use)

Then it means nginx or some other process is already using port 80.

You can kill it using:


# sudo fuser -k 80/tcp

And then try restarting nginx again:


# service nginx start

It’s Just easier this way…

http://www.hanselman.com/blog/DownloadSQLServerExpress.aspx

DOWNLOAD SQL SERVER 2014 EXPRESS

DOWNLOAD SQL SERVER 2012 EXPRESS

DOWNLOAD SQL SERVER 2008 EXPRESS R2 SP2