{"id":23,"date":"2016-12-21T16:29:25","date_gmt":"2016-12-21T16:29:25","guid":{"rendered":"http:\/\/bryceautomation.com\/?page_id=23"},"modified":"2017-05-20T02:37:15","modified_gmt":"2017-05-20T02:37:15","slug":"configuring-virtual-private-server","status":"publish","type":"post","link":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/","title":{"rendered":"Configuring a VPS"},"content":{"rendered":"<p>In this document, we will configure a Virtual Private Server (VPS) using the service &#8220;Linode&#8221;. \u00a0 This documentation is for example only. \u00a0 The purpose of configuring this server is to interface with Arduino projects for logging and displaying data. \u00a0In this document, I will walk you through a step by step process in getting the Linode created, and installing the Apache web server, PHP5 support, and MySQL database using the Debian Linux 8 Operating System. \u00a0 There is no guarantee of security in these steps, so you will be responsible for implementing your own security, safety, etc. \u00a0 This document is provided &#8220;as-is&#8221; in the hope that I can give you some ideas for your projects. \u00a0Should you decide to act on these steps, you are responsible for your own actions. \u00a0&#8220;Personal Responsibility&#8221;! Although you don&#8217;t need to have a domain name to make your project work, I will guide you through the process of using a domain name, and I will use the domain name &#8220;LearnAutomation.com&#8221; in these examples.<\/p><div id=\"bryce-4001737082\" class=\"bryce-afterfirst bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"7728240895\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p>Please utilize this link to configure your VPS. \u00a0\u00a0<a href=\"https:\/\/www.linode.com\/?r=e74ad469f932a27c255a2013e86ce00a5d1e9827\">https:\/\/www.linode.com\/?r=e74ad469f932a27c255a2013e86ce00a5d1e9827<\/a>\u00a0 \u00a0I have tried many, many different VPS services, but I&#8217;ve found Linode to be the most reliable service with the best price (for my applications).<\/p>\n<h4>Step 1 &#8212; Create an account for your domain name<\/h4>\n<p>Please create an account with a\u00a0registrar, such as godaddy.com, and register a domain name of your choosing. \u00a0 \u00a0I will walk you through the DNS configuration for tihs doman later in the document. \u00a0If this is your first time registering your domain name, most registrars will give you a good discount. \u00a0If you choose to use only IP addresses for your project, you can skip this step.<\/p>\n<h4>Step 2 &#8212; Creating your VPS account, and VPS Server<\/h4>\n<p>Create a Linode account. \u00a0Please use this referral link to help support this site:<\/p>\n<p><a href=\"https:\/\/www.linode.com\/?r=e74ad469f932a27c255a2013e86ce00a5d1e9827\">https:\/\/www.linode.com\/?r=e74ad469f932a27c255a2013e86ce00a5d1e9827<\/a><\/p>\n<p>If you use the referral code, Linode may apply a credit to my server, and that helps with projects like these!<\/p>\n<h4><img decoding=\"async\" class=\"wp-image-32 alignleft lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linode2048.png\" alt=\"\" width=\"161\" height=\"117\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 161px; --smush-placeholder-aspect-ratio: 161\/117;\" \/>Step 3)<\/h4>\n<p>Choose your package. \u00a0 For this example, I will choose the least expensive option, which is currently a Linode 2048 for $10\/month. T<img decoding=\"async\" class=\"size-medium wp-image-34 alignright lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/locationadd2048-300x82.png\" alt=\"\" width=\"300\" height=\"82\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/locationadd2048-300x82.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/locationadd2048.png 568w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/82;\" \/>his package contains 24GB Disk space, and 1 CPU core. \u00a0Choose the location that you would like to have your linode hosted, and then add the Linode. \u00a0You will be prompted to complete your order on the next page.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4>Step 4 &#8212; Your VPS Setup<img decoding=\"async\" class=\"alignright wp-image-36 size-full lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodecreation2048.png\" width=\"672\" height=\"84\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodecreation2048.png 672w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodecreation2048-300x38.png 300w\" data-sizes=\"(max-width: 672px) 100vw, 672px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 672px; --smush-placeholder-aspect-ratio: 672\/84;\" \/><\/h4>\n<p>After a few minutes, your Linode will be created. \u00a0 Kindly make a note of your IP address. \u00a0 We will need this later to configure the DNS for the domain name you registered in Step 1. \u00a0 Click on the Link of your Linode ID. \u00a0In this case, I will click on linode2587604.<\/p>\n<h4>Step 5 &#8212; Deploy the VPS Image<img decoding=\"async\" class=\"alignright size-medium wp-image-38 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/deploylinode-300x55.png\" alt=\"\" width=\"300\" height=\"55\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/deploylinode-300x55.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/deploylinode.png 378w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/55;\" \/><\/h4>\n<p>Next, we will deploy an image. This will automatically install our Operating System onto the server.<\/p>\n<h4>Step 6 &#8212; Set the parameters<img decoding=\"async\" class=\"alignright size-medium wp-image-39 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodedebian8-300x157.png\" alt=\"\" width=\"300\" height=\"157\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodedebian8-300x157.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodedebian8.png 461w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/157;\" \/><\/h4>\n<p>&nbsp;<\/p>\n<p>Here, I will choose Debian 8, and take full use of the hard drive leaving the swap size at default. \u00a0 \u00a0If you find that your Linode is using a lot of swap space later on, you might consider upgrading your package. \u00a0 \u00a0 If the server is running low on memory, it will place data into the swap space on the virtual disk. \u00a0 This drastically decreases the performance of your VPS. \u00a0 Be sure to enter a root password, and then deploy your server.<\/p>\n<h4>Step 7 &#8212; DNS Zone<img decoding=\"async\" class=\"alignright wp-image-43 size-full lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/dnsmanager.png\" width=\"675\" height=\"154\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/dnsmanager.png 675w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/dnsmanager-300x68.png 300w\" data-sizes=\"(max-width: 675px) 100vw, 675px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 675px; --smush-placeholder-aspect-ratio: 675\/154;\" \/><\/h4>\n<p>Next, we&#8217;ll configure the Reverse DNS. \u00a0 Although this is not required for most projects, we will set this up in case we decide to have our scripts send out email, or if we choose to use this linode as an email server.\u00a0First, we must configure a forward DNS zone, so we can add the reverse DNS zone. \u00a0 Under DNS Manager, add a domain zone.<\/p>\n<p>&nbsp;<\/p>\n<h4>Step 8 &#8212; Forward Zone<img decoding=\"async\" class=\"alignright wp-image-46 size-full lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodeaddzone.png\" width=\"747\" height=\"231\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodeaddzone.png 747w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodeaddzone-300x93.png 300w\" data-sizes=\"(max-width: 747px) 100vw, 747px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 747px; --smush-placeholder-aspect-ratio: 747\/231;\" \/><\/h4>\n<p>Enter the domain that you chose in step 1, and be sure to enter your email address for this DNS Zone. \u00a0Add the Master Zone.<\/p>\n<p>&nbsp;<\/p>\n<h4><img decoding=\"async\" class=\"wp-image-42 size-full alignleft lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodereversedns1.png\" width=\"573\" height=\"136\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodereversedns1.png 573w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodereversedns1-300x71.png 300w\" data-sizes=\"(max-width: 573px) 100vw, 573px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 573px; --smush-placeholder-aspect-ratio: 573\/136;\" \/>Step 9 &#8212; Reverse DNS<\/h4>\n<p>Now, we will open our Linode again, and under &#8220;Remote Access&#8221;, choose &#8220;Reverse DNS&#8221;. \u00a0Enter your domain name. \u00a0 <em>Note: \u00a0 You may have to come back to re-visit this step if the forward DNS has not updated yet. \u00a0You might even want to wait until the next day.<\/em><\/p>\n<p>&nbsp;<\/p>\n<h4>Step 10 &#8212; Boot your VPS<img decoding=\"async\" class=\"alignright size-medium wp-image-50 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodeboot-300x83.png\" alt=\"\" width=\"300\" height=\"83\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodeboot-300x83.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/linodeboot.png 411w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/83;\" \/><\/h4>\n<p>Congratulations. \u00a0Your VPS is now set up, and we are ready to boot your VPS. \u00a0After booting your VPS, please allow a couple minutes for the boot up process to complete.<\/p>\n<h4>Step 11 &#8212; Verify your domain name<\/h4>\n<p>Back at your registrar (such as Godaddy), please set the &#8220;A&#8221; record of your DNS to the IP address of your VPS. \u00a0This will allow you to use your domain name from now on to access your VPS from your PC without having to remember your IP address. \u00a0 \u00a0We will still need to use the IP address in some of our projects, however. \u00a0 It could take up to 48 hours for your domain name to work, but you can test this using the PING command from your command prompt. \u00a0 \u00a0When \u00a0you ping your domain name, the correct IP address should be returned.<img decoding=\"async\" class=\"alignright wp-image-52 size-full lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/serverping.png\" width=\"832\" height=\"50\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/serverping.png 832w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/serverping-300x18.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/serverping-768x46.png 768w\" data-sizes=\"(max-width: 832px) 100vw, 832px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 832px; --smush-placeholder-aspect-ratio: 832\/50;\" \/><\/p>\n<h4>Step 12 &#8212; \u00a0Connect to your VPS server<img decoding=\"async\" class=\"size-medium wp-image-54 alignleft lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/putty-300x120.png\" alt=\"\" width=\"300\" height=\"120\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/putty-300x120.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/putty.png 536w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/120;\" \/><\/h4>\n<p>If you are using Linux, you can use your terminal to access the server. \u00a0 If you are using Windows, then you can download PUTTY. \u00a0As of the writing of this document, PUTTY can be downloaded at\u00a0http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html \u00a0Here, we will access the server as the &#8220;root&#8221; user. \u00a0 \u00a0In linux, you can type ssh root@learnautomation.com (using your own domain name) or in putty, enter your domain name as the host, then open the link. \u00a0Be sure to login as root, and use the password that you set up your linode with.<\/p>\n<h4>Step 13 &#8212; Get Updates<\/h4>\n<p>Next we will get the updates. \u00a0 \u00a0To get the updates, we will just type: \u00a0 <strong>\u00a0apt-get update<\/strong> \u00a0When the repository update is complete (after about 5 minutes), type: \u00a0 <strong>apt-get upgrade<\/strong> to install the package upgrades to your system.<\/p>\n<h4>Step 14 &#8212; Set your Hostname<\/h4>\n<p>Now we will set the hostname of your server. \u00a0 We can do this with: \u00a0<strong> hostnamectl set-hostname learnautomation.com<\/strong> \u00a0(using your own domain name) \u00a0Next let&#8217;s reboot the server. \u00a0 Just type: \u00a0 <strong>reboot<\/strong> \u00a0 \u00a0 to ensure all changes so far are in place.<\/p>\n<h4><strong><em>Note: \u00a0<\/em><\/strong><em>Documentation for the following steps is from\u00a0<\/em><em><a href=\"https:\/\/www.linode.com\/docs\/websites\/lamp\/lamp-on-debian-8-jessie\">https:\/\/www.linode.com\/docs\/websites\/lamp\/lamp-on-debian-8-jessie<\/a>\u00a0 Thank you Linode, for providing great documentation! \u00a0I will re-phrase some of the steps here.<\/em><\/h4>\n<h4>Step 15 &#8212; Package configuration<\/h4>\n<p>Now, we will install some packages we will need. \u00a0 Log back into your server as root, and type: \u00a0<strong> apt-get install apache2 mysql-server php5 php-pear php5-mysql nano<\/strong> \u00a0 \u00a0You will be asked for the admin password for mysql-server during this installation.<\/p>\n<h4>Step 16 &#8212; Apache Configuration for KeepAlive<img decoding=\"async\" class=\"alignright size-medium wp-image-59 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/keepalive-300x100.png\" alt=\"\" width=\"300\" height=\"100\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/keepalive-300x100.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/keepalive.png 382w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/100;\" \/><\/h4>\n<p>Now, we are ready to configure the Apache\u00a0web server. \u00a0 First, we will shut off the KeepAlive feature of Apache. \u00a0The KeepAlive feature might make your website a little faster, but it does increase memory usage on the server, which is limited in our case. \u00a0 \u00a0While logged into the server using PUTTY or your terminal as the root user, type: <strong>\u00a0cd \/etc\/apache2<\/strong> \u00a0Now, we will edit the apache2.conf file to shut off the KeepAlive feature. \u00a0 Type: \u00a0<strong>nano apache2.conf \u00a0<\/strong>Now, set the KeepAlive to off. \u00a0 Press Control-X on your keyboard, and save the changes. \u00a0(press Y, then enter to confirm the file to which you are making changes.<\/p>\n<h4><img decoding=\"async\" class=\"size-medium wp-image-61 alignleft lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/prefork-300x142.png\" alt=\"\" width=\"300\" height=\"142\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/prefork-300x142.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/prefork.png 638w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/142;\" \/>Step 17 &#8212; \u00a0Apache Module Configuration<\/h4>\n<p>Now, we will configure the mpm_prefork options. \u00a0 The prefork feature makes your server more efficient, but must be &#8220;tuned&#8221; on your server as to reliably serve web pages timely, yet not use up too much memory. \u00a0 \u00a0Type<strong> cd \/etc\/apache2\/mods-available\/<\/strong> \u00a0Then we will edit the file with <strong>nano mpm_prefork.conf\u00a0<\/strong> The values shown are a good starting point for a server with 2G of memory according to the documentation on the Linode website. \u00a0Press Control-X to exit, then Y to save, and press enter to confirm the file name to save the changes to.<\/p>\n<p>&nbsp;<\/p>\n<h4>Step 18 &#8212; Enable\/Disable Apache modules<\/h4>\n<p>Disable the Event module, and Enable the prefork module. \u00a0Type: \u00a0<strong>a2dismod mpm_event \u00a0<\/strong> \u00a0then type: \u00a0<strong> a2enmod mpm_prefork<\/strong>\u00a0 \u00a0You may find that these are already done on your Linode deployment. \u00a0 Now, restart apache with \u00a0<strong> systemctl restart apache2<\/strong><\/p>\n<h4>Step 19 &#8212; Virtual Hosting Directory<\/h4>\n<p>Eventually, we may want to have multiple websites running on the same server, so we will want to set up name based virtual hosting to accomplish this. \u00a0 In our case, we will just have a single virtual host, but it&#8217;s easier to set this up now, rather than to move things around later on. \u00a0 \u00a0First, we&#8217;ll create a couple directories with the mkdir command. \u00a0 \u00a0Type \u00a0 <strong>mkdir -p \/var\/www\/vhosts\/learnautomation.com\/public_html \u00a0<\/strong>Be sure to substitute your own domain name. \u00a0 I&#8217;m deviating a little bit from some documentation to remain consistent with my other servers. \u00a0The public_html folder is where we will put the files for our website later on.<\/p>\n<h4>Step 20 &#8212; Virtual Host Configuration<\/h4>\n<p>Next, we must create the Apache configuration file for this domain. \u00a0 \u00a0Type <strong>cd \/etc\/apache2\/sites-available \u00a0<\/strong>\u00a0Now, we will create the configuration file. \u00a0 Type: \u00a0<strong>nano 01_learnautomation.com.conf<\/strong> \u00a0(Using your own domain name). \u00a0Place the following text into nano making the appropriate changes:<\/p>\n<p>&lt;VirtualHost *&gt;<br \/>\nDocumentRoot &#8220;\/var\/www\/vhosts\/learnautomation.com\/public_html&#8221;<br \/>\nServerName learnautomation.com<br \/>\nServerAlias www.learnautomation.com<br \/>\nErrorLog ${APACHE_LOG_DIR}\/learnautomation.com-error.log<br \/>\nCustomLog ${APACHE_LOG_DIR}\/learnautomation.com-access.log combined<br \/>\n&lt;Directory &#8220;\/var\/www\/vhosts\/learnautomation.com\/public_html&#8221;&gt;<br \/>\nallow from all<br \/>\nOptions None<br \/>\nRequire all granted<br \/>\n&lt;\/Directory&gt;<br \/>\n&lt;\/VirtualHost&gt;<\/p>\n<p>Now press Control-X to exit, y to save, and enter to confirm the file name.<\/p>\n<p><strong>Step 21 &#8212; Enable the site<\/strong><\/p>\n<p>Now, we will enable the site. \u00a0 Type:<strong> \u00a0a2ensite 01_learnautomation.com.conf \u00a0\u00a0<\/strong>You will get a message to reload apache. \u00a0 <strong>service apache2 reload<\/strong><\/p>\n<h4>Step 22 &#8212; Write a Test Page<\/h4>\n<p>Now, we need an index file that Apache2 can serve to anyone visiting your domain. \u00a0 Go to \u00a0 <strong>cd \/var\/www\/vhosts\/learnautomation.com\/public_html <\/strong>also, let&#8217;s type\u00a0<strong>nano index.php<\/strong><\/p>\n<p>We can test our site by entering the following information into the index.php file:<\/p>\n<p>&lt;html&gt;<br \/>\n&lt;head&gt;&lt;title&gt;This is my site!&lt;\/title&gt;&lt;\/head&gt;<br \/>\n&lt;body&gt;&lt;h1&gt;Welcome to my site!&lt;\/h1&gt;&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>Then press Control-X to exit, then Y\u00a0to save changes, and enter to verify the file name.<\/p>\n<p><strong>Step 23 &#8212; Cleanup<\/strong><\/p>\n<p>Now, let&#8217;s just do a little cleanup. \u00a0I\u00a0always like to set apache as the user of the web directory. \u00a0\u00a0<strong>chown -R www-data:www-data \/var\/www\/vhosts<\/strong><\/p>\n<p>Let&#8217;s set this site as default just in case our projects need to address it by the IP address, and not by the domain name: <strong>\u00a0cd \/etc\/apache2\/sites-available \u00a0<\/strong> Then we&#8217;ll type: \u00a0<strong>a2dissite 00-default.conf<\/strong> to disable default,\u00a0 then<strong> service apache2 restart<\/strong><\/p>\n<p>Now, just test your work! \u00a0 \u00a0Open your web browser, and the text of your index.php file should be present in your browser window.<\/p>\n<p><strong>Step 24 &#8212; MySQL Configuration<\/strong><\/p>\n<p>Now, we&#8217;ll secure the MySQL server: \u00a0 Type: \u00a0<strong>mysql_secure_installation \u00a0<\/strong>I always answer yes to the questions, except for changing the root password. \u00a0 We set that earlier.<\/p>\n<p><strong>Step 25 &#8212; PHP Configuration<\/strong><\/p>\n<p>Now, we&#8217;ll just do some final configurations in PHP5! \u00a0 <strong>cd \/etc\/php5\/apache2\/<\/strong><\/p>\n<p><img decoding=\"async\" class=\"alignright size-medium wp-image-64 lazyload\" data-src=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/maxinput-300x152.png\" alt=\"\" width=\"300\" height=\"152\" data-srcset=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/maxinput-300x152.png 300w, https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/maxinput.png 319w\" data-sizes=\"(max-width: 300px) 100vw, 300px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/152;\" \/>Then, \u00a0<strong>nano php.ini<\/strong><\/p>\n<p>find the max_input_time variable, and set this to 30. \u00a0 (You can use Control + w to search) \u00a0It might be the second instance.<\/p>\n<p>While we are here, let&#8217;s adjust the maximum upload file, and the maximum post size.:<\/p>\n<p>I will set the upload_max_filesize = 20M and post_max_size = 80M \u00a0(you can search for these also)<\/p>\n<p>&nbsp;<\/p>\n<p>You are ready to use your webserver with\u00a0your electronic projects to log and display data! \u00a0 In other documents, I will walk you through how to log data to the mysql database from a device, and how to display this data onto a web page such as temperature and humidity of your house, or a water level of your basement sump! \u00a0Pleaes let me know if you find any problems on this page, or any corrections that need to be made! \u00a0 &#8212; \u00a0Ricky Bryce<\/p>\n<p>PS. \u00a0 If you wish to continue to the steps for installing a wordpress page, please go to this link to continue:<\/p>\n<p><a href=\"https:\/\/bryceautomation.com\/index.php\/2016\/12\/22\/configuring-wordpress\/\">https:\/\/bryceautomation.com\/index.php\/2016\/12\/22\/configuring-wordpress\/<\/a><\/p>\n<div id=\"bryce-1053381433\" class=\"bryce-after-content bryce-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-8316758073402323\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-8316758073402323\" \ndata-ad-slot=\"4667596182\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>In this document, we will configure a Virtual Private Server (VPS) using the service &#8220;Linode&#8221;. \u00a0 This documentation is for example only. \u00a0 The purpose of configuring this server is to interface with Arduino projects for logging and displaying data. \u00a0In this document, I will walk you through a step by step process in getting <a class=\"moretag btn btn-primary\" href=\"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/\">Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":138,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,3],"tags":[],"class_list":{"0":"post-23","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-advanced","8":"category-information-technology","9":"czr-hentry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>VPS with Linode for use with Arduino type processors.<\/title>\n<meta name=\"description\" content=\"This site will guide you through configuring the VPS. Control and Information for your devices can be made worldwide using this VPS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VPS with Linode for use with Arduino type processors.\" \/>\n<meta property=\"og:description\" content=\"This site will guide you through configuring the VPS. Control and Information for your devices can be made worldwide using this VPS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Bryce Automation\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ricky.bryce.7\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-21T16:29:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-20T02:37:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/valinux.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"533\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ricky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/\"},\"author\":{\"name\":\"Ricky\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"headline\":\"Configuring a VPS\",\"datePublished\":\"2016-12-21T16:29:25+00:00\",\"dateModified\":\"2017-05-20T02:37:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/\"},\"wordCount\":2112,\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/valinux.jpg\",\"articleSection\":[\"Advanced\",\"Information Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/\",\"name\":\"VPS with Linode for use with Arduino type processors.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/valinux.jpg\",\"datePublished\":\"2016-12-21T16:29:25+00:00\",\"dateModified\":\"2017-05-20T02:37:15+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\"},\"description\":\"This site will guide you through configuring the VPS. Control and Information for your devices can be made worldwide using this VPS.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/#primaryimage\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/valinux.jpg\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/valinux.jpg\",\"width\":1000,\"height\":533,\"caption\":\"vaLinux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/2016\\\/12\\\/21\\\/configuring-virtual-private-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bryceautomation.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configuring a VPS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#website\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/\",\"name\":\"Bryce Automation\",\"description\":\"Automating Home and Industry...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/bryceautomation.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/#\\\/schema\\\/person\\\/5d5b0f6f6ad768f1ee52968338e63af7\",\"name\":\"Ricky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"url\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"contentUrl\":\"https:\\\/\\\/bryceautomation.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/a8f\\\/a8fe6bf79d292b388ffee281ccb12488x96.jpg\",\"caption\":\"Ricky\"},\"sameAs\":[\"http:\\\/\\\/bryceautomation.com\",\"https:\\\/\\\/www.facebook.com\\\/ricky.bryce.7\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ricky-bryce-4367a416\\\/\"],\"url\":\"https:\\\/\\\/bryceautomation.com\\\/index.php\\\/author\\\/ricky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VPS with Linode for use with Arduino type processors.","description":"This site will guide you through configuring the VPS. Control and Information for your devices can be made worldwide using this VPS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/","og_locale":"en_US","og_type":"article","og_title":"VPS with Linode for use with Arduino type processors.","og_description":"This site will guide you through configuring the VPS. Control and Information for your devices can be made worldwide using this VPS.","og_url":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/","og_site_name":"Bryce Automation","article_author":"https:\/\/www.facebook.com\/ricky.bryce.7","article_published_time":"2016-12-21T16:29:25+00:00","article_modified_time":"2017-05-20T02:37:15+00:00","og_image":[{"width":1000,"height":533,"url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/valinux.jpg","type":"image\/jpeg"}],"author":"Ricky","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/#article","isPartOf":{"@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/"},"author":{"name":"Ricky","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"headline":"Configuring a VPS","datePublished":"2016-12-21T16:29:25+00:00","dateModified":"2017-05-20T02:37:15+00:00","mainEntityOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/"},"wordCount":2112,"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/valinux.jpg","articleSection":["Advanced","Information Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/","url":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/","name":"VPS with Linode for use with Arduino type processors.","isPartOf":{"@id":"https:\/\/bryceautomation.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/#primaryimage"},"image":{"@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/#primaryimage"},"thumbnailUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/valinux.jpg","datePublished":"2016-12-21T16:29:25+00:00","dateModified":"2017-05-20T02:37:15+00:00","author":{"@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7"},"description":"This site will guide you through configuring the VPS. Control and Information for your devices can be made worldwide using this VPS.","breadcrumb":{"@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/#primaryimage","url":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/valinux.jpg","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/uploads\/2016\/12\/valinux.jpg","width":1000,"height":533,"caption":"vaLinux"},{"@type":"BreadcrumbList","@id":"https:\/\/bryceautomation.com\/index.php\/2016\/12\/21\/configuring-virtual-private-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bryceautomation.com\/"},{"@type":"ListItem","position":2,"name":"Configuring a VPS"}]},{"@type":"WebSite","@id":"https:\/\/bryceautomation.com\/#website","url":"https:\/\/bryceautomation.com\/","name":"Bryce Automation","description":"Automating Home and Industry...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bryceautomation.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bryceautomation.com\/#\/schema\/person\/5d5b0f6f6ad768f1ee52968338e63af7","name":"Ricky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","url":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","contentUrl":"https:\/\/bryceautomation.com\/wp-content\/wphb-cache\/gravatar\/a8f\/a8fe6bf79d292b388ffee281ccb12488x96.jpg","caption":"Ricky"},"sameAs":["http:\/\/bryceautomation.com","https:\/\/www.facebook.com\/ricky.bryce.7","https:\/\/www.linkedin.com\/in\/ricky-bryce-4367a416\/"],"url":"https:\/\/bryceautomation.com\/index.php\/author\/ricky\/"}]}},"_links":{"self":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":0,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media\/138"}],"wp:attachment":[{"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bryceautomation.com\/index.php\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}