<?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>Apache Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/apache/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Mon, 31 Mar 2025 16:04:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>Apache Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/apache/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Hosting DokuWiki for Documentation on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/hosting-dokuwiki-documentation-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Mon, 31 Mar 2025 16:04:18 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12171</guid>

					<description><![CDATA[<p>Introduction This tutorial explains how to host DokuWiki – a lightweight, open-source wiki designed for documentation – on a ServerStadium dedicated server. With DokuWiki, you can easily manage and collaborate on documentation, and our high-performance dedicated servers provide a robust platform to support your wiki environment. Prerequisites Before you begin, ensure you have the following:&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/hosting-dokuwiki-documentation-dedicated-servers/">Hosting DokuWiki for Documentation on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This tutorial explains how to host DokuWiki – a lightweight, open-source wiki designed for documentation – on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. With DokuWiki, you can easily manage and collaborate on documentation, and our high-performance dedicated servers provide a robust platform to support your wiki environment.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
  
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> running Ubuntu (or a similar Linux distribution).</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>A working LAMP stack (Apache, MySQL/MariaDB, and PHP) or the ability to install these components.</li>
  
  
  <li>Familiarity with PHP and basic web server configuration.</li>
  
</ul>



<h2 class="wp-block-heading">Deployment Steps</h2>



<h3 class="wp-block-heading">1. Update Your System</h3>



<p class="wp-block-paragraph">Start by updating your system packages to ensure you have the latest updates and security patches:</p>


<pre><code>sudo apt-get update && sudo apt-get upgrade -y</code></pre>


<h3 class="wp-block-heading">2. Install Apache, PHP, and Other Dependencies</h3>



<p class="wp-block-paragraph">If not already installed, set up the LAMP stack. For example, to install Apache and PHP:</p>


<pre><code>sudo apt-get install apache2 php php-xml php-json -y</code></pre>


<h3 class="wp-block-heading">3. Download and Install DokuWiki</h3>



<p class="wp-block-paragraph">Navigate to your web root directory (e.g., <code>/var/www/html</code>) and download the latest stable version of DokuWiki:</p>


<pre><code>cd /var/www/html
wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz -O dokuwiki.tgz</code></pre>


<p class="wp-block-paragraph">Extract the archive and rename the directory:</p>


<pre><code>tar -xzvf dokuwiki.tgz
mv dokuwiki-* dokuwiki</code></pre>


<p class="wp-block-paragraph">Set proper permissions so that the web server can access the files:</p>


<pre><code>sudo chown -R www-data:www-data /var/www/html/dokuwiki</code></pre>


<h3 class="wp-block-heading">4. Configure Apache for DokuWiki</h3>



<p class="wp-block-paragraph">Create a new Apache virtual host configuration for DokuWiki:</p>


<pre><code>sudo nano /etc/apache2/sites-available/dokuwiki.conf</code></pre>


<p class="wp-block-paragraph">Add the following configuration (adjust <code>ServerName</code> and <code>DocumentRoot</code> as needed):</p>


<pre><code>&lt;VirtualHost *:80&gt;
    ServerAdmin admin@yourdomain.com
    ServerName yourdomain.com
    DocumentRoot /var/www/html/dokuwiki

    &lt;Directory /var/www/html/dokuwiki&gt;
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    &lt;/Directory&gt;

    ErrorLog ${APACHE_LOG_DIR}/dokuwiki_error.log
    CustomLog ${APACHE_LOG_DIR}/dokuwiki_access.log combined
&lt;/VirtualHost&gt;</code></pre>


<p class="wp-block-paragraph">Enable the new site and the Apache rewrite module, then reload Apache:</p>


<pre><code>sudo a2ensite dokuwiki.conf
sudo a2enmod rewrite
sudo systemctl reload apache2</code></pre>


<h3 class="wp-block-heading">5. Complete DokuWiki Setup</h3>



<p class="wp-block-paragraph">Open your web browser and navigate to <code>http://yourdomain.com</code> to access the DokuWiki setup page. Follow the on-screen instructions to complete the installation and initial configuration of your wiki.</p>



<h2 class="wp-block-heading">Post-Deployment Configuration</h2>



<p class="wp-block-paragraph">After installing DokuWiki, consider these enhancements to secure and optimize your documentation environment:</p>


<ul class="wp-block-list">
  
  <li>Configure SSL to secure your site using Let&#8217;s Encrypt or another certificate provider.</li>
  
  
  <li>Set up regular backups for your wiki data.</li>
  
  
  <li>Adjust DokuWiki settings and plugins to suit your documentation needs.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting your DokuWiki on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> ensures a high-performance, scalable environment for your documentation and collaboration needs.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Troubleshooting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>If you encounter issues during installation or configuration:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Review Apache error logs located in <code>/var/log/apache2/</code> for any errors related to DokuWiki.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Ensure file permissions and ownership are correctly set for the DokuWiki directory.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult the DokuWiki documentation for configuration tips and troubleshooting steps.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Refer to our guides in the <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium Knowledge Base</a> for further assistance.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting DokuWiki on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> provides a robust and scalable solution for managing your documentation. By following this guide, you can install and configure a secure DokuWiki environment that meets your collaboration and documentation needs. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium website</a>.</p>
<!-- /wp:paragraph -->
<p>The post <a href="https://serverstadium.com/knowledge-base/hosting-dokuwiki-documentation-dedicated-servers/">Hosting DokuWiki for Documentation on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setting Up an Apache Web Server on ServerStadium&#8217;s Cloud Instances</title>
		<link>https://serverstadium.com/knowledge-base/setting-up-an-apache-web-server-on-serverstadiums-cloud-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 May 2023 03:03:34 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11671</guid>

					<description><![CDATA[<p>Apache HTTP Server is one of the most popular web servers due to its power, flexibility, and support. This tutorial will guide you on how to set up an Apache web server on your ServerStadium cloud instance. Our Knowledge Base contains more tutorials and guides for your reference. Step 1: Register Your Account If you&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-an-apache-web-server-on-serverstadiums-cloud-instances/">Setting Up an Apache Web Server on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Apache HTTP Server is one of the most popular web servers due to its power, flexibility, and support. This tutorial will guide you on how to set up an Apache web server on your ServerStadium cloud instance.</p>
<p>Our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> contains more tutorials and guides for your reference.</p>
<h2>Step 1: Register Your Account</h2>
<p>If you haven&#8217;t done so already, register an account on our <a href="https://cp.serverstadium.com/regist-user" target="_new" rel="noopener">Registration Page</a>. After successfully creating your account, you&#8217;ll gain access to your personal <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">Cloud Dashboard</a>.</p>
<h2>Step 2: Add Your Cloud Instance</h2>
<p>From your <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">Cloud Dashboard</a>, click on the &#8216;Add VM&#8217; button. Here, you&#8217;ll find a variety of cloud instance options. Choose one that suits your needs and budget. For additional guidance, refer to our <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">Pricing Page</a>.</p>
<h2>Step 3: Install Apache</h2>
<p>Once your cloud instance is ready, connect to it via SSH and install Apache by running the following commands:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt update</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt install apache2<br />
</code></div>
</div>
<p>You can verify the successful installation of Apache by typing <code>apache2 -v</code> in your terminal, which should return the version of Apache installed.</p>
<h2>Step 4: Configure Your Apache Web Server</h2>
<p>Upon successful installation of Apache, your web server is almost ready. Apache&#8217;s default configuration file is located at <code>/etc/apache2/apache2.conf</code>. You can edit this file to customize your web server&#8217;s settings.</p>
<h2>Step 5: Test Your Web Server</h2>
<p>Finally, you can test your web server by opening your web browser and navigating to <code>http://your_server_IP_address</code>. You should see the Apache default welcome page, which confirms that your web server is working correctly.</p>
<h2>Conclusion</h2>
<p>Congratulations! You&#8217;ve successfully set up an Apache web server on your ServerStadium cloud instance. You&#8217;re now ready to host your own websites and web applications.</p>
<p>For more tutorials and guides, be sure to visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a>.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-an-apache-web-server-on-serverstadiums-cloud-instances/">Setting Up an Apache Web Server on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing Apache and Tomcat: A Quick Way</title>
		<link>https://serverstadium.com/knowledge-base/installing-apache-and-tomcat-a-quick-way/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 02 Oct 2020 08:47:52 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=410</guid>

					<description><![CDATA[<p>Apache is the most used web server in the world that provides such features as a variety of modules, good performance, and support with other popular software. Tomcat is a web server and container used to serve Java-based applications. In addition, Tomcat is an open-source implementation of the Java Servlet and JavaServer Pages technologies, released&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-apache-and-tomcat-a-quick-way/">Installing Apache and Tomcat: A Quick Way</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Apache is the most used web server in the world that provides such features as a variety of modules, good performance, and support with other popular software. Tomcat is a web server and container used to serve Java-based applications. In addition, Tomcat is an open-source implementation of the Java Servlet and JavaServer Pages technologies, released by the Apache Software Foundation.</p>



<p class="wp-block-paragraph">Here are the steps for installing and configuring Apache and Tomcat on the same server <a href="https://serverstadium.com/knowledge-base/deploying-a-virtual-machine-in-serverstadium/">in ServerStadium Virtual Machine</a>.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 1 &#8211; Installing Apache2</strong></h2>



<p class="wp-block-paragraph">First, update the Ubuntu repository with the command:</p>



<pre class="wp-block-code"><code># apt update</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="288" height="20" class="wp-image-413" src="https://serverstadium.com/wp-content/uploads/2020/09/001.png" alt="" /></figure>



<p class="wp-block-paragraph">Then, install the Apache2 package with the command :</p>



<pre class="wp-block-code"><code># apt install apache2</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="351" height="20" class="wp-image-414" src="https://serverstadium.com/wp-content/uploads/2020/09/002-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-2.png 351w, https://serverstadium.com/wp-content/uploads/2020/09/002-2-300x17.png 300w" sizes="(max-width: 351px) 100vw, 351px" /></figure>



<p class="wp-block-paragraph"><mark class="has-inline-color has-vivid-red-color" style="background-color: rgba(0, 0, 0, 0);">Don&#8217;t forget</mark> to add <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> to the Network Security Profile. For example, I&#8217;m allowing all IP Addresses to access <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> on this Virtual Machine.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1069" height="53" class="wp-image-420" src="https://serverstadium.com/wp-content/uploads/2020/09/003-6.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-6.png 1069w, https://serverstadium.com/wp-content/uploads/2020/09/003-6-300x15.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/003-6-1024x51.png 1024w, https://serverstadium.com/wp-content/uploads/2020/09/003-6-768x38.png 768w" sizes="(max-width: 1069px) 100vw, 1069px" /></figure>



<p class="wp-block-paragraph">After that, access the Virtual Machine Public IP Address with a web browser. If the installation succeeds, it should display the Apache2 Ubuntu Default Page, as shown below.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="812" height="300" class="wp-image-416" src="https://serverstadium.com/wp-content/uploads/2020/09/004-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/004-1.png 812w, https://serverstadium.com/wp-content/uploads/2020/09/004-1-300x111.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/004-1-768x284.png 768w" sizes="(max-width: 812px) 100vw, 812px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 2 &#8211; Installing Java</strong></h2>



<p class="wp-block-paragraph">Tomcat requires Java to be able to execute the Java application code. You can use OpenJDK or Oracle JDK as its base. In this guide, we&#8217;ll use OpenJDK as its&#8217; base.<br />To install OpenJDK on Ubuntu, type the command :</p>



<pre class="wp-block-code"><code># apt install default-jdk</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="379" height="21" class="wp-image-422" src="https://serverstadium.com/wp-content/uploads/2020/09/001-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001-1.png 379w, https://serverstadium.com/wp-content/uploads/2020/09/001-1-300x17.png 300w" sizes="(max-width: 379px) 100vw, 379px" /></figure>



<p class="wp-block-paragraph">After the installation process is finished, check your Java installation version with the command :</p>



<pre class="wp-block-code"><code># javac --version</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="324" height="36" class="wp-image-424" src="https://serverstadium.com/wp-content/uploads/2020/09/002-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-3.png 324w, https://serverstadium.com/wp-content/uploads/2020/09/002-3-300x33.png 300w" sizes="(max-width: 324px) 100vw, 324px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 3 &#8211; Create Tomcat User</strong></h2>



<p class="wp-block-paragraph">For security purposes, Tomcat should be running by a non-root user. First, create a <span class="has-inline-color has-vivid-cyan-blue-color">tomcat</span> group with the command :</p>



<pre class="wp-block-code"><code># groupadd tomcat</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="321" height="21" class="wp-image-449" src="https://serverstadium.com/wp-content/uploads/2020/09/001-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001-2.png 321w, https://serverstadium.com/wp-content/uploads/2020/09/001-2-300x20.png 300w" sizes="(max-width: 321px) 100vw, 321px" /></figure>



<p class="wp-block-paragraph">Next, create a Tomcat user. Make this user a member of the <span class="has-inline-color has-vivid-cyan-blue-color">tomcat</span> group with home directory <span class="has-inline-color has-vivid-cyan-blue-color">/opt/tomcat</span> with a shell <span class="has-inline-color has-vivid-cyan-blue-color">/bin/false</span> (so nobody can log in into the account).</p>



<pre class="wp-block-code"><code># useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="591" height="17" class="wp-image-450" src="https://serverstadium.com/wp-content/uploads/2020/09/002-4.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-4.png 591w, https://serverstadium.com/wp-content/uploads/2020/09/002-4-300x9.png 300w" sizes="(max-width: 591px) 100vw, 591px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 4 &#8211; Download and Install Tomcat</strong></h2>



<p class="wp-block-paragraph">Firstly, change to <span class="has-inline-color has-vivid-cyan-blue-color">/tmp</span> directory as a good place to download temporary files :</p>



<pre class="wp-block-code"><code># cd /tmp</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="268" height="20" class="wp-image-452" src="https://serverstadium.com/wp-content/uploads/2020/09/001-3.png" alt="" /></figure>



<p class="wp-block-paragraph">Second, Use the <span class="has-inline-color has-vivid-cyan-blue-color">curl</span> command to download a link copied from the Tomcat website (as this article was written, the last stable version is <strong>Tomcat 9</strong>) :</p>



<pre class="wp-block-code"><code># curl -O https://downloads.apache.org/tomcat/tomcat-9/v9.0.38/bin/apache-tomcat-9.0.38.tar.gz</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-453" src="https://serverstadium.com/wp-content/uploads/2020/09/002-5.png" alt="" /></figure>



<p class="wp-block-paragraph">Finally, install Tomcat to the /opt/tomcat directory. In doing so, create the directory and extract the archive with these commands:</p>



<pre class="wp-block-code"><code># mkdir /opt/tomcat
# tar xzvf apache-tomcat-9.0.38.tar.gz -C /opt/tomcat --strip-components=1</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="751" height="36" class="wp-image-455" src="https://serverstadium.com/wp-content/uploads/2020/09/oo3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/oo3.png 751w, https://serverstadium.com/wp-content/uploads/2020/09/oo3-300x14.png 300w" sizes="(max-width: 751px) 100vw, 751px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 5 &#8211; Permissions Setting</strong></h2>



<p class="wp-block-paragraph">Change the directory where we unpacked the Tomcat installation in the previous step (<span class="has-inline-color has-vivid-cyan-blue-color">/opt/tomcat</span>) with the command :</p>



<pre class="wp-block-code"><code># cd /opt/tomcat/</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="352" height="20" class="wp-image-456" src="https://serverstadium.com/wp-content/uploads/2020/09/001-4.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001-4.png 352w, https://serverstadium.com/wp-content/uploads/2020/09/001-4-300x17.png 300w" sizes="(max-width: 352px) 100vw, 352px" /></figure>



<p class="wp-block-paragraph">Give the tomcat group ownership over the installation directory:</p>



<pre class="wp-block-code"><code># chgrp -R tomcat /opt/tomcat</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="476" height="20" class="wp-image-457" src="https://serverstadium.com/wp-content/uploads/2020/09/002-6.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-6.png 476w, https://serverstadium.com/wp-content/uploads/2020/09/002-6-300x13.png 300w" sizes="(max-width: 476px) 100vw, 476px" /></figure>



<p class="wp-block-paragraph">And then, give the tomcat group read access to the conf directory and all of its contents and execute access to the directory itself with the command :</p>



<pre class="wp-block-code"><code># chmod -R g+r conf
# chmod g+x conf</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="409" height="34" class="wp-image-458" src="https://serverstadium.com/wp-content/uploads/2020/09/003-7.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-7.png 409w, https://serverstadium.com/wp-content/uploads/2020/09/003-7-300x25.png 300w" sizes="(max-width: 409px) 100vw, 409px" /></figure>



<p class="wp-block-paragraph">Make the tomcat user owner of the webapps, work, temp, and logs directories with the command:</p>



<pre class="wp-block-code"><code># chown -R tomcat webapps/ work/ temp/ logs/</code></pre>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 6 &#8211; Create a systemd Service File</strong></h2>



<p class="wp-block-paragraph">To create systemd service file for Tomcat, first, locate the JAVA_HOME location with the command :</p>



<pre class="wp-block-code"><code># update-java-alternatives -l</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="569" height="36" class="wp-image-459" src="https://serverstadium.com/wp-content/uploads/2020/09/001-5.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001-5.png 569w, https://serverstadium.com/wp-content/uploads/2020/09/001-5-300x19.png 300w" sizes="(max-width: 569px) 100vw, 569px" /></figure>



<p class="wp-block-paragraph">As we can see, the <span class="has-inline-color has-vivid-cyan-blue-color">JAVA_HOME location is at /usr/lib/jvm/java-1.11.0-openjdk-amd64</span> directory.</p>



<p class="wp-block-paragraph">Next, reload the systemd daemon so the systemd daemon can know the service file with the command :</p>



<pre class="wp-block-code"><code># systemctl daemon-reload</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="456" height="19" class="wp-image-474" src="https://serverstadium.com/wp-content/uploads/2020/09/004-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/004-2.png 456w, https://serverstadium.com/wp-content/uploads/2020/09/004-2-300x13.png 300w" sizes="(max-width: 456px) 100vw, 456px" /></figure>



<p class="wp-block-paragraph">After that, start the Tomcat service by typing the command :</p>



<pre class="wp-block-code"><code># systemctl start tomcat</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="444" height="16" class="wp-image-475" src="https://serverstadium.com/wp-content/uploads/2020/09/005-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/005-1.png 444w, https://serverstadium.com/wp-content/uploads/2020/09/005-1-300x11.png 300w" sizes="(max-width: 444px) 100vw, 444px" /></figure>



<p class="wp-block-paragraph">Make sure the service is running by typing the command :</p>



<pre class="wp-block-code"><code># systemctl status tomcat</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="636" height="76" class="wp-image-476" src="https://serverstadium.com/wp-content/uploads/2020/09/006-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/006-1.png 636w, https://serverstadium.com/wp-content/uploads/2020/09/006-1-300x36.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></figure>



<p class="wp-block-paragraph">And then, make Tomcat service automatically start at boot by typing the command :</p>



<pre class="wp-block-code"><code># systemctl enable tomcat</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="449" height="21" class="wp-image-477" src="https://serverstadium.com/wp-content/uploads/2020/09/007-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/007-1.png 449w, https://serverstadium.com/wp-content/uploads/2020/09/007-1-300x14.png 300w" sizes="(max-width: 449px) 100vw, 449px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 7 &#8211; Configure Tomcat Web Management</strong></h2>



<p class="wp-block-paragraph">Tomcat uses a web management interface to configure its settings. To begin with, we need to allow <span class="has-inline-color has-vivid-cyan-blue-color">port 8080</span> (Tomcat default port) on the firewall rule by typing the command:</p>



<pre class="wp-block-code"><code># ufw allow 8080</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="385" height="51" class="wp-image-478" src="https://serverstadium.com/wp-content/uploads/2020/09/001-6.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001-6.png 385w, https://serverstadium.com/wp-content/uploads/2020/09/001-6-300x40.png 300w" sizes="(max-width: 385px) 100vw, 385px" /></figure>



<p class="wp-block-paragraph">And then, add <span class="has-inline-color has-vivid-cyan-blue-color">port 8080</span> to the Network Security Profile :</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="968" height="94" class="wp-image-480" src="https://serverstadium.com/wp-content/uploads/2020/09/002-8.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-8.png 968w, https://serverstadium.com/wp-content/uploads/2020/09/002-8-300x29.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/002-8-768x75.png 768w" sizes="(max-width: 968px) 100vw, 968px" /></figure>



<p class="wp-block-paragraph">After that, add a user that can manage manager-gui and admin-gui by editing the file tomcat-users.xml.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="568" height="27" class="wp-image-481" src="https://serverstadium.com/wp-content/uploads/2020/09/003-8.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-8.png 568w, https://serverstadium.com/wp-content/uploads/2020/09/003-8-300x14.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></figure>



<p class="wp-block-paragraph">Add the user and password you want with role manager-gui and admin-gui.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="587" height="78" class="wp-image-482" src="https://serverstadium.com/wp-content/uploads/2020/09/004-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/004-3.png 587w, https://serverstadium.com/wp-content/uploads/2020/09/004-3-300x40.png 300w" sizes="(max-width: 587px) 100vw, 587px" /></figure>



<p class="wp-block-paragraph">Afterward, edit the two files below:</p>



<pre class="wp-block-code"><code>1. /opt/tomcat/webapps/manager/META-INF/context.xml
2. /opt/tomcat/webapps/host-manager/META-INF/context.xml</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="671" height="30" class="wp-image-485" src="https://serverstadium.com/wp-content/uploads/2020/09/005-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/005-2.png 671w, https://serverstadium.com/wp-content/uploads/2020/09/005-2-300x13.png 300w" sizes="(max-width: 671px) 100vw, 671px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="708" height="27" class="wp-image-486" src="https://serverstadium.com/wp-content/uploads/2020/09/006-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/006-2.png 708w, https://serverstadium.com/wp-content/uploads/2020/09/006-2-300x11.png 300w" sizes="(max-width: 708px) 100vw, 708px" /></figure>



<p class="wp-block-paragraph">Then, disable the allow IP Address section to allow any IP Address access to the Tomcat server.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="475" height="49" class="wp-image-487" src="https://serverstadium.com/wp-content/uploads/2020/09/007-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/007-2.png 475w, https://serverstadium.com/wp-content/uploads/2020/09/007-2-300x31.png 300w" sizes="(max-width: 475px) 100vw, 475px" /></figure>



<p class="wp-block-paragraph">After editing those files, restart the Tomcat service by typing the command :</p>



<pre class="wp-block-code"><code># systemctl restart tomcat</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="458" height="21" class="wp-image-488" src="https://serverstadium.com/wp-content/uploads/2020/09/008-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/008-1.png 458w, https://serverstadium.com/wp-content/uploads/2020/09/008-1-300x14.png 300w" sizes="(max-width: 458px) 100vw, 458px" /></figure>



<p class="wp-block-paragraph">Finally, access the Tomcat server using these formats :</p>



<pre class="wp-block-code"><code>http://YOUR_SERVER_IP_ADDRESS:8080</code></pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-492" src="https://serverstadium.com/wp-content/uploads/2020/09/image-57.png" alt="" width="834" height="327" srcset="https://serverstadium.com/wp-content/uploads/2020/09/image-57.png 1220w, https://serverstadium.com/wp-content/uploads/2020/09/image-57-300x118.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/image-57-1024x402.png 1024w, https://serverstadium.com/wp-content/uploads/2020/09/image-57-768x302.png 768w" sizes="(max-width: 834px) 100vw, 834px" /></figure>



<p class="wp-block-paragraph">Accordingly, our Tomcat server is already accessible from the outside network. After that, try to access the Manager App mode and enter the user credential we set before.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="637" height="179" class="wp-image-496" src="https://serverstadium.com/wp-content/uploads/2020/09/010-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/010-3.png 637w, https://serverstadium.com/wp-content/uploads/2020/09/010-3-300x84.png 300w" sizes="(max-width: 637px) 100vw, 637px" /></figure>



<p class="wp-block-paragraph">If the user credential entered is correct, the Tomcat Web Application Manager will show up.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-505" src="https://serverstadium.com/wp-content/uploads/2020/09/image-58.png" alt="" width="964" height="406" srcset="https://serverstadium.com/wp-content/uploads/2020/09/image-58.png 1901w, https://serverstadium.com/wp-content/uploads/2020/09/image-58-300x127.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/image-58-1024x432.png 1024w, https://serverstadium.com/wp-content/uploads/2020/09/image-58-768x324.png 768w, https://serverstadium.com/wp-content/uploads/2020/09/image-58-1536x648.png 1536w" sizes="(max-width: 964px) 100vw, 964px" /></figure>



<p class="wp-block-paragraph">At last, your installation of Tomcat is complete. Additionally, you are now free to deploy your own Java web applications.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Conclusion</strong></h2>



<p class="wp-block-paragraph">In conclusion, we have installed and configured Apache and Tomcat on the Ubuntu Virtual Machine ServerStadium environment to serve Java web applications.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-apache-and-tomcat-a-quick-way/">Installing Apache and Tomcat: A Quick Way</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing LAMP in Ubuntu</title>
		<link>https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 15 Sep 2020 07:14:56 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=188</guid>

					<description><![CDATA[<p>LAMP (Linux, Apache, MySQL, PHP) is a software stack that is quite popular for Ubuntu users to host dynamic websites and web applications written in PHP. To use LAMP properly, we must install Apache, MySQL, and PHP packages individually. Here are the steps for installing and configuring LAMP in the ServerStadium Virtual Machine that uses&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/">Installing LAMP in Ubuntu</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">LAMP (Linux, Apache, MySQL, PHP) is a software stack that is quite popular for Ubuntu users to host dynamic websites and web applications written in PHP.</p>



<p class="wp-block-paragraph">To use LAMP properly, we must install Apache, MySQL, and PHP packages individually. Here are the steps for installing and configuring LAMP in the ServerStadium Virtual Machine that uses the Ubuntu operating system.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 1 &#8211; Installing Apache2</strong></h2>



<p class="wp-block-paragraph">Apache2 is the most famous web server with the most users worldwide. Therefore, it still is a great choice for hosting a website.<br />To begin with, update the Ubuntu repository with the command :</p>



<pre class="wp-block-code"><code># apt update</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="313" height="20" class="wp-image-196" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2.png 313w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-300x19.png 300w" sizes="(max-width: 313px) 100vw, 313px" /></figure>



<p class="wp-block-paragraph">Then, install the Apache2 package with the command :</p>



<pre class="wp-block-code"><code># apt install apache2</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="489" height="21" class="wp-image-197" src="https://serverstadium.com/wp-content/uploads/2020/09/002_ver2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002_ver2.png 489w, https://serverstadium.com/wp-content/uploads/2020/09/002_ver2-300x13.png 300w" sizes="(max-width: 489px) 100vw, 489px" /></figure>



<p class="wp-block-paragraph"><mark class="has-inline-color has-vivid-red-color" style="background-color: rgba(0, 0, 0, 0);">Don&#8217;t forget</mark> to add <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> to the Network Security Profile. For example, I&#8217;m allowing all IP Addresses to access <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> on this Virtual Machine.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="780" height="78" class="wp-image-194" src="https://serverstadium.com/wp-content/uploads/2020/09/003-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-1.png 780w, https://serverstadium.com/wp-content/uploads/2020/09/003-1-300x30.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/003-1-768x77.png 768w" sizes="(max-width: 780px) 100vw, 780px" /></figure>



<p class="wp-block-paragraph">After that, access the Virtual Machine Public IP Address with a web browser. If the installation succeeds, it should display the Apache2 Ubuntu Default Page, as shown below.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="823" height="301" class="wp-image-207" src="https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4.png 823w, https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4-300x110.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4-768x281.png 768w" sizes="(max-width: 823px) 100vw, 823px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 2 &#8211; Installing MySQL</strong></h2>



<p class="wp-block-paragraph">If Apache2 is a web server, MySQL acts as RDBMS (Relational Database Management System) on LAMP. MySQL is a Database Management System that is quite popular for the PHP programming language.<br />To install MySQL on Ubuntu, type the command :</p>



<pre class="wp-block-code"><code># apt install mysql-server</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="540" height="22" class="wp-image-213" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1.png 540w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1-300x12.png 300w" sizes="(max-width: 540px) 100vw, 540px" /></figure>



<p class="wp-block-paragraph">After the installation process is complete, running a series of processes aimed at improving MySQL security is recommended. To run the process, type the command :</p>



<pre class="wp-block-code"><code># mysql_secure_installation</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="397" height="30" class="wp-image-216" src="https://serverstadium.com/wp-content/uploads/2020/09/002.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002.png 397w, https://serverstadium.com/wp-content/uploads/2020/09/002-300x23.png 300w" sizes="(max-width: 397px) 100vw, 397px" /></figure>



<p class="wp-block-paragraph">A new message will pop up; there is an option if you want to enable the &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">VALIDATE PASSWORD</span>&#8221; feature.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="487" height="164" class="wp-image-219" src="https://serverstadium.com/wp-content/uploads/2020/09/003-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-2.png 487w, https://serverstadium.com/wp-content/uploads/2020/09/003-2-300x101.png 300w" sizes="(max-width: 487px) 100vw, 487px" /></figure>



<p class="wp-block-paragraph">This tool checks the password strength and allows MySQL users to set only those passwords which are secure enough. There is 3 level :</p>



<pre class="wp-block-code"><code>- LOW --&gt; Length &gt;= 8
- MEDIUM --&gt; Length &gt;= 8, numeric, mixed case, and special characters
- STRONG --&gt; Length &gt;= 8, numeric, mixed case, special characters, and dictionary</code></pre>



<p class="wp-block-paragraph">Press y / Y if you want to use &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">VALIDATE PASSWORD</span>&#8221; or press n / N if you don&#8217;t want to use it.</p>



<p class="wp-block-paragraph">Set the <span class="has-inline-color has-vivid-cyan-blue-color">root</span> MySQL user password by filling in these prompts with your desired password.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="276" height="75" class="wp-image-220" src="https://serverstadium.com/wp-content/uploads/2020/09/004.png" alt="" /></figure>



<p class="wp-block-paragraph">Removing the &#8220;anonymous&#8221; MySQL users before moving into a production state is advised. Press y / Y to remove the &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">anonymous</span>&#8221; MySQL user on the next pop-up.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="478" height="131" class="wp-image-221" src="https://serverstadium.com/wp-content/uploads/2020/09/005.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/005.png 478w, https://serverstadium.com/wp-content/uploads/2020/09/005-300x82.png 300w" sizes="(max-width: 478px) 100vw, 478px" /></figure>



<p class="wp-block-paragraph">Then, to secure MySQL from a remote connection. Root login by remote access has to disable on the next pop-up.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="520" height="93" class="wp-image-222" src="https://serverstadium.com/wp-content/uploads/2020/09/006.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/006.png 520w, https://serverstadium.com/wp-content/uploads/2020/09/006-300x54.png 300w" sizes="(max-width: 520px) 100vw, 520px" /></figure>



<p class="wp-block-paragraph">Same with the anonymous MySQL user, it is advised to remove &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">test</span>&#8221; named database before moving into a production state. Press y / Y to remove &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">test</span>&#8221; named database on the next pop-up message.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="581" height="108" class="wp-image-223" src="https://serverstadium.com/wp-content/uploads/2020/09/007.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/007.png 581w, https://serverstadium.com/wp-content/uploads/2020/09/007-300x56.png 300w" sizes="(max-width: 581px) 100vw, 581px" /></figure>



<p class="wp-block-paragraph">Press y / Y to reload the privilege tables so the several configurations above will apply.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="512" height="71" class="wp-image-224" src="https://serverstadium.com/wp-content/uploads/2020/09/008.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/008.png 512w, https://serverstadium.com/wp-content/uploads/2020/09/008-300x42.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></figure>



<p class="wp-block-paragraph">To test the MySQL <span class="has-inline-color has-vivid-cyan-blue-color">root</span> user locally, test it by typing the command :</p>



<pre class="wp-block-code"><code># mysql -u root -p</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="333" height="22" class="wp-image-225" src="https://serverstadium.com/wp-content/uploads/2020/09/009.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/009.png 333w, https://serverstadium.com/wp-content/uploads/2020/09/009-300x20.png 300w" sizes="(max-width: 333px) 100vw, 333px" /></figure>



<p class="wp-block-paragraph">Then, fill in the password on the password prompt that appears.<br />The MySQL prompt will appear and be ready to use if the credential is correct.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="564" height="201" class="wp-image-226" src="https://serverstadium.com/wp-content/uploads/2020/09/010.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/010.png 564w, https://serverstadium.com/wp-content/uploads/2020/09/010-300x107.png 300w" sizes="(max-width: 564px) 100vw, 564px" /></figure>



<p class="wp-block-paragraph"><mark class="has-inline-color has-vivid-red-color" style="background-color: rgba(0, 0, 0, 0);">Remember</mark>, if you want to use the MySQL remote connection, add <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 3306</mark> to the Network Security Profile that the Virtual Machine uses.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="771" height="65" class="wp-image-227" src="https://serverstadium.com/wp-content/uploads/2020/09/011.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/011.png 771w, https://serverstadium.com/wp-content/uploads/2020/09/011-300x25.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/011-768x65.png 768w" sizes="(max-width: 771px) 100vw, 771px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 3 &#8211; Installing PHP</strong></h2>



<p class="wp-block-paragraph">We have Apache2 and MySQL installed as a part of the LAMP installation. PHP is needed in this 3rd step as a scripting language for LAMP. According to <a href="https://w3techs.com/technologies/details/pl-php" target="_blank" rel="noreferrer noopener">w3techs data</a>, PHP is used by <strong>78,9%</strong> of websites on the internet. This makes PHP a good choice for a server-side programming language for your website.</p>



<p class="wp-block-paragraph">Install PHP by typing the command :</p>



<pre class="wp-block-code"><code># apt install php php-mysql libapache2-mod-php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="601" height="18" class="wp-image-234" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2.png 601w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2-300x9.png 300w" sizes="(max-width: 601px) 100vw, 601px" /></figure>



<p class="wp-block-paragraph">Explanation :</p>



<pre class="wp-block-code"><code>- php : php core package
- php-mysql : PHP module that allows PHP to communicate with MySQL-based database
- libapache2-mod-php : PHP module that enable Apache2 to handle PHP files</code></pre>



<p class="wp-block-paragraph">After PHP is installed, you can check the PHP version by typing the command :</p>



<pre class="wp-block-code"><code># php -v</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="462" height="79" class="wp-image-237" src="https://serverstadium.com/wp-content/uploads/2020/09/002-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-1.png 462w, https://serverstadium.com/wp-content/uploads/2020/09/002-1-300x51.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></figure>



<p class="wp-block-paragraph">To test the PHP installation and see the installed PHP&#8217;s complete info, make a new PHP file on <span class="has-inline-color has-vivid-cyan-blue-color">/var/www/html</span> directory with any text editor and name it <span class="has-inline-color has-vivid-red-color">info.php</span>. The content of the info.php must be like below :</p>



<pre class="wp-block-code"><code>&lt;?php
        phpinfo();
?&gt;</code></pre>



<p class="wp-block-paragraph">Save the file, and then access it from the web browser by URL :</p>



<pre class="wp-block-code"><code>http://YOUR_VM_IP_ADDRESS/info.php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="947" height="678" class="wp-image-239" src="https://serverstadium.com/wp-content/uploads/2020/09/003-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-3.png 947w, https://serverstadium.com/wp-content/uploads/2020/09/003-3-300x215.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/003-3-768x550.png 768w" sizes="(max-width: 947px) 100vw, 947px" /></figure>



<p class="wp-block-paragraph">As we can see info.php file displayed complete information for PHP that was installed on the Ubuntu ServerStadium Virtual Machine.</p>



<p class="wp-block-paragraph">Congratulations! You have now configured a LAMP stack on Ubuntu ServerStadium Virtual Machine.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Conclusion</strong></h2>



<p class="wp-block-paragraph">In this guideline, we have installed and configured LAMP stack on the Ubuntu Virtual Machine ServerStadium environment for serving PHP websites and applications using Apache2 as a web server and MySQL as a database management system.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/">Installing LAMP in Ubuntu</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
