Troubleshooting CentOS Web Server Disk Zencart Issue Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

Troubleshooting CentOS Web Server Disk Zencart Issue Tutorial

Troubleshooting CentOS Web Server Disk Zencart Issue Tutorial

Out of the previous CentOS Exim Advanced Configuration Primer Tutorialโ€˜s analysis phases โ€ฆ

  • hard disk space
  • hard disk inode count (for Linux and unix web servers)

โ€ฆ that latter one raised its-not-so-good-looking head for two days last Sunday (in the middle of the Sydney, Australia day) and Monday (up until resolving around 11am Sydney time). Not that I immediately knew that. Our symptoms of โ€œsomething wrongโ€ consisted of โ€ฆ

  • all parts of Apache web server (for RJM Programming) websites working, including MySql ones
  • cPanel hung
  • FileZilla sftp got connection resets

โ€ฆ which is tempting to ignore, and hide the old noggin in the stuff that falls through the hourglass.

Luckily, though, my torpor was disturbed by needing to sftp an image over to the web server to complete yesterdayโ€™s tutorial.

Now, itโ€™s inconvenient that the title gives โ€œthe general game awayโ€ about the source of the issue, but it would be an imaginative operator indeed who could jump to this โ€œeven general conclusionโ€ from these symptoms, without getting access to this web server. And on reflection, had we used Power Management to see whether that would have had a chance of fixing the issue, it would have been a waste of time.

So what did we do first on Sunday? Well, we could still log in via ssh and on the RJM Programming web server, went โ€ฆ



# service sshd restart

Stopping sshd: [ OK ]

