Posts

Failing to start MySQL

Sometimes you get the following error while starting the MySQL service or when upgrading to mysql5. Error MySQL Couldn't find MySQL manager or server Solution Comment this line from /etc/my.cnf Basedir =/ var / lib / mysql Thank you.

Move Tmp To Ramfs/Tmpfs

This article will show you how to create a ramfs/tmpfs partition and how to change the tmpdir variable to quicken copy to tmp queries. Keep in mind this only speeds up the IO portion of maintaining multiple indexed result sets due to query structure, the best performance increase would be gained from query analysis. ramfs vs tmpfs RamFS will use up all of your memory regardless of the size you set and it also never uses swap. TmpFS will use up only what you have assigned to it and it will use swap for idle ram. Typically you will want to use tmpfs, but its important to know the differences. Creating a ram partition You need to create a new mount to go about doing this. The below will create a 100mb tmpfs ( ram based ) partition and mount it. # mkdir /tmpfs # mount -t tmpfs -o size=100m tmpfs /tmpfs/ Thank you.

Repair a database

To repair a database using the default MyISAM  storage engine use: # mysqlcheck  -r  databasename If the above command fails to repair a myisam table, you can attempt to use the following repair command for rebuilding table structures from .frm files in the event .MYI headers are missing or corrupt: # mysqlcheck  -r  --use-frm  databasename To repair all databases on a server: # mysqlcheck  --repair  --all-databases

Hacking: how to prevent

Hacking can be done in many different ways. Two commonly used methods are explained below. (i) Account passwords harvesting ====================== In this method, hackers will try to collect website account passwords in large scale. We will call this process "account passwords harvesting". Details on how they do that are fuzzy. Use of password like 123456 or use of a spyware infected PCs at home are the main reasons. Actually the complexity of the password should be beefed up to at least 8 characters. But this does not help if the user computer is infected with a keylogger. (ii) PHP vulnerabilities ====================== PHP has got of lot of very vulnerable and potentially exploitable functions. Hackers have been enjoying these security lapses for a long time. Most of the PHP applications like Joomla, PhpBB, PhpNuke etc. are community developed. These application may have potential security vulnerabilities and hackers may exploit them. Most of the website hacki...

NginX reverse proxy

NginX is a high performance, lightweight webserver. In most situations, it is used as an alternative to Apache. However, in the configurations with cPanel, typical protocol is to install it as a reverse proxy. Reverse proxy NginX runs as a reverse proxy server. In a normal proxy situation, a user makes a request to a server through a proxy. The user and the server never interact directly-- the proxy makes the request on behalf of the user. Likewise, the proxy hands the responses from the server back to the user. A reverse proxy works by the same concept-- it's just a proxy that works on behalf of the server instead of the user. Rather than having Apache process requests directly, NginX takes them, finds any requests it is best suited to satisfy (such as static content) and forwards the rest on to Apache. Apache gives its response to NginX, and NginX sends the response to the client. If NginX finds itself able to serve a request directly, it does so and never involves Apache ...

Fix FTP issue when CSF is installed

Symptom: FTP almost connects but can not get directory listing Fix: It is important when using an SPI ( Stateful Packet Inspection )  firewall to ensure FTP client applications are configured to use Passive (PASV) mode connections to the server. On servers running Monolithic kernels (e.g. VPS Virtuozzo/OpenVZ and custom built kernels), "ip_conntrack" and "ip_conntrack_ftp" iptables kernel modules may not be available or fully functional. If this happens, FTP passive mode (PASV) won't work. In such circumstances you will have to open a hole in your firewall and configure the FTP server to use that same hole. For example, with pure-ftpd you could add the port range 30000:35000 to TCP_IN and add the following line to /etc/pure-ftpd.conf and then restart pure-ftpd: PassivePortRange 30000 35000 For example, with proftpd you could add the port range 30000:35000 to TCP_IN and add the following line to /etc/proftpd.conf and then restart proftpd...

How to install Zimbra in CentOS

Prerequisites: 1. You need to configure the DNS entry that is pointing to the server. 2. You need to verify the hostname of the server in the files " /etc/sysconfig/network " and " /etc/hosts ". 3. The machine will need at least 1024mb of memory to run the default Zimbra services. 4. You will need to install some required packages to proceed with the setup and avoid errors further on: *wget – download utility that will be using to download the latest version of Zimbra Open Source Edition. *postfix – an open-source mail transfer agent (MTA) that routes and delivers electronic mail; installation of Zimbra will fail without this package. *ntp – a protocol designed to synchronize the clocks of computers over a network. You can install these packages with the following command: # yum install wget postfix ntp Installation steps: 1. mkdir /download 2. cd /download 3. wget http://files2.zimbra.com/downloads/7.0.1_GA/zcs-7.0.1_GA_3105.RHEL5_64.2...

XML Parsing Error

Sometimes you get the following error message on your website: XML Parsing Error: not well-formed Location: http://yourdomain.com/ Line Number 17, Column 24: <img src="img/img.gif"alt=""/> "XML Parsing Error" usually occurs when something is trying to read the XML, not when it is being generated. Also, "not well-formed" usually refers to errors in the structure of the document, such as a missing end-tag, not the characters it contains. Also, the error occur due to using of Unicode Character ”( RIGHT DOUBLE QUOTATION MARK ) instead of " (Unicode Character 'QUOTATION MARK) in your codes. Sometimes, this error comes due to the plugin which is used for the RSS feed or the code issue related to RSS feed. Your feed is not well formed according to the XML specification . All feeds must be well-formed XML.  There are several basic approaches to solving this: escaping problematic characters ( < becomes &lt; ...

spamd failed

If you get the following error: -------- spamd failed @ Sat Jul 25 16:39:14 2015. A restart was attempted automagically. Service Check Method:  [check command] Cmd Service Check Raw Output: Spamd is not running -------- Fix: You can follow the below mentioned steps to avoid that: ------- 1. Deleted the old file '/var/run/chkservd/spamd'. 2. Restarted  chkservd service. 3. Run the script /scripts/fixspamassassinfailedupdate. ------- Monitor the logs /var/log/chkservd.log . grep for "Restarting spamd". If you cannot find any such details that means the spamd is running fine now without sending any failure notices.

How to upgrade/downgrade MySQL version in cPanel server

You can easily change the major version of MySQL running on your server through WHM, keeping in mind that the actual version will be dependent on what cPanel has released in their repository. WHM >> Software >> MySQL Upgrade >> Select between "MySQL 5.1" or "MySQL 5.5" To change the MySQL version below 5.1, edit the file /var/cpanel/cpanel.config and look for this line: mysql-version=5.1 Then change the version number to the major version that you want to downgrade to. For instance, 4.0, 4.1 or 5.0. Then save the file and run the following script: # /scripts/mysqlup --force Now re-run apache build (easyapache) script so it can build php-mysql connector: # /scripts/easyapache  The method described would be performed at one's own risk. A manual downgrade is not recommended and can incur significant risk when attempted on an existing system. A full backup of the MySQL data directory is advised, and for a proper downgrade one sh...