I believe that you now installed your Ubuntu Server, lets start install LAMP stack and configure MySQL database with Apache Web Server.

sudo apt-get update [Downloads the package lists from the repositories]
sudo apt-get upgrade [Fetch new versions of packages and upgrades]
sudo apt-get install tasksel
[To install required task feature on Linux system] 
Select LAMP Server, Choose space button to select.
Once LAMP Stack installed Verify Apache is Running
[sudo service apache2 status]
It means your Apache web server is running properly.
Now lets start to install WordPress.
cd / [TO go back to direcoty]
ls   [To see the list of folders in directory]
we are in tmp directory by typing this command cd /tmp
[wget https://wordpress.org/latest.zip]
Download wordpress package to tmp folder and then unzip 
to unzip install this package first using this command
[sudo apt-get install unzip]
Now you can find in tmp folder latest.zip and unzip it.
Now copy WordPress folder to /var/www/html folder
sudo cp -r wordpress /var/www/html/
cd /var/www/html
ls
Verify the WordPress folder in /var/www/html directory
Now configure database for your server.
sudo mysql
create database myfirstdb;
create user 'asath'@'localhost' identified by 'yourpass';
grant all privileges on myfirstdb.* to 'asath'@'localhost' identified by 'yourpass';

flush privileges;
exit
Now you have created database and lets configure PHP and WordPress.
Navigate to WordPress directory
cd /home/u676584056/domains/buildingtheitguy.com/public_html/
Now copy wp-config-sample.php file with a name wp-config.php
sudo cp wp-config-sample.php wp-config.php
Now edit wp-config.php file on editor and change DB_NAME,DB_USER,DB_PASSWORD
which we created earlier.
sudo nano wp-config.php
Now move to apache2 directory
cd /etc/apache2/
ls
sudo nan000-default.conf
(change Document Root )
DocumentRoot /var/www/html/wordpress
After edit back to one level on directory by [cd ..] and then
cd sites-enabled/
Now make sure your default page conf is enabled to reach your site.
once enabled restart your apache2 service and check the status.
Once you done, enter IP address of your server from another device,
It should reach to configure the WordPress.
Once you enter your information you can start to create page and change theme and create your post and blog.
Congratulations !!! You Create your first website. 

I believe that, I take you to seashore and now you need to develop your skills for how to catch your fish.

I recommend to practice this and built your site locally first on your PC, then do you want to create in real world server, ping me – I will share my cloud server with you.

Please do share to students this post, who want to be a programmer.

Here’s my cloud server if you want request me and I’m exited to share my knowledge. CLICK

By Mohamed Asath

Turning IT Challenges into Opportunities

3 thoughts on “How to Config LAMP STACK on Ubuntu Server – Part 2”
  1. Long time supporter, and thought I’d drop a comment.

    Your wordpress site is very sleek – hope you don’t mind me asking what theme you’re using?

    (and don’t mind if I steal it? :P)

    I just launched my site –also built in wordpress like yours– but the theme slows (!)
    the site down quite a bit.

    In case you have a minute, you can find it by searching
    for “royal cbd” on Google (would appreciate any feedback) –
    it’s still in the works.

    Keep up the good work– and hope you all take care of yourself during the coronavirus scare!

Leave a Reply

Your email address will not be published. Required fields are marked *