My first post – why this website

I was hosting a Wordpress websit in AWS earlier and below is the content of my first post.

I fancied to have my own website for a long time.
Since I never considered myself as good story teller, had no urge to create a blog site using worpress.com or blogspot.com.
But then my curiosity to know about AWS led me to create an EC2 instance and install WordPress.
Now that the website is in place, I plan to use this as a my tool in the cloud to record interesting technical stuffs and my experiences so that I need not worry about forgetting when I need them.

Below are the steps I noted down while I was working to get this site up and running.

Create and instance (Ubuntu)
Look for documents in AWS follow what is said in it to create an instance.
Get Key value pair
Use puttykeygen to generate key
Use putty to connect to ubuntu through SSH

Install LAMP
Follow what is written the blogs below to install
  1. Apache2
  2. MySQL
  3. PHP

Enable SSL
  1. Check if OpenSSL is installed (openssl version)
If not install (sudo apt-get install openssl)
  1. Check if SSL module is available in apache2 (should be installed when you installed apache2)
The /etc/apache2/mods-available directory contains configuration files to both load modules and configure them. The .load files inside this directory contain the Apache Load directives to load the modules into the web server, and the .conf files contain additional configuration directives necessary for the operation of the modules.

Modules are enabled using the a2enmod command. The enabled modules are listed in the /etc/apache2/mods-enabled directory as links to the corresponding modules in the /etc/apache2/mods-available directory. To disable a module, the a2dismod command is used.
  1. Enable SSL module in apache by typing:
sudo a2enmod ssl
After you have enabled SSL, you’ll have to restart the web server for the change to be recognized:
sudo service apache2 restart
Command to check the modules loaded in  apache2
apache2ctl -M | sort

  1. Secure Apache2 with Let’s Encrypt
Do as said in the below URL :
  1. Redirect non-WWW to WWW
Amend the file “/etc/apache2/sites-available/000-default-le-ssl.conf
<VirtualHost *:80>
Redirect permanent / https://www.sridhars.net/
</VirtualHost>

In <VirtualHost *:443> section, add the following rules:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^sridhars\.net$ [NC]
RewriteRule ^ https://www.sridhars.net%{REQUEST_URI} [R=301,L]

Install PHPMyAdmin
Follow what is written the blogs below to install

Open “/etc/apache2/apache2.conf”
and paste the following at the end of file

Include /etc/phpmyadmin/apache.conf

restart apache2

Install WordPress
Follow as instructed in the URL below
Create a database for wordpress in MySQL
mysql> CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL ON wordpress.* TO ‘wordpressuser’@’localhost’ IDENTIFIED BY ‘XXXXXXX’;
mysql> GRANT ALL ON wordpress.* TO ‘wordpressuser’@’sridhars.net’ IDENTIFIED BY ‘XXXXXXX’;
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
sudo apt-get update
sudo apt-get install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc
sudo systemctl restart apache2
Enable .htaccess Overrides
Open the primary Apache configuration file to make our first change:
sudo nano /etc/apache2/apache2.conf
To allow .htaccess files, we need to set the AllowOverride directive within a Directory block pointing to our document root. Towards the bottom of the file, add the following block:
/etc/apache2/apache2.conf
. . .
<Directory /var/www/html/>
AllowOverride All
</Directory>

. . .
When you are finished, save and close the file.
Enable the Rewrite Module
Next, we can enable mod_rewrite so that we can utilize the WordPress permalink feature:
sudo a2enmod rewrite
sudo systemctl restart apache2

Comments

Popular posts from this blog

Data Architecture and Management Designer certification

Passed my Salesforce Platform Developer 2 Multiple Choice exam