Archive for the ‘Ubuntu’ Category

One of the System Architecture admin has to do is to resize AWS volume and like me, we don’t remember steps if you are not doing that frequently in your job. Today I have taken my time to write this blog to list simple steps when extending AWS linux volume. I know there are many blogs you can find in internet but none of the blogs has it simple steps wise and precise step.

Resize AWS volume can be done with downtime and without downtime. Both ways uses similar steps to upgrade your AWS volume.

Please check images as well to refer to visual guides.

  1. Login to AWS and go to list of AWS Instances, select instance that you want its volume to be resize.
  2. After you select instance, you will instance description below.
  3. Within that description, click into Root device or Block devices ( whichever you want to resize )
  4. You will see EBS ID, click into it to go to Volume list with that volume selected.
  5. Your instance volume will be listed and now right click and click Modify Volume.
  6. Your Volume go through process: Modifying, Optimizing and Complete ( Takes minimum 20 minutes to 2 hour ).
  7. Once complete, SSH to your instance.
  8. RUN these command as SUDO or ROOT user.
  9. These are following commands to know about your Volume or disk in linux.
    df -h
    fdisk -l /dev/xvda
As you can see xvda has new volume size 30GB and and xvda1 mounted partition is stilled 20GB.

    10. Now you have type this command to extend your mounted partition: sudo growpart /dev/xvda 1
    11. Now you should have new partition size, check by running: sudo lsblk
    12. Lastly, you should extend your file system depending upon XFS OR EXTs( ext2, ext3 & ext4 ).
    – If you have XFS volume, then run: sudo xfs_growfs /dev/xvda1
    – If you have EXT volume, then run: sudo resize2fs /dev/xvda1

That’s all folks!

Your volume has been resize and these can all be achieved without downtime or shutting down your server.

Here are some of the screenshot I created to help with visual guides:

Happy System Admin-ing !!
Linux is the King ! 🙂

To successfully install and generate a Let’s Encrypt SSL cert. for a main domain or main hostname of the server, Please see following steps:

1. Go to “Webmin” at left side menu

2. Click and expand “Webmin” menu and click on “Webmin Configuration”

3. My Webmin configuration shows webmin version as “Webmin 1.851” here. There should be a box options saying “SSL Encryption”, click on this.

4. Click on “Let’s Encrypt” tab to use Let’s Encrypt SSL certificate as we are going to do.

5. Make sure your Hostname is correct. Make sure Website root directory is “/var/www/html” as defaulted in your apache configuration. Make sure monthly renewal is 3 monthly because all Let’s Encrypt SSL certificate expires within 3 months.

6. Click on “Request Certificate” to request for SSL from Let’s Encrypt.

And That’s All.


This guide is divided into 3 steps: installing/tesing Apache, PHP and finally MySQL.

Lets start with Apache:
1. Open the terminal (we will be using it through most of my guide) from Applications > Accessories > Terminal
2. Install apache2 using apt-get by typing the following

sudo apt-get install apache2

Note that you should know the root password.
Now everything should be downloaded and installed automatically.
To start/stop apache2 write:
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop

Your www folder should be in: /var/www/

If everything is OK you should see an ordinary HTML page when you type: http://localhost in your firefox browser

Finished with Apache ? lets conquer PHP:
1. Also in terminal write:
sudo apt-get install php5 libapache2-mod-php5

or any php version you like
2. restart apache
sudo /etc/init.d/apache2 restart

This is it for PHP 😀
Wanna test it ? Just create an ordinary PHP page in /var/www/ and run it.
sudo gedit /var/www/test.php

and write in it: < ?php echo “Hello World”; ?>

Now run it by typing http://localhost/test.php in firefox… You should see your ” Hello World ”
66 % is over, lets continue to installing MySQL:
1. Again and again in terminal execute:
sudo apt-get install mysql-server

2. (optional) If you are running a server you should probably bind your address by editing bind-address in /etc/mysql/my.cnf and replacing its value ( by your IP address

3. set your root password (although mysql should ask you about that when installing)
mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘xxxxxx’);

4. Try running it
mysql -uroot -pxxx

where xxx is your password.
Note: You can install PHPMyAdmin for a graphical user interface of MySQL by executing
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

5. restart apache for the last time
sudo /etc/init.d/apache2 restart

Congratulions your LAMP system is installed and running 😀

For installing/running phpmyadmin.

sudo apt-get install phpmyadmin

The phpmyadmin configuration file will be installed in: /etc/phpmyadmin
Now you will have to edit the apache config file by typing
sudo vi /etc/apache2/apache2.conf

and include the following line:
Include /etc/phpmyadmin/apache.conf

Restart Apache
sudo /etc/init.d/apache2 restart

Another issue was making mysql run with php5
First install these packages:
sudo apt-get install php5-mysql mysql-client

then edit php.ini and add to it this line : ”” if it isnt already there
sudo vi /etc/php5/apache2/php.ini

Restart Apache
sudo /etc/init.d/apache2 restart

for editing text files …. see “vi” editor guide …… you can download from here,
–> click here:   vi Guide

Here is some of the documentation for using “vi” editor for Ubuntu users

vi Editor

Here are some of the TERMINAL commands that you will need always to perform any task in linux,

su : Super User rights from within the terminal
sudo : super user run this command             [  “sudo su”  for ubuntu  ]
ls : list directory contents
ls -lis : list directory content is list view
cd : change directory
cd /dirname : jump change a directory
apt-get install : gets app from web and installs [NOTE from dannyboy: I would use aptitude, it keeps track of dependencies and when you uninstall stuff it takes the dependencies with it, apt-get DOESN’T do this!]
apt-get remove : uninstalls app [same here]
apt-get update : updates the DB [same here]
clear : clears screen
./filename : processes a install command
mkdir : creates a directory
chmod 777 dirname : resets access rights to directory [i don’t know what you mean by resets access right, chomd will make the dir readable, writable, and executable i thought?]
kill 999 : kills process at high level
reboot : reboots system
exit : exits from terminal or moves back a userlevel
make : comlies package code
make install : installs the compiled code
uname -r : gives you the kernel version
dir : will list all directories within your current location
cat filenamehere : will display it’s contents
pwd : will show you your current location (very important if you’re usincli ftp)
cp oldfilename newfilename : copies a file
mv oldfile newfile : will overwrite the oldfile with the newfile
chown usernamehere dirnamehere : changes the dir owner to whoever you put
chgrp groupnamehere dirnamehere : changes the group who owns the dir

man ls # will give you information about ls

tar -xf
Extracts the contents of most tar.** archives.

apt-cache search ****
Searches the apt database for packages with names or descriptions similar to ****

apt-cache show ****
Shows information on package ****, for example “apt-cache show unzip”.

df -h
Shows mounted filesystems and space usage infomation for them.

du -hs /path/to/directory/
Shows the size of the contents of the specified directory.

–>Having an & at the end of the command line sends this process to the background (you regain the prompt to type more commands). If you type a command followed by && and then another command (i.e. $command1 && command2) the second command will only be started when the first one is finished

Few links for better more learnings,

An A-Z Index of the Linux BASH command line

Alphabetical Directory of Linux Commands

Linux Shortcuts and Commands:

For web developers, this link will help installing LAMP on Linux in a proper way so all updates are enable for apache, PHP and MYSQL.

Installing LAMP on Ubuntu  (Linux,Apache,MySQL,PHP)
Installing best PHP editor for Ubuntu.