{"id":296,"date":"2019-09-28T00:06:12","date_gmt":"2019-09-28T04:06:12","guid":{"rendered":"http:\/\/www.reginedeguzman.com\/blog\/?p=296"},"modified":"2020-03-20T20:07:50","modified_gmt":"2020-03-21T00:07:50","slug":"installing-wordpress-on-a-ubuntu-aws-instance-using-a-mysql-rds","status":"publish","type":"post","link":"http:\/\/www.reginedeguzman.com\/blog\/installing-wordpress-on-a-ubuntu-aws-instance-using-a-mysql-rds\/","title":{"rendered":"Installing WordPress on a Ubuntu AWS instance using a MYSQL RDS"},"content":{"rendered":"<style type=\"text\/css\"><\/style>\n<p>Here is how you manually install WordPress on a Ubuntu AWS instance. And pointing your WordPress database to a MYSQL RDS.<\/p>\n\n\n\n<p>Sign into your AWS account &#8211;&gt; RDS &#8211;&gt; &#8220;Create Database&#8221;<br>&#8211; Choose &#8220;Standard Create&#8221;<br>&#8211; Engine Option: &#8220;MYSQL&#8221;<br>&#8211; Version: &lt;The latest version 5&gt;<br>&#8211; (For now, choose the &#8220;Free Tier&#8221; template)<br>&#8211; Give the database an identifier (doesn&#8217;t necessarily have to be your DB name)<br>&#8211; Provide an Master username\/password<br>&#8211; Allocate a certain storage size<br>&#8211; Expand &#8220;Additional connectivity configuration&#8221;<br>&#8211; Make the database publicly available (yes)<br>&#8211; Create a new Security Group named &#8220;MYSQL&#8221; and assign it the port 3306<br>&#8211; Expand &#8220;Additional configuration&#8221;<br>&#8211; For &#8220;Initial database name&#8221;: &#8220;wordpress&#8221; <\/p>\n\n\n\n<p>Sign into your AWS account &#8211;&gt; EC2 &#8211;&gt; &#8220;Launch Instance&#8221;<\/p>\n\n\n\n<p>For now we&#8217;ll just use a t2.micro free instance<\/p>\n\n\n\n<p>When it prompts you to choose an AMI, search for &#8220;Ubuntu&#8221; in the &#8220;Community AMIs&#8221; tab. Select the AMI &#8220;ubuntu\/images\/hvm-ssd\/ubuntu-xenial-16.04&#8221;<\/p>\n\n\n\n<p>Use the default selections, but when you get to &#8220;Storage&#8221; increase it to &#8220;25gb&#8221; (just to use the max free tier size options)<\/p>\n\n\n\n<p>Create a &#8220;Name&#8221; tag, then give it a value<\/p>\n\n\n\n<p>Create a Security Group named &#8220;WordPress&#8221; and add &#8220;HTTP&#8221; open anywhere. Add &#8220;HTTPS&#8221; open anywhere. Then add your home IP address to the security group.<br>If you already have a security group then choose that existing security group.<\/p>\n\n\n\n<p>Either create a new key\/pair, or choose an existing one that you can log into the instance with.<\/p>\n\n\n\n<p>Wait for the instance to stand up.<\/p>\n\n\n\n<p>Go to your security groups, select the &#8220;MYSQL&#8221; security group &#8211;&gt; &#8220;Incoming&#8221; &#8211;&gt; Edit the 3306 port source to the internal IP of the instance you just created.<\/p>\n\n\n\n<p>SSH into it: <code>ssh -i &lt;PATH TO YOUR KEYPAIR PEM&gt; ubuntu@&lt;PUBLIC IP ADDRESS&gt;<\/code><\/p>\n\n\n\n<p>Run these commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install software-properties-common\nsudo add-apt-repository ppa:ondrej\/php\nsudo apt-get update\nsudo apt-get upgrade\nsudo apt-get install mysql-server mysql-client\nsudo apt-get install apache2 apache2-doc apache2-utils libexpat1 ssl-cert\nsudo apt-get install php7.3 php7.3-mysql php7.3-mbstring php7.3-soap\nsudo apt-get install phpmyadmin<\/code><\/pre>\n\n\n\n<p>Download the latest WordPress tarball:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/html\nsudo wget http:\/\/wordpress.org\/latest.tar.gz\nsudo tar -zxvf latest.tar.gz\nsudo mv wordpress\/* .\nsudo rm -f index.html<\/code><\/pre>\n\n\n\n<p>Configure the wp-config.php file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cp wp-config-sample.php wp-config.php<\/code><\/pre>\n\n\n\n<p>Update the database info with your RDS info in the &#8220;wp-config.php&#8221; file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ ** MySQL settings - You can get this info from your web host ** \/\/\n\/** The name of the database for WordPress *\/\ndefine( 'DB_NAME', '&lt;RDS DB Name>' );\n\n\/** MySQL database username *\/\ndefine( 'DB_USER', '&lt;Master Username>' );\n\n\/** MySQL database password *\/\ndefine( 'DB_PASSWORD', '&lt;Master Password>' );\n\n\/** MySQL hostname *\/\ndefine( 'DB_HOST', '&lt;RDS Endpoint>:3306' );<\/code><\/pre>\n\n\n\n<p>Save the file<\/p>\n\n\n\n<p>Give your wordpress files the proper permissions for Apache to access them<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown www-data:www-data -R \/var\/www\/html<\/code><\/pre>\n\n\n\n<p>Update the php.ini file for the following settings:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/php\/7.3\/apache2\/php.ini\n\nmemory_limit = 512M\npost_max_size = 128M\nupload_max_filesize = 256M<\/code><\/pre>\n\n\n\n<p>Uncomment the soap extension line in php.ini:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>extension=soap<\/code><\/pre>\n\n\n\n<p>Enable &#8220;mod rewrite&#8221;: <code>sudo a2enmod rewrite<\/code><\/p>\n\n\n\n<p>Edit <code>\/etc\/apache2\/apache2.conf<\/code> &#8211; to enable &#8220;AllowOverride&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Directory \/>\n        Options FollowSymLinks\n        #AllowOverride None\n        AllowOverride All\n        Require all denied\n&lt;\/Directory>\n\n&lt;Directory \/usr\/share>\n        #AllowOverride None\n        AllowOverride All\n        Require all granted\n&lt;\/Directory>\n\n&lt;Directory \/var\/www\/>\n        Options Indexes FollowSymLinks\n        #AllowOverride None\n        AllowOverride All\n        Require all granted\n&lt;\/Directory><\/code><\/pre>\n\n\n\n<p>Restart Apache2: <code>sudo service apache2 restart<\/code><\/p>\n\n\n\n<p>Now try to access your WordPress in the browser: http:\/\/&lt;EC2 Instance Public IP&gt;\/wp-admin<\/p>\n\n\n\n<p>This should take you to a WordPress page where you need to create the administrator account. Set up your credentials then log into your account.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is how you manually install WordPress on a Ubuntu AWS instance. And pointing your WordPress database to a MYSQL RDS. Sign into your AWS account &#8211;&gt; RDS &#8211;&gt; &#8220;Create Database&#8221;&#8211; Choose &#8220;Standard Create&#8221;&#8211; Engine Option: &#8220;MYSQL&#8221;&#8211; Version: &lt;The latest version 5&gt;&#8211; (For now, choose the &#8220;Free Tier&#8221; template)&#8211; Give the database an identifier (doesn&#8217;t&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[62,63,60],"class_list":["post-296","post","type-post","status-publish","format-standard","hentry","category-tech-2","tag-aws","tag-rds","tag-wordpress"],"_links":{"self":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts\/296"}],"collection":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/comments?post=296"}],"version-history":[{"count":11,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":324,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/posts\/296\/revisions\/324"}],"wp:attachment":[{"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.reginedeguzman.com\/blog\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}