{"id":245,"date":"2022-11-23T17:20:00","date_gmt":"2022-11-23T17:20:00","guid":{"rendered":"https:\/\/techtutelage.net\/?p=245"},"modified":"2024-02-13T19:28:51","modified_gmt":"2024-02-13T19:28:51","slug":"host-wordpress-for-free-on-always-free-oracle-cloud-server","status":"publish","type":"post","link":"https:\/\/techtutelage.net\/?p=245","title":{"rendered":"Host WordPress for Free. On Always Free Oracle Cloud Server."},"content":{"rendered":"\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/FVfwjhfuw_o\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen=\"\"><\/iframe>\n\n\n\n<h2 class=\"wp-block-heading\">Get your  Always Free Oracle Cloud Server ready<\/h2>\n\n\n\n<p>To get your OCI server ready for hosting WordPress site you will need to complete the following steps. Log-in to your Oracle Cloud  Console, launch a new instance, open ports 80 and 443 in your default security list, reserve free public IP and assign the IP to your virtual server. If you need help with any of it you can use my video tutorial above to follow along.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create public DNS record<\/h2>\n\n\n\n<p>The exact process in this step will depend on who your Domain Name provider is. Luckily the concept is the same, and all you need to do is create an A record that points your domain to the reserved IP you have assigned to your virtual server on Oracle Cloud. In my video tutorial I am creating a DNS record with Namecheap, the process should be similar with other providers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Open ports 80 HTTP and 443 HTTPS in iptables<\/h2>\n\n\n\n<p>Iptables is by default installed and active on Ubuntu server on Oracle Cloud, and you will need to take an extra step and open ports 80 and 443 on it as well. You can do it by running the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT\niptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT\niptables-save &gt; \/etc\/iptables\/rules.v4<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install Prerequisites (PHP, MariaDB, PHP modules, etc.)<\/h2>\n\n\n\n<p>You will need to run the commands below to update your system, and install the listed packages as they are required by WordPress.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>apt update &amp;&amp; apt -y upgrade\napt install apache2 ghostscript libapache2-mod-php mariadb-server php php-bcmath php-curl php-imagick php-intl php-json php-mbstring  php-mysql php-xml php-zip wget unzip<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure MariaDB Database<\/h2>\n\n\n\n<p>Connect to MariaDB database server.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>sudo mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Once you connect successfully to the database server, create WordPress database and user. You can do it by running the following commands. Make sure to replace &#8220;password1&#8221; with better, more secure password.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>CREATE DATABASE wp_db;\nCREATE USER wp_user@localhost IDENTIFIED BY 'password1';\nGRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wp_db.* TO wp_user@localhost;\nFLUSH PRIVILEGES;\nquit<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install WordPress<\/h2>\n\n\n\n<p>The next step would be to download, install, and set appropriate file permissions on latest WordPress. To do that, run the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>wget https:\/\/wordpress.org\/latest.zip\nunzip latest.zip\nmv wordpress\/ \/var\/www\/html\/\nchown www-data:www-data -R \/var\/www\/html\/wordpress\/\nchmod -R 755 \/var\/www\/html\/wordpress\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure Apache Virtual Host<\/h2>\n\n\n\n<p>Create new vhost in &#8220;\/etc\/apache2\/sites-available\/&#8221; by running the command below.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>nano \/etc\/apache2\/sites-available\/wordpress.conf<\/code><\/pre>\n\n\n\n<p>Add the content from the box below to your wordpress.conf make sure to replace the ServerName directive with your domain name. That will be the same name you created public record for in the &#8220;Create public DNS record&#8221; step.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>&lt;VirtualHost *:80&gt;\n\n    DocumentRoot \/var\/www\/html\/wordpress\/\n    ServerName wp.techtutelage.net\n\n&lt;Directory \/var\/www\/html\/wordpress\/&gt;\n\n    Options FollowSymLinks\n    AllowOverride All\n    Require all granted\n\n&lt;\/Directory&gt;\n\n    ErrorLog ${APACHE_LOG_DIR}\/error.log\n    CustomLog ${APACHE_LOG_DIR}\/access.log combined\n\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n\n\n\n<p>Once you have you vhost file created go ahead and disable the default virtual host, enable the virtual host you just created, along with apache rewrite mode by running the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>a2dissite 000-default\na2ensite wordpress\na2enmod rewrite\nservice apache2 reload<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Complete WordPress Installation<\/h2>\n\n\n\n<p>At this point you should be able to access your WordPress installation page in your web browser. Once there you can follow along the installation wizard. If you need assistance you can use my video tutorial and follow along.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get Free Let&#8217;s Encrypt SSL Certificate <\/h2>\n\n\n\n<p>The easiest way to get free Let&#8217;s Encrypt Certificate and secure your WordPress site is to use apache plugin &#8220;python3-certbot-apache&#8221;. To get the plugin and install certificates run the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>apt install python3-certbot-apache\ncertbot --apache<\/code><\/pre>\n\n\n\n<p>Follow the onscreen instructions to complete SSL certificate creation and installation.<\/p>\n\n\n\n<p>For more details and to see this setup in action check out my video on youtube:<\/p>\n\n\n\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/FVfwjhfuw_o\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>Get your Always Free Oracle Cloud Server ready To get your OCI server ready for hosting WordPress site you will need to complete the following steps. Log-in to your Oracle Cloud Console, launch a new instance, open ports 80 and 443 in your default security list, reserve free public IP and assign the IP to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[],"class_list":["post-245","post","type-post","status-publish","format-standard","hentry","category-tutorials","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=245"}],"version-history":[{"count":12,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/245\/revisions"}],"predecessor-version":[{"id":437,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/245\/revisions\/437"}],"wp:attachment":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}