Once I upgraded my server increasing RAM from 500 MB to 1 GB and disk space from 20 GB to 30 GB, my plesk panel was out of sync. I check that my server was upgraded viewing Godaddy’s default control panel and also logging in to my server via SSH from the terminal running df -h to check disk space and free -m to view memory total / usage. The server had been upgraded so now I had to go about fixing the Plesk pannel to refresh. I spent way too much time on the phone with tech support until they pointed me over to their chat service to get in touch with their VDS experts.
Their expert find a refresh button buried in the pannel under the following path:
Tools & Utilities > Server Tools > Services management
I clicked the green arrows labeled refresh on the lop left. That worked so I thought. The home screen now showed accurate info; however the health monitoring was still out of sync. After sufring around on the web, I found a script on my server that needed kick in the rear. Here’s the command I ran in the terminal that forced Plesk into rescanning my server settings:
Now that you have a virtual server setup, you can enjoy the benefits of managing your server as root (super admin). With root level access, you can send commands to your server using a bash terminal. Here are the common commands:
- man – stands for manual. Very useful command if you are just getting started with Linux. You can invoke ‘man’, followed by any other Linux command (cd, for example) and it will display detailed description and list of all available options.
- cd – cd is short for ‘change directory’. Allows browsing between different folders of your VPS.
- cp, mv, rm – great commands for basic file management. You can copy (cp), move (mv) or remove (rm) files/folders this way from your server.
- grep – grep permits you to print lines that match a particular pattern. Useful if you are looking for a phrase or or line in a large text file (logs, for example).
- ls – allows you to list the content of a directory. Using “ls -la” will also show you hidden files/directories (those starting with a dot) and additional attributes, such as permissions and ownership.
- chown, chmod – every file or directory has its own ownerhip rights – user and group. With “chown” you can modify those parameters and “chmod” gives you the ability to change permissions (read, write, execute) for the owner, group and the rest of the users, accessing that file/directory.
- nano, vi – “nano” and “vi” are probably the two most popular Linux text editors. You may find “nano” easier to use, while “vi” appears as the preferred editor among more experienced.
- top, ps – “top” provides you with a periodic update (every five seconds by defaut) of running Linux tasks, while “ps” takes a snapshot of all current processes and prints it on your screen.
- df -h, du -hs – shows you the current overall use of your disk in gygabytes (df -h).”du -hs” calculates the total size of a directory in a human readable format (e.g., 1K 234M 2G).
Here are a two bonus commands for checking DESK SPACE and RAM usages:
To check out the disk space usage on your server, execute this command:
And to see the memory usage:
To change the permissions of a file in SSH, once you have logged in, you can use the CHMOD command. Here are a few common examples of CHMOD:
chmod number filename
chmod 600 example.html - This will give the file read and write permissions by the owner only (-rw-------).
chmod 644 example.html - This will give the file read and write permissions by the owner and read by everyone else (-rw-r--r--).
chmod 700 example.html - This will give the file read, write and execute permissions by the owner only (-rwx------).
chmod 755 example.html - This will give the file read, write and execute permissions by the owner, read and execute permissions by the group and others (-rwxr-xr-x)
chmod 666 example.html - This will give the file read and write permissions by everyone(-rw-rw-rw-) (NOT RECOMMENDED)
chmod 777 example.html - This will give the file read, write and execute permissions by everyone (-rwxrwxrwx) (NOT RECOMMENDED)
Changing the ownership
To change the ownership of a file in SSH, you can use the CHOWN command. e.g: chown owner filename
chown user example.html
chown user:group <directory-name>
chown apache avatars
First you log in using your terminal application by typing the flowing SSH command:
After that, you will be prompted to enter your password. As you enter your password, the text will be hidden. Next we should switch to the “root” user. You can do so by typing the following in your terminal window:
su – root
You will have to enter a password once more. Now navagate to where you would like to store your MySQL database file. For an example of changing the directory to the “public_html” direcotry, type this:
Now you can back up your db here using the following command. This command will backup all of your databases. I also chose to compress them after the pipe “|” as a gzip file. Type the following but be sure to change the user name and password to your info:
mysqldump -u yourusername -p yourpassword –all-databases | gzip >databasebackup.sql.gz
You can also target single database using the following:
mysqldump -u yourUserName -p yourDBName | gzip >databasebackup.sql.gz
How to disable directories from browsing or indexing to hide images, and other files from visitors. This give you total control of your web folders to block unwanted viewing using .htaccess files with Apache
Continue reading “Disable or Enable Directory Browsing or Indexing”