Posts

/tmp: Read-only file system Error

If you are getting the error "Read-only file system" while editing some files on the server, you can fix the same by running File System Check.  Error example: $ crontab -e /tmp/crontab.XXXX1ibTLU: Read-only file system It shows that the /tmp partition is unwriteable. The read-only has been mounted as read-only because file-system facing some error. To fix this, we need to do file system check (fsck) for /tmp partition. Before we do fsck, we need to unmount the directory but following error occurred: $ umount /tmp /tmp: Device or resource busy It seems like /tmp directory is locked to be unmounted due to some files are already in process/being opened/being executed by some other processes. Using lsof, we can list out all the open files: $ lsof | grep /tmp mysqld 2599 mysql 5u REG 7,0 0 6098 /tmp/ibaqFhew (deleted) mysqld 2599 mysql 6u REG 7,0 0 6099 /tmp/ibC7Yfbn (deleted) mysqld 2599 mysql 7u REG 7,0 0 6100 /tmp/ibJ8AFbe (...

How to change the SSH port on linux server

To change the SSH port on Linux server, you need to log into your server as the root user. You can find the SSH configuration file at /etc/ssh/sshd_config To change specific parameters within sshd_config, you need to uncomment the line by removing the number-sign (#) and changing the value for the line. For example, the default SSH port appears in a line like this: #Port 22 To change the SSH port to 759, you will need to make the line appear like this: Port 759 After you are finished configuring SSH, you will need to restart the SSH daemon. You can do so by issuing the following command: # /etc/init.d/sshd restart After you restart SSH, you will need to log out of your server and log in again using the proper user, IP address, and port number you specified in sshd_config.

How to Change Document Root of Primary Domain in cPanel server

You must have root shell access for changing the primary domain document root in cPanel server, Use following steps to  change  document root of your primary domain in cPanel account: Step 1:  Use SSH to get shell access for your server as root account.  Now edit following file. # vim /var/cpanel/userdata/ USERNAME / DOMAINNAME.COM *Change   USERNAME  with your cPanel account name. *Change   DOMAINNAME.COM  with your Primary domain name. Step 2:  After editing the mentioned file, search for text   documentroot   and   change   path as per your requirement. documentroot: /home/ USERNAME /public_html/ NEW_PATH Step 3:  After making the changes, you need to rebuild Apache configuration file and restart Apache service. Use following commands to do it: # /scripts/rebuildhttpdconf # service httpd restart Your changes will be permanently updated now. Check your website for reflecting changes.

Incorrect diskspace and information of the databases in cPanel

Issue: Sometimes, when you check the Disk space information of your databases on the cPanel, its showing incorrect. There could be many reasons for this like, quota file, not updated DB cache which can be resolved by moving the quota file out of the way and by running another update_db_cache script on the server. what if, after trying all these fixes, you are still getting incorrect Disk space information of your databases on cPanel ??? Fix: You need to disable to use INFORMATION_SCHEMA to acquire MySQL disk usage on cPanel. You can do the same through WHM panel by changing the option "Use INFORMATION_SCHEMA to acquire MySQL disk usage" to Off.

SSH Password Authorization Tweak in cPanel

Issue: Sometimes, you get the following error while accessing your server through root: Error:  ssh_exchange_identification: Connection closed by remote host Fix:  Go to "Security Center >> SSH Password Authorization Tweak" and then Disable Password Auth and Enable it again. SSH Password Authorization Tweak in WHM panel  allows you to enable or disable password authorization for SSH authentication. If you disable password authorization, the system will force users to use keys when they use SSH to access your server. More Info:  https://documentation.cpanel.net/display/ALD/SSH+Password+Authorization+Tweak If you are still unable to SSH to the server, I would suggest contacting your DC or your hosting provider immediately. This issue may have arisen due any one of the issues below. >> /etc/hosts.allow Check /etc/hosts.allow and make sure that your local machine IP address is whitelisted in it. If you are not sure...

InnoDB crashed

Sometimes, our databases got corrupted and innoDB crashed in the server. Due to this, MySQL service won't restart and following message: Starting MySQL..The server quit without updating PID file (/var/lib/mysql/my.server.com.pid).[FAILED] or MySQL server PID file could not be found! In such situation, you will have to start MySQL with InnoDB in force recovery mode using the following steps: Step 1. Stop MySQL service Step 2. Backup /var/lib/mysql directory Step 3. Add the following line into /etc/my.cnf: innodb_force_recovery = 4 Step 4: Restart MySQL. Your database will now start, but with innodb_force_recovery, all INSERTs and UPDATEs will be ignored. Step 5: Dump all tables Step 6: Shutdown database and delete the data directory. Run mysql_install_db to create MySQL default tables Step 7: Remove the innodb_force_recovery line from your /etc/my.cnf file and restart the database. (It should start normally now) Step 8: Restore everything from your backup

Dovecot_plain authenticator failed in cPanel server

Issue: You get the following error while accessing your email account: 2014-09-08 14:03:43 dovecot_plain authenticator failed for ([127.0.0.1]) [IP ADDRESS]:59278 I=[IP ADDRESS]:465: 535 Incorrect authentication data (set_id=email@domain_name) Fix: Users with root access can fix this problem through WHM using the following steps: 1. Login to WHM 2. Locate the Email section in the left-side panel 3. Select Repair Mailbox permissions 4. Click Proceed.  

ERROR! The server quit without updating PID file

Issue: MySQL is not reatsrting in the server. You get the following error: Starting MySQL...... ERROR! The server quit without updating PID file (/var/lib/mysql/server.hostname.pid) ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists Fix: This likely indicates that native AIO support is not enabled on the server. Add the following line to /etc/my.cnf and MySQL should then restart successfully: Code: innodb_use_native_aio = 0

Perl scripts are showing 404 error in cpanel

Issue: Sometimes, you get 404 error in the browser while executing perl script hosted under cPanel server. Fix: The 404 errors may occur for perl script because of the domain doesn't have CGI enabled for the account. You can check the same using the following command: [root@server]# grep HASCGI /var/cpanel/users/username* HASCGI=0 ^ In order to fix this issue for that user, you should be able to modify the HASCGI value in the file "/var/cpanel/users/username*" to 1 and then run /scripts/updateuserdomains and then /scripts/rebuildhttpdconf P.S: Replace username with your actual user of the domain.

Mail directory size is not updated in cPanel

Issue: Sometimes, when you delete a huge number of emails from your email account, the mail directory size is not getting updated in cPanel and showing the old space usage. Fix: There is a cPanel script to forcibly update the mail directory size in the server. You need to logged into the server through root and run the following command: root@server []# /scripts/generate_maildirsize --verbose --allaccounts --force --confirm Once the script is successfully executed, check the email account size in your cPanel. It should shows the correct disk usage.