Posts

Showing posts from March, 2015

/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.