<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>learn Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/learn/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Thu, 21 Feb 2019 11:16:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Install GO language on CentOS 7</title>
		<link>https://www.osradar.com/install-go-language-on-centos-7/</link>
					<comments>https://www.osradar.com/install-go-language-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 21 Feb 2019 11:16:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[GoLang]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10971</guid>

					<description><![CDATA[<p>Many people are passionate about programming and use Linux as a learning platform for it. In addition, Linux being a free system lends itself to this type of educational projects. However, although it is free, it does not leave aside security and stability, to be a whole software platform. In this sense, it also adapts [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-go-language-on-centos-7/">Install GO language on CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Many people are passionate about programming and use Linux as a learning platform for it. In addition, Linux being a free system lends itself to this type of educational projects. However, although it is free, it does not leave aside security and stability, to be a whole software platform. In this sense, it also adapts to many programming languages that are emerging as an alternative to the existing ones that have dominated the sector for a long time as Java or C++. With this in mind, I will teach you how to install Go on CentOS7.</p>
<p>In the past, <a href="https://www.osradar.com/install-go-language-ubuntu-18-04/" rel="noopener">we&#8217;ve talked</a> about GO. GO is a programming language that is becoming increasingly popular among developers and sysadmin. Initially, it was created by Google but has been expanding to be used by many current developers. It is inspired by <a href="https://www.osradar.com/how-to-compile-a-c-code-on-gnu-linux/" rel="noopener">C++</a> and has binaries for Windows, Linux and Mac OS. It is also open source under the <a href="https://www.osradar.com/how-to-install-gnome-or-plasma5-kde-on-freebsd-12/" rel="noopener">BSD</a> license.</p>
<h2>1.- Upgrade the system</h2>
<p>First of all, it is necessary to make a complete update to the system. For this, run the following command:</p>
<pre>:~$ su
:~# yum update</pre>
<figure id="attachment_10973" aria-describedby="caption-attachment-10973" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10973" src="https://www.osradar.com/wp-content/uploads/2019/02/1-15.png" alt="1.- Upgrade the system" width="1365" height="299" srcset="https://www.osradar.com/wp-content/uploads/2019/02/1-15.png 1365w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-300x66.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-768x168.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-1024x224.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-696x152.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/1-15-1068x234.png 1068w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-10973" class="wp-caption-text">1.- Upgrade the system</figcaption></figure>
<p>The main objective of this is to make your system have the latest security patches available. This way it will be more stable and you will be ready to continue with the process.</p>
<h2>2.- Download and install GO</h2>
<p>CentOS 7 is a 64-bit system, so we will download the corresponding binaries using wget. If you do not have it installed, do it first.</p>
<pre>:~# yum install wget
:~# wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz</pre>
<figure id="attachment_10974" aria-describedby="caption-attachment-10974" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10974" src="https://www.osradar.com/wp-content/uploads/2019/02/2-14.png" alt="2.- Download and install GO" width="1365" height="280" srcset="https://www.osradar.com/wp-content/uploads/2019/02/2-14.png 1365w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-300x62.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-768x158.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-1024x210.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-696x143.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/2-14-1068x219.png 1068w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-10974" class="wp-caption-text">2.- Download and install GO</figcaption></figure>
<p>At the time of writing this post, the latest stable version of GO is 1.11.5. Check the GO website for the latest version.</p>
<p>After doing this, it is necessary to unzip the downloaded folder. We will do it in the <code>/usr/local</code> directory.</p>
<pre>:~# tar -zxvf go1.11.5.linux-amd64.tar.gz -C /usr/local</pre>
<figure id="attachment_10975" aria-describedby="caption-attachment-10975" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10975" src="https://www.osradar.com/wp-content/uploads/2019/02/3-14.png" alt="3.- Decompress GO" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2019/02/3-14.png 1366w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/3-14-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-10975" class="wp-caption-text">3.- Decompress GO</figcaption></figure>
<p>So that the installation does not have problems. It is necessary to define environment variables. I mean <code>GOROOT</code> and <code>PATH</code>.</p>
<pre>:~# echo 'export GOROOT=/usr/local/go' | tee -a /etc/profile
:~# echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile</pre>
<p>Finally, refresh your bash profile.</p>
<pre>:~# source /etc/profile</pre>
<figure id="attachment_10976" aria-describedby="caption-attachment-10976" style="width: 961px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10976" src="https://www.osradar.com/wp-content/uploads/2019/02/4-10.png" alt="4.- Setting the environment variables" width="961" height="183" srcset="https://www.osradar.com/wp-content/uploads/2019/02/4-10.png 961w, https://www.osradar.com/wp-content/uploads/2019/02/4-10-300x57.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/4-10-768x146.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/4-10-696x133.png 696w" sizes="(max-width: 961px) 100vw, 961px" /><figcaption id="caption-attachment-10976" class="wp-caption-text">4.- Setting the environment variables</figcaption></figure>
<p>So, test GO.</p>
<h2>3.- Test the installation</h2>
<p>To verify that the installation has been correct, it is first necessary to show the version of GO. To do it, run this command:</p>
<pre>:~# go version
:~# go env</pre>
<figure id="attachment_10977" aria-describedby="caption-attachment-10977" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10977" src="https://www.osradar.com/wp-content/uploads/2019/02/5-12.png" alt="5.- Showing the GO version" width="1365" height="571" srcset="https://www.osradar.com/wp-content/uploads/2019/02/5-12.png 1365w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-300x125.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-768x321.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-1024x428.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-696x291.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-1068x447.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/5-12-1004x420.png 1004w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-10977" class="wp-caption-text">5.- Showing the GO version</figcaption></figure>
<p>However, the best way to check if your GO is correctly installed is to make a program and run it.</p>
<p>First, create a folder where the program will be located.</p>
<pre>:~# mkdir -p src/test
:~# cd src/test</pre>
<figure id="attachment_10978" aria-describedby="caption-attachment-10978" style="width: 855px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10978" src="https://www.osradar.com/wp-content/uploads/2019/02/6-11.png" alt="6.- Creating the folder" width="855" height="129" srcset="https://www.osradar.com/wp-content/uploads/2019/02/6-11.png 855w, https://www.osradar.com/wp-content/uploads/2019/02/6-11-300x45.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/6-11-768x116.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/6-11-696x105.png 696w" sizes="(max-width: 855px) 100vw, 855px" /><figcaption id="caption-attachment-10978" class="wp-caption-text">6.- Creating the folder</figcaption></figure>
<p>Next, create the file. I will name it test.go.</p>
<pre>:~# nano test.go</pre>
<p>And add the following:</p>
<pre>package main
import "fmt"
func main() {
    fmt.Printf("Hi, I am Angelo. Thanks for visit Osradar\n")
}</pre>
<figure id="attachment_10979" aria-describedby="caption-attachment-10979" style="width: 874px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10979" src="https://www.osradar.com/wp-content/uploads/2019/02/7-11.png" alt="7.- Creating a new file to test GO" width="874" height="199" srcset="https://www.osradar.com/wp-content/uploads/2019/02/7-11.png 874w, https://www.osradar.com/wp-content/uploads/2019/02/7-11-300x68.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/7-11-768x175.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/7-11-696x158.png 696w" sizes="(max-width: 874px) 100vw, 874px" /><figcaption id="caption-attachment-10979" class="wp-caption-text">7.- Creating a new file to test GO</figcaption></figure>
<p>Finally, run the file.</p>
<pre>:~# go run test.go</pre>
<figure id="attachment_10980" aria-describedby="caption-attachment-10980" style="width: 897px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-10980" src="https://www.osradar.com/wp-content/uploads/2019/02/8-12.png" alt="8.- GO is running properly" width="897" height="130" srcset="https://www.osradar.com/wp-content/uploads/2019/02/8-12.png 897w, https://www.osradar.com/wp-content/uploads/2019/02/8-12-300x43.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/8-12-768x111.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/8-12-696x101.png 696w" sizes="(max-width: 897px) 100vw, 897px" /><figcaption id="caption-attachment-10980" class="wp-caption-text">8.- GO is running properly</figcaption></figure>
<p>So, GO is ready for the action.</p>
<h2>Conclusion</h2>
<p>Learning to program using GO is a good idea these days. The project is quite mature and more and more people are interested in this language. Installing GO on CentOS 7 is not complicated at all.</p>
<p>Please share this post with your friends.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-go-language-on-centos-7/">Install GO language on CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-go-language-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install MyWebSQL on CentOS 7?</title>
		<link>https://www.osradar.com/install-mywebsql-on-centos-7/</link>
					<comments>https://www.osradar.com/install-mywebsql-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Sat, 13 Oct 2018 03:00:31 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[BD]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[mariadb]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=6341</guid>

					<description><![CDATA[<p>yu&#60;?2.In this article, I will show you how to install MyWebSQL on CentOS 7. The tutorial is simple to do, but first I&#8217;ll tell you a little about this tool. MySQL is an open-source relational database management system (RDBMS). It is very popular among developers for being free, easy to use and very secure. In [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-mywebsql-on-centos-7/">How to install MyWebSQL on CentOS 7?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>yu&lt;?2.In this article, I will show you how to install MyWebSQL on CentOS 7. The tutorial is simple to do, but first I&#8217;ll tell you a little about this tool.</p>
<p><a href="https://www.mysql.com">MySQL</a> is an open-source relational database management system (RDBMS). It is very popular among developers for being free, easy to use and very secure. In many cases, it is the entry point to other more robust applications such as<a href="https://www.oracle.com/database/index.html"> Oracle Database</a> or <a href="https://www.ibm.com/analytics/us/en/db2/">IBM DB2</a>.</p>
<figure id="attachment_6392" aria-describedby="caption-attachment-6392" style="width: 1080px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6392" src="https://www.osradar.com/wp-content/uploads/2018/10/33.jpg" alt="Mysql" width="1080" height="462" srcset="https://www.osradar.com/wp-content/uploads/2018/10/33.jpg 1080w, https://www.osradar.com/wp-content/uploads/2018/10/33-300x128.jpg 300w, https://www.osradar.com/wp-content/uploads/2018/10/33-768x329.jpg 768w, https://www.osradar.com/wp-content/uploads/2018/10/33-1024x438.jpg 1024w, https://www.osradar.com/wp-content/uploads/2018/10/33-696x298.jpg 696w, https://www.osradar.com/wp-content/uploads/2018/10/33-1068x457.jpg 1068w, https://www.osradar.com/wp-content/uploads/2018/10/33-982x420.jpg 982w" sizes="(max-width: 1080px) 100vw, 1080px" /><figcaption id="caption-attachment-6392" class="wp-caption-text">Mysql</figcaption></figure>
<p>At the same time, many people who start with MySQL don&#8217;t feel comfortable with the way they perform operations because everything is through CLI. With the aim of minimizing the difficulty to visualize data, create a database and perform more actions with MySQL using less time is that tools such as MyWebSQL emerge.</p>
<p><a href="https://mywebsql.net" rel="noopener">MyWebSQL</a> is an open source, web-based, <a href="https://en.wikipedia.org/wiki/WYSIWYG" rel="noopener">WYSIWYG</a> MySQL client written in PHP. It utilizes modern day technologies and browsers to provide a fast, intuitive querying and editing interface to the MySQL databases.</p>
<p>It was created with the following points in mind.</p>
<ul>
<li>Easy deployment and usage.</li>
<li>Fast querying and editing on MySQL databases.</li>
<li>Developer friendly to save time spent on queries and working with results.</li>
<li>Usable with all major browsers without any loss of functionality.</li>
</ul>
<p>As you can see, it is a software designed to save time with MySQL. Let&#8217;s install MyWebSQL on CentOS 7.</p>
<h2>0. Prerequisites</h2>
<p>The installation is really simple, however, you must take into account the following:</p>
<ul>
<li>MyWebSQL is also compatible with MariaDB which is a 100% MySQL compatible fork. It is the one I will use.</li>
<li>You have to install LAMP first. It is not difficult.</li>
<li>The commands must be executed as root user.</li>
<li>The packages <code>wget</code> and <code>unzip</code>, must be installed.</li>
</ul>
<p>Let&#8217;s get to work.</p>
<h2>1. Install Apache web server and PHP</h2>
<p>The first element that you need is Apache web server. To do this, run:</p>
<pre class="">:~$ su
:~# yum install httpd</pre>
<figure id="attachment_6365" aria-describedby="caption-attachment-6365" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6365" src="https://www.osradar.com/wp-content/uploads/2018/10/1-9.png" alt="1.- Installing Apache Web server" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/1-9.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/1-9-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/1-9-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/1-9-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/1-9-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/1-9-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/1-9-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6365" class="wp-caption-text">1.- Installing Apache Web server</figcaption></figure>
<p>Then, enable it and start it.</p>
<pre class="">:~# systemctl enable httpd
:~# systemctl start httpd</pre>
<figure id="attachment_6366" aria-describedby="caption-attachment-6366" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6366" src="https://www.osradar.com/wp-content/uploads/2018/10/2-9.png" alt="2.- Starting the httpd service" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/2-9.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/2-9-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/2-9-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/2-9-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/2-9-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/2-9-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/2-9-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6366" class="wp-caption-text">2.- Starting the httpd service</figcaption></figure>
<p>Then, set the Firewall rule:</p>
<pre class="">:~# firewall-cmd --zone=public --add-service=http --permanent
:~# firewall-cmd --reload</pre>
<figure id="attachment_6367" aria-describedby="caption-attachment-6367" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6367" src="https://www.osradar.com/wp-content/uploads/2018/10/3-10.png" alt="3.- Setting a Firewall rule to apache web server" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/3-10.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/3-10-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/3-10-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/3-10-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/3-10-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/3-10-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/3-10-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6367" class="wp-caption-text">3.- Setting a Firewall rule to apache web server</figcaption></figure>
<p>To check that the whole process has been successful, go to your web browser and go to http://IP_SERVER and if you see the following, then everything is fine.</p>
<figure id="attachment_6368" aria-describedby="caption-attachment-6368" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6368" src="https://www.osradar.com/wp-content/uploads/2018/10/4-6.png" alt="4.- Apache default page on CentOS 7" width="1366" height="665" srcset="https://www.osradar.com/wp-content/uploads/2018/10/4-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/4-6-300x146.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/4-6-768x374.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/4-6-1024x499.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/4-6-696x339.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/4-6-1068x520.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/4-6-863x420.png 863w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6368" class="wp-caption-text">4.- Apache default page on CentOS 7</figcaption></figure>
<p>Now is PHP&#8217;s turn.</p>
<pre class="">:~# yum install php php-mysql php-cli php-xml php-gd</pre>
<figure id="attachment_6369" aria-describedby="caption-attachment-6369" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6369" src="https://www.osradar.com/wp-content/uploads/2018/10/5-7.png" alt="5.- Installing PHP" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/5-7.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/5-7-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/5-7-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/5-7-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/5-7-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/5-7-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/5-7-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6369" class="wp-caption-text">5.- Installing PHP</figcaption></figure>
<p>Create a new file called <code>t.php</code> on <code>/var/www/html/</code></p>
<pre class="">:~# nano /var/www/html/t.php</pre>
<p>And put the following:</p>
<pre class="">&lt;?php
phpinfo();
?&gt;</pre>
<figure id="attachment_6370" aria-describedby="caption-attachment-6370" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6370" src="https://www.osradar.com/wp-content/uploads/2018/10/6-6.png" alt="6.- phpinfo method" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/6-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/6-6-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/6-6-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/6-6-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/6-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/6-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/6-6-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6370" class="wp-caption-text">6.- phpinfo method</figcaption></figure>
<p>Save and close the file.</p>
<p>Next, you have to restart apache service:</p>
<pre class="">:~# systemctl restart httpd</pre>
<p>Now, go to the web browser and try to go to http://IP_SERVER/t.php. If you see this, PHP is installed.</p>
<figure id="attachment_6372" aria-describedby="caption-attachment-6372" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6372" src="https://www.osradar.com/wp-content/uploads/2018/10/7-6.png" alt="7.- phpinfo() running" width="1366" height="665" srcset="https://www.osradar.com/wp-content/uploads/2018/10/7-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/7-6-300x146.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/7-6-768x374.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/7-6-1024x499.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/7-6-696x339.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/7-6-1068x520.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/7-6-863x420.png 863w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6372" class="wp-caption-text">7.- phpinfo() running</figcaption></figure>
<p>Note: If you want to install a more recent PHP version, I explained it <a href="https://www.osradar.com/how-to-install-php-7-on-centos-7-in-an-easy-way/" rel="noopener">here</a>.</p>
<h2>2. Install MariaDB</h2>
<p>Don&#8217;t be confused, <a href="https://mariadb.org/" rel="noopener">MariaDB</a> is a fork absolutely compatible with MySQL. In addition, it comes by default in the official CentOS 7 repositories. It currently has a great support and a very active community, so it is the best option.</p>
<p>To install MyWebSQL this step is vital.</p>
<pre class="">:~# yum install mariadb-server</pre>
<figure id="attachment_6373" aria-describedby="caption-attachment-6373" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6373" src="https://www.osradar.com/wp-content/uploads/2018/10/8-6.png" alt="8.- Installing MariaDB server" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/8-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/8-6-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/8-6-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/8-6-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/8-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/8-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/8-6-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6373" class="wp-caption-text">8.- Installing MariaDB server</figcaption></figure>
<p>Then, start and enable the service:</p>
<pre class="">:~# systemctl enable mariadb
:~# systemctl start mariadb</pre>
<figure id="attachment_6375" aria-describedby="caption-attachment-6375" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6375" src="https://www.osradar.com/wp-content/uploads/2018/10/9-6.png" alt="9.- Enabling the MariaDB service" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/9-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/9-6-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/9-6-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/9-6-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/9-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/9-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/9-6-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6375" class="wp-caption-text">9.- Enabling the MariaDB service</figcaption></figure>
<p>Now, configure MariaDB using the<code> mysql_secure_installation</code> script.</p>
<pre class="">:~# mysql_secure_installation</pre>
<p>First, log in without a password since it has not been defined and then create one. To the rest of the questions answer, as you want, I did so: Y, N, Y, Y.</p>
<figure id="attachment_6376" aria-describedby="caption-attachment-6376" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6376" src="https://www.osradar.com/wp-content/uploads/2018/10/10-5.png" alt="10.- Configuring MariaDB server thanks to mysql_secure_installation script" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/10-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/10-5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/10-5-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/10-5-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/10-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/10-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/10-5-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6376" class="wp-caption-text">10.- Configuring MariaDB server thanks to mysql_secure_installation script</figcaption></figure>
<h2>3. Install MyWebSQL</h2>
<p>The time has come to install MyWebSQL. First, you have to download it.</p>
<pre class="">:~# cd /opt/
:~# wget https://downloads.sourceforge.net/project/mywebsql/stable/mywebsql-3.7.zip</pre>
<figure id="attachment_6385" aria-describedby="caption-attachment-6385" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6385" src="https://www.osradar.com/wp-content/uploads/2018/10/11-5.png" alt="11.- Download and install MyWebSQL" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/11-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/11-5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/11-5-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/11-5-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/11-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/11-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/11-5-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6385" class="wp-caption-text">11.- Download and install MyWebSQL</figcaption></figure>
<p>The next step is to unzip it in the apache root directory, i.e. <code>/var/www/html</code>.</p>
<pre class="">:~# unzip mywebsql-3.7.zip -d /var/www/html/</pre>
<p>Restart Apache.</p>
<pre class="">:~# systemctl restart httpd</pre>
<p>And that&#8217;s it.</p>
<h2>4. Accessing to MyWebSQL</h2>
<p>After restarting Apache web server, you should be able to start the application. Open your web browser and go to <code>http://IP_SERVER/mywebsql</code>.</p>
<p>&nbsp;</p>
<figure id="attachment_6388" aria-describedby="caption-attachment-6388" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6388" src="https://www.osradar.com/wp-content/uploads/2018/10/12-4.png" alt="12.- MyWebSQL log in page" width="1366" height="665" srcset="https://www.osradar.com/wp-content/uploads/2018/10/12-4.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/12-4-300x146.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/12-4-768x374.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/12-4-1024x499.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/12-4-696x339.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/12-4-1068x520.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/12-4-863x420.png 863w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6388" class="wp-caption-text">12.- MyWebSQL log in page</figcaption></figure>
<p>In the place, the credentials of your server. Username and password. And then access.</p>
<figure id="attachment_6389" aria-describedby="caption-attachment-6389" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6389" src="https://www.osradar.com/wp-content/uploads/2018/10/13-2.png" alt="13.- MyWebSQL main page" width="1366" height="665" srcset="https://www.osradar.com/wp-content/uploads/2018/10/13-2.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/13-2-300x146.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/13-2-768x374.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/13-2-1024x499.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/13-2-696x339.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/13-2-1068x520.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/13-2-863x420.png 863w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6389" class="wp-caption-text">13.- MyWebSQL main page</figcaption></figure>
<p>As this is a newly created instance, there is not much information to show. However, I will show MySQL users.</p>
<figure id="attachment_6390" aria-describedby="caption-attachment-6390" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6390" src="https://www.osradar.com/wp-content/uploads/2018/10/14-1.png" alt="14.- Showing some information" width="1366" height="665" srcset="https://www.osradar.com/wp-content/uploads/2018/10/14-1.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/14-1-300x146.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/14-1-768x374.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/14-1-1024x499.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/14-1-696x339.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/14-1-1068x520.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/14-1-863x420.png 863w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6390" class="wp-caption-text">14.- Showing some information</figcaption></figure>
<h2>Conclusion</h2>
<p>To install MyWebSQL requires certain prerequisites, however, its installation is really simple. This application is very useful for those who use MySQL on a daily basis and need to see data graphically and easily.</p>
<p>We want to know your opinion, did you know about this application? Have you used them? How was your experience with it?</p>
<p>Please share this article through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-mywebsql-on-centos-7/">How to install MyWebSQL on CentOS 7?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-mywebsql-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to configure an Apache Virtual host on Debian 9?</title>
		<link>https://www.osradar.com/how-to-configure-an-apache-virtual-host-on-debian-9/</link>
					<comments>https://www.osradar.com/how-to-configure-an-apache-virtual-host-on-debian-9/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 13 Sep 2018 09:14:09 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[virtual hosts]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[webadmin]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=5712</guid>

					<description><![CDATA[<p>VirtualHost allows you to assign different websites across domains to the same IP address. They allow easy access to a PHP application hosted on an Apache web server through a simple domain. For this reason, is very used for web developers and system administrators. In this article, I will show you how to configure an Apache [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-an-apache-virtual-host-on-debian-9/">How to configure an Apache Virtual host on Debian 9?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>VirtualHost</strong> allows you to assign different websites across domains to the same IP address. They allow easy access to a PHP application hosted on an <a href="https://httpd.apache.org/">Apache web server</a> through a simple domain. For this reason, is very<strong> used for web developers and system administrators. </strong>In this article, I will show you how to configure an Apache virtual host on Debian 9.</p>
<h2>0.What you need</h2>
<p>Before you start, you must have certain requirements for everything to work perfectly.</p>
<ul>
<li>Have, at least, a notion of how to <strong>use the command line interface</strong>.</li>
<li>A user who can use sudo.</li>
<li><strong>A desire to learn</strong>. Vital to acquire the knowledge that I will give you.</li>
<li>A computer with Debian 9 installed. Obvious, isn&#8217;t it?</li>
</ul>
<h2>1. Install Apache web server</h2>
<p>Generally, before you start installing and configuring a system, it is a good idea to perform a general system upgrade. With this, you will obtain the last security patches.</p>
<p>Open a terminal and run on it:</p>
<pre class="">:~$ sudo apt update &amp;&amp; sudo apt upgrade</pre>
<p>After you enter your password, the update process will begin. As a result, you will have an updated and secure system.</p>
<figure id="attachment_5713" aria-describedby="caption-attachment-5713" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5713" src="https://www.osradar.com/wp-content/uploads/2018/09/1-5.png" alt="1.- Upgrading the system" width="1368" height="747" srcset="https://www.osradar.com/wp-content/uploads/2018/09/1-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/09/1-5-300x164.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/1-5-768x419.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/1-5-1024x559.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/1-5-696x380.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/1-5-1068x583.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/1-5-769x420.png 769w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5713" class="wp-caption-text">1.- Upgrading the system</figcaption></figure>
<p>Now, you can install apache2 from the official Ubuntu repositories. Run:</p>
<pre class="">:~$ sudo apt install apache2</pre>
<figure id="attachment_5715" aria-describedby="caption-attachment-5715" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5715" src="https://www.osradar.com/wp-content/uploads/2018/09/2-5.png" alt="2.- Installing apache2 web server" width="1368" height="747" srcset="https://www.osradar.com/wp-content/uploads/2018/09/2-5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/09/2-5-300x164.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/2-5-768x419.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/2-5-1024x559.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/2-5-696x380.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/2-5-1068x583.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/2-5-769x420.png 769w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5715" class="wp-caption-text">2.- Installing apache2 web server</figcaption></figure>
<p>As a result, you can now go to your browser and set the IP address of the server and you will see a page similar to this one. Open it.</p>
<p><strong>http://IP_server/</strong></p>
<figure id="attachment_5717" aria-describedby="caption-attachment-5717" style="width: 1365px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5717" src="https://www.osradar.com/wp-content/uploads/2018/09/3-5.png" alt="3.- Apache2 deafult page" width="1365" height="702" srcset="https://www.osradar.com/wp-content/uploads/2018/09/3-5.png 1365w, https://www.osradar.com/wp-content/uploads/2018/09/3-5-300x154.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/3-5-768x395.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/3-5-1024x527.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/3-5-696x358.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/3-5-1068x549.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/3-5-817x420.png 817w" sizes="(max-width: 1365px) 100vw, 1365px" /><figcaption id="caption-attachment-5717" class="wp-caption-text">3.- Apache2 default page</figcaption></figure>
<p>Good job. Apache is running smoothly on your computer.</p>
<h2>2.- Create web directory for each Apache virtual host</h2>
<p>In order to create a structure of efficient directories and that the Virtual hosts do not have problems, you must create a directory for each one of them. In this case, I will only create two virtual hosts. One called <strong>&#8220;osradar1.local&#8221;</strong> and other called <strong>&#8220;osradar2.local&#8221;</strong>.</p>
<p>Create the folders:</p>
<pre class="">:~$ sudo mkdir -p /var/www/html/osradar1.local/public_html
:~$ sudo mkdir -p /var/www/html/osradar1.local/public_html</pre>
<figure id="attachment_5718" aria-describedby="caption-attachment-5718" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5718" src="https://www.osradar.com/wp-content/uploads/2018/09/4-6.png" alt="4.- Creating the folders for virtual host" width="1368" height="747" srcset="https://www.osradar.com/wp-content/uploads/2018/09/4-6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/09/4-6-300x164.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/4-6-768x419.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/4-6-1024x559.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/4-6-696x380.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/4-6-1068x583.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/4-6-769x420.png 769w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5718" class="wp-caption-text">4.- Creating the folders for the virtual hosts</figcaption></figure>
<p>With this in mind proceeds to change the owner of them. Run,</p>
<pre class="">:~$ sudo chown -R $USER:$USER /var/www/html/osradar1.local/public_html
:~$ sudo chown -R $USER:$USER /var/www/html/osradar2.local/public_html</pre>
<figure id="attachment_5719" aria-describedby="caption-attachment-5719" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5719" src="https://www.osradar.com/wp-content/uploads/2018/09/5-5.png" alt="5.- Changing the folders owner" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/09/5-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/5-5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/5-5-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/5-5-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/5-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/5-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/5-5-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5719" class="wp-caption-text">5.- Changing the owner of the folders</figcaption></figure>
<p>Finally, change the permissions on the folders.</p>
<pre class="">:~$ sudo chmod -R 755 /var/www/html/</pre>
<figure id="attachment_5720" aria-describedby="caption-attachment-5720" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5720" src="https://www.osradar.com/wp-content/uploads/2018/09/6-5.png" alt="6.- Changing the permissions to the folders" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/09/6-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/6-5-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/6-5-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/6-5-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/6-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/6-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/6-5-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5720" class="wp-caption-text">6.- Changing the permissions to the folders</figcaption></figure>
<p>Now, create an example index.html file, to check the operation.</p>
<pre class="">:~$ sudo nano /var/www/html/osradar1.local/public_html/index.html
:~$ sudo nano /var/www/html/osradar2.local/public_html/index.html</pre>
<p>For the first hosts (osradar1.local) in index.html, type this:</p>
<pre class="">&lt;html&gt;
&lt;header&gt;
&lt;title&gt;
osradar1.local website
&lt;/title&gt;
&lt;/header&gt;
&lt;body&gt;
This message is from osradar1.local website
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>And for the second host:</p>
<pre class="">&lt;html&gt;
&lt;header&gt;
&lt;title&gt;
osradar2.local website
&lt;/title&gt;
&lt;/header&gt;
&lt;body&gt;
This message is from osradar2.local website
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>3.- Create the configuration file for each host</h2>
<p>In this step, you must create the configuration files for each virtual host, but it&#8217;s not complicated because you can rely on the default configuration file.</p>
<p>In the first place, copy the default configuration file, and rename it for each virtual host.</p>
<pre class="">:~$ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/osradar1.local.conf
:~$ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/osradar2.local.conf</pre>
<figure id="attachment_5721" aria-describedby="caption-attachment-5721" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5721" src="https://www.osradar.com/wp-content/uploads/2018/09/7-6.png" alt="7.- Copying the apache default configuration file" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/09/7-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/7-6-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/7-6-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/7-6-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/7-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/7-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/7-6-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5721" class="wp-caption-text">7.- Copying the apache default configuration file</figcaption></figure>
<p>Now, you must edit the files to adapt them to each virtual. For example, edit <code>osradar1.local.conf</code>.</p>
<pre class="">:~$ sudo nano /etc/apache2/sites-available/osradar1.local.conf</pre>
<p>In that file, you must modify ServerName, ServerAlias, ServerAdmin, and DocumentRoot.</p>
<figure id="attachment_5722" aria-describedby="caption-attachment-5722" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5722" src="https://www.osradar.com/wp-content/uploads/2018/09/8-4.png" alt="8.- Editing Virtual host configuration file" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/09/8-4.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/8-4-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/8-4-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/8-4-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/8-4-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/8-4-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/8-4-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5722" class="wp-caption-text">8.- Editing Virtual host configuration file</figcaption></figure>
<p>Do the same for the other virtual host.</p>
<figure id="attachment_5723" aria-describedby="caption-attachment-5723" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5723" src="https://www.osradar.com/wp-content/uploads/2018/09/9-3.png" alt="9.- Editing the second file" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/09/9-3.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/9-3-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/9-3-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/9-3-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/9-3-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/9-3-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/9-3-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5723" class="wp-caption-text">9.- Editing the second file</figcaption></figure>
<h2>4. Enabling configuration files</h2>
<p>Once the configuration files are ready, you must activate them. First, disable the default configuration file and then activate the newly created virtual hosts.</p>
<pre class="">:~$ sudo a2dissite 000-default.conf
:~$ sudo a2ensite osradar1.local.conf
:~$ sudo a2ensite osradar2.local.conf</pre>
<figure id="attachment_5724" aria-describedby="caption-attachment-5724" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5724" src="https://www.osradar.com/wp-content/uploads/2018/09/10-3.png" alt="10.- Enabling new configuration file for the virtual hosts" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/09/10-3.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/10-3-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/10-3-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/10-3-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/10-3-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/10-3-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/10-3-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5724" class="wp-caption-text">10.- Enabling new configuration file for the virtual hosts</figcaption></figure>
<p>And it&#8217;s ready. Now let&#8217;s check that everything was successful. Restart apache2.</p>
<pre class="">:~$ sudo systemctl restart apache2</pre>
<h2>5.- Test the virtual hosts</h2>
<p>In the first place, edit the file <code>/etc/hosts</code> and add your IP with the names of the virtual hosts.</p>
<pre class="">:~$ sudo nano /etc/hosts</pre>
<figure id="attachment_5726" aria-describedby="caption-attachment-5726" style="width: 573px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5726" src="https://www.osradar.com/wp-content/uploads/2018/09/11-2.png" alt="11.- Editing hosts file&lt;" width="573" height="153" srcset="https://www.osradar.com/wp-content/uploads/2018/09/11-2.png 573w, https://www.osradar.com/wp-content/uploads/2018/09/11-2-300x80.png 300w" sizes="(max-width: 573px) 100vw, 573px" /><figcaption id="caption-attachment-5726" class="wp-caption-text">11.- Editing hosts file</figcaption></figure>
<p>Now, go to your web browser and enter your virtual host.</p>
<figure id="attachment_5728" aria-describedby="caption-attachment-5728" style="width: 1131px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5728" src="https://www.osradar.com/wp-content/uploads/2018/09/12-2.png" alt="12.- Checking the virtual hosts" width="1131" height="437" srcset="https://www.osradar.com/wp-content/uploads/2018/09/12-2.png 1131w, https://www.osradar.com/wp-content/uploads/2018/09/12-2-300x116.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/12-2-768x297.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/12-2-1024x396.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/12-2-696x269.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/12-2-1068x413.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/12-2-1087x420.png 1087w" sizes="(max-width: 1131px) 100vw, 1131px" /><figcaption id="caption-attachment-5728" class="wp-caption-text">12.- Checking the virtual hosts</figcaption></figure>
<figure id="attachment_5729" aria-describedby="caption-attachment-5729" style="width: 890px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5729" src="https://www.osradar.com/wp-content/uploads/2018/09/13.png" alt="13.- Checking virtual hosts" width="890" height="417" srcset="https://www.osradar.com/wp-content/uploads/2018/09/13.png 890w, https://www.osradar.com/wp-content/uploads/2018/09/13-300x141.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/13-768x360.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/13-696x326.png 696w" sizes="(max-width: 890px) 100vw, 890px" /><figcaption id="caption-attachment-5729" class="wp-caption-text">13.- Checking virtual hosts</figcaption></figure>
<p>And this is it. As you can see it&#8217;s really simple.</p>
<p>Tell us, how was your experience with Apache?</p>
<p>Please spread this article through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-an-apache-virtual-host-on-debian-9/">How to configure an Apache Virtual host on Debian 9?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-configure-an-apache-virtual-host-on-debian-9/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