touch: cannot touch `/var/lock/subsys/sshd': No space left on device

  • df -k /
  • df -i /

โ€ฆ as per โ€ฆ



# df-k /

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sda3 133526580 112886392 13860736 90% /

root@vs-rmetcalfe [~]# df -k /tmp

Filesystem 1K-blocks Used Available Use% Mounted on

/usr/tmpDSK 544256 328968 187640 64% /tmp

root@vs-rmetcalfe [~]# df -k /var

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sda3 133526580 112886456 13860672 90% /

root@vs-rmetcalfe [~]# df -i /

Filesystem Inodes IUsed IFree IUse% Mounted on

/dev/sda3 8478720 8478720 0 100% /

โ€ฆ to arrive at โ€œthere is an inodes quota running out issue with the RJM Programming web server hard diskโ€.

So what did we do later on Sunday? We still could, believe it or not, from an already open FileZilla session, delete a goodly number of web server files, which we (recursively) did to get some thousands of inodes to become available again. That left the RJM Programming web server fully functional as we went to โ€œshut eye placesโ€. We gave the web server one task (via our Linux Disk Usage cPanel Heads Up Tutorial) to do for these sleeping hours โ€ฆ

# du -a / 2> /dev/null | sort -n -r | head -15

โ€ฆ but it petered out, alas. It is a very intensive โ€œaskโ€, after all. So this takes us to Monday, where we woke up to โ€ฆ

  • hard disk space
  • hard disk inode count (for Linux and unix web servers)

โ€ฆ back to the original issue, again.

So what did we do on Monday? Well, amongst the research we lobbed onto this useful link, thanks, that got us to go โ€ฆ

find / -ctime -1 -print

โ€ฆ to get a list of files created over the last day. And that was the breakthrough, really, for us, as it lead us to seeing in that list thousands of entries for the filespec โ€ฆ



/home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log

โ€ฆ and we noticed, after another round of file deletions to be okay, temporarily, again, when going through a few cycles of โ€ฆ



# ls -clt /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log

# ls -clt /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log

# ls -clt /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-*.log

โ€ฆ each list would get considerably longer over the length of time it took to list the previous! Runaway train had us gobsmacked! Eventually, though, we tweaked to โ€œthe short term solutionโ€ โ€ฆ



# ksh -c 'for i in `find /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/ -name "myDEBUG-*.log"`; do rm -f $i; done'

# df -i /

Filesystem Inodes IUsed IFree IUse% Mounted on

/dev/sda3 8478720 8428558 50162 100% /

# df -i /

Filesystem Inodes IUsed IFree IUse% Mounted on

/dev/sda3 8478720 8429300 49420 100% /

โ€ฆ yayyyyy!!! (with a caveat of โ€œjust relief for now but must find the ultimate reasonโ€) โ€ฆ but there were some back again on the next โ€ฆ a growing list again โ€ฆ plus the RJM Programming ZenCart eCommerce website came up with error message โ€œWARNING: An Error occurred, please refresh the page and try again.โ€ โ€ฆ mesmerized, we repeated the listings, watching the list grow, until it occurred to us, encouraged by that previous link talking about the error could be related to the MySql ZenCart database, to โ€ฆ



# cat /home/virtfs/rjmprogr/home/rjmprogr/public_html/zencart/cache/myDEBUG-1575848271-674789.log

[09-Dec-2019 07:37:51 Australia/Perth] PHP Fatal error: 145:Table './rjmprogr_zencart/sessions' is marked as crashed and should be repaired :: select value

from sessions

where sesskey = '42f9199e81e8c1eeb411921161c67ab9'

and expiry > '1575848271' in /home/rjmprogr/public_html/zencart/includes/classes/db/mysql/query_factory.php on line 101

โ€ฆ giving us the long term remedy โ€ฆ

  1. get into cPanel
  2. search for phpMyAdmin option, and click it
  3. access the rjmprogr_zencart database (and see that sessions table is indeed marked as crashed)
  4. within SQL tab textarea type โ€ฆ


    REPAIR TABLE sessions


    โ€ฆ click the GO button โ€ฆ successful

โ€ฆ sanity checked in that โ€œthe listโ€ no longer grows!!! And as for the inodes quota issue โ€ฆ



# df -i /

Filesystem Inodes IUsed IFree IUse% Mounted on

/dev/sda3 8478720 8425232 53488 100% /

โ€ฆ a lot better, especially as this time it only appears to be getting better (ie. IFree stays roughly the same or gets bigger (with our other crontab remedies we have implemented)). And ZenCart works again. What a relief!



Previous relevant CentOS Exim Advanced Configuration Primer Tutorial is shown below.

CentOS Exim Advanced Configuration Primer Tutorial

CentOS Exim Advanced Configuration Primer Tutorial

There are two file resource aspects to watch out for regarding a web server hard disk storage โ€ฆ

  • hard disk space
  • hard disk inode count (for Linux and unix web servers)

โ€ฆ which can, respectively, be monitored by Linux commands โ€ฆ

  • df -k /
  • df -i /

On our CentOS rjmprogramming.com.au web server recently we had occasion to do a check of this, and wanted to improve the web server hard disk situation for both measures, picking the /var folder of our web server. So we executed, respectively โ€ฆ

  • find /var -xdev -type f -size +100M
  • find /var -mtime -1 -ls

โ€ฆ the latter one being a list of files on /var modified in the last day being our idea to try to see what daily log filing might be contributing big time to hard disk inode usage. And thatโ€™s where we found out this way that our Exim Mail Server logs extensively, and that we could do without those in folders off โ€ฆ



/var/spool/exim/msglog/

We tried the latter of two deletion ideas we show below โ€ฆ

  • all at once via โ€ฆ


    cd /var/spool/exim

    find msglog -type f -exec rm -rf {} \;

  • broken up โ€ฆ via a series of deletions of the ilk โ€ฆ


    cd /var/spool/exim/msglog

    rm -f A/*

    rm -f a/*

Then the next job was to stop Exim remaking these logs and wish to thank this useful link for great advice here, that led to this advice we give โ€ฆ

  1. log in to WHM cPanel
  2. in search bar type โ€œEximโ€
  3. click the โ€œExim Configuration Managerโ€
  4. click โ€œAdvanced Editorโ€ tab (up the top)
  5. click the blue โ€œAdd additional configuration settingโ€ button well down the webpage
  6. click โ€œmessage_logsโ€ in left hand drop down
  7. set value of this setting to โ€œfalseโ€
  8. click blue โ€œSaveโ€ button down the bottom of webpage to complete the steps here

You may find this is a web server configuration of interest to you too.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *