<?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>Webserver Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/category/webserver/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/category/webserver/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Fri, 28 Mar 2025 00:24:07 +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>Webserver Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/category/webserver/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 28 Mar 2025 00:24:04 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12153</guid>

					<description><![CDATA[<p>Introduction This guide provides step-by-step instructions to deploy a LEMP stack (Linux, Nginx, MySQL, and PHP) on Ubuntu 22.04 using a ServerStadium dedicated server. A LEMP stack is an ideal solution for hosting dynamic websites and web applications, delivering high performance and scalability. Prerequisites Before you begin, ensure you have the following: Deployment Steps 1.&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/">Deploying a LEMP Stack on Ubuntu 22.04 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 guide provides step-by-step instructions to deploy a LEMP stack (Linux, Nginx, MySQL, and PHP) on Ubuntu 22.04 using a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. A LEMP stack is an ideal solution for hosting dynamic websites and web applications, delivering high performance and scalability.</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 22.04.</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>An understanding of web server concepts.</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">First, update your system to ensure all packages are current:</p>


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


<h3 class="wp-block-heading">2. Install Nginx</h3>



<p class="wp-block-paragraph">Install the Nginx web server:</p>


<pre><code>sudo apt-get install nginx -y</code></pre>


<p class="wp-block-paragraph">After installation, start and enable Nginx:</p>


<pre><code>sudo systemctl start nginx
sudo systemctl enable nginx</code></pre>


<h3 class="wp-block-heading">3. Install MySQL</h3>



<p class="wp-block-paragraph">Install MySQL server for database management:</p>


<pre><code>sudo apt-get install mysql-server -y</code></pre>


<p class="wp-block-paragraph">Secure your MySQL installation:</p>


<pre><code>sudo mysql_secure_installation</code></pre>


<h3 class="wp-block-heading">4. Install PHP</h3>



<p class="wp-block-paragraph">Install PHP and the necessary modules to work with Nginx and MySQL:</p>


<pre><code>sudo apt-get install php-fpm php-mysql -y</code></pre>


<p class="wp-block-paragraph">Verify that PHP is installed by checking the version:</p>


<pre><code>php -v</code></pre>


<h3 class="wp-block-heading">5. Configure Nginx to Use PHP Processor</h3>



<p class="wp-block-paragraph">Edit the default Nginx server block to enable PHP processing. Open the configuration file:</p>


<pre><code>sudo nano /etc/nginx/sites-available/default</code></pre>


<p class="wp-block-paragraph">Modify the file to include the following configuration within the server block. Ensure the location for PHP files is set as shown:</p>


<pre><code>server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;
    index index.php index.html index.htm;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}</code></pre>


<p class="wp-block-paragraph">Save and exit the editor, then test the Nginx configuration for syntax errors:</p>


<pre><code>sudo nginx -t</code></pre>


<p class="wp-block-paragraph">If the test is successful, reload Nginx:</p>


<pre><code>sudo systemctl reload nginx</code></pre>


<h3 class="wp-block-heading">6. Verify Your LEMP Stack Installation</h3>



<p class="wp-block-paragraph">Create a PHP info file to confirm that PHP is processing correctly:</p>


<pre><code>sudo nano /var/www/html/info.php</code></pre>


<p class="wp-block-paragraph">Add the following content to the file:</p>


<pre><code>&lt;?php
phpinfo();
?&gt;</code></pre>


<p class="wp-block-paragraph">Save and exit, then open a web browser and navigate to <code>http://your_server_ip/info.php</code> to view the PHP info page.</p>



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



<p class="wp-block-paragraph">After deploying the LEMP stack, consider the following enhancements:</p>


<ul class="wp-block-list">
  
  <li>Secure your server by configuring UFW or another firewall to limit access.</li>
  
  
  <li>Optimize PHP and Nginx settings based on your application requirements.</li>
  
  
  <li>Set up regular backups and monitor server performance.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting your LEMP stack 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 you benefit from a high-performance, scalable environment for running your web applications.</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>Ensure all prerequisites are installed and updated.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Review configuration files for Nginx, PHP, and MySQL for any errors.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult the logs in <code>/var/log/nginx/</code>, <code>/var/log/mysql/</code>, and <code>/var/log/php/</code> for troubleshooting details.</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 additional support.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

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

<!-- wp:paragraph {"className":""} -->
<p>Deploying a LEMP stack on Ubuntu 22.04 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 foundation for hosting dynamic websites and applications. By following this guide, you ensure that your server is optimized for performance and security. 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/deploying-lemp-stack-ubuntu2204-dedicated-servers/">Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Monitoring and Optimizing Performance of Your ServerStadium Cloud Instances</title>
		<link>https://serverstadium.com/knowledge-base/monitoring-and-optimizing-performance-of-your-serverstadium-cloud-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 May 2023 03:24:43 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11675</guid>

					<description><![CDATA[<p>Keeping your cloud instance running smoothly and efficiently is crucial. This tutorial will guide you through the process of monitoring and optimizing the performance of your ServerStadium cloud instance. For more tutorials and guides, make sure to visit our Knowledge Base. Step 1: Register Your Account If you haven&#8217;t already, you&#8217;ll need to create an&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/monitoring-and-optimizing-performance-of-your-serverstadium-cloud-instances/">Monitoring and Optimizing Performance of Your ServerStadium Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Keeping your cloud instance running smoothly and efficiently is crucial. This tutorial will guide you through the process of monitoring and optimizing the performance of your ServerStadium cloud instance.</p>
<p>For more tutorials and guides, make sure to visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a>.</p>
<h2>Step 1: Register Your Account</h2>
<p>If you haven&#8217;t already, you&#8217;ll need to create an account on our <a href="https://cp.serverstadium.com/regist-user" target="_new" rel="noopener">Registration Page</a>. Once registered, you&#8217;ll have 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 the &#8216;Add VM&#8217; button. Choose a cloud instance that suits your needs and budget. For more detailed information about our offerings, you can visit our <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">Pricing Page</a>.</p>
<h2>Step 3: Install Monitoring Tools</h2>
<p>There are several monitoring tools available that can help you keep track of your cloud instance&#8217;s performance. One popular option is <code>htop</code>, which provides a real-time, interactive summary of your cloud instance&#8217;s performance. Install <code>htop</code> with the following command:</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 install htop<br />
</code></div>
</div>
<h2>Step 4: Understand Key Performance Metrics</h2>
<p><code>htop</code> Provides a wealth of information about your cloud instance&#8217;s performance. Here are a few key metrics to keep an eye on:</p>
<ul>
<li>CPU usage: High CPU usage could indicate that your cloud instance is under heavy load.</li>
<li>Memory usage: If your cloud instance is running out of memory, it may slow down.</li>
<li>Load average: The load average shows how many processes are waiting to run on the CPU.</li>
</ul>
<h2>Step 5: Optimize Performance</h2>
<p>Based on the information provided by <code>htop</code>, you can make adjustments to optimize the performance of your cloud instance. For example, you might need to stop unnecessary processes, add more memory, or upgrade to a cloud instance with more CPU power.</p>
<h2>Conclusion</h2>
<p>By monitoring and optimizing the performance of your ServerStadium cloud instance, you can ensure that it&#8217;s running smoothly and efficiently. For more tutorials and guides, 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/monitoring-and-optimizing-performance-of-your-serverstadium-cloud-instances/">Monitoring and Optimizing Performance of Your ServerStadium Cloud Instances</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>Setting Up a PostgreSQL Database on ServerStadium&#8217;s Cloud Instances</title>
		<link>https://serverstadium.com/knowledge-base/setting-up-a-postgresql-database-on-serverstadiums-cloud-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 May 2023 02:25:13 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11662</guid>

					<description><![CDATA[<p>PostgreSQL is a powerful, open-source relational database system. This tutorial will guide you through setting up a PostgreSQL database on your ServerStadium cloud instance. Explore our Knowledge Base for more tutorials and guides. Step 1: Register Your Account If you haven&#8217;t done so already, register an account on our Registration Page. After filling out your&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-a-postgresql-database-on-serverstadiums-cloud-instances/">Setting Up a PostgreSQL Database on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>PostgreSQL is a powerful, open-source relational database system. This tutorial will guide you through setting up a PostgreSQL database on your <strong>ServerStadium</strong> cloud instance.</p>
<p>Explore our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> for more tutorials and guides.</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 filling out your details and 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 range of cloud instance options. Select the one that suits your needs and budget. If you need help deciding, refer to our <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">Pricing Page</a> for more information.</p>
<h2>Step 3: Install PostgreSQL</h2>
<p>With your cloud instance ready, it&#8217;s time to install PostgreSQL. Connect to your instance via SSH and run the following commands:</p>
<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 postgresql postgresql-contrib</code></div>
<div>
<p>This will install PostgreSQL on your cloud instance. To verify the installation, type <code>psql --version</code>. You should see the version of PostgreSQL that&#8217;s been installed.</p>
<h2>Step 4: Create Your PostgreSQL Database</h2>
<p>Now that PostgreSQL is installed, you can create your database. To do this, you&#8217;ll need to switch to the PostgreSQL account on your instance:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo -i -u postgres<br />
</code></div>
</div>
<p>You can then access a PostgreSQL prompt using the <code>psql</code> command. From this prompt, you can create a database using the <code>CREATE DATABASE</code> command, like so:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">CREATE DATABASE mydatabase;<br />
</code></div>
</div>
<p>Replace &#8220;mydatabase&#8221; with the name of your database.</p>
<h2>Conclusion</h2>
<p>Congratulations! You now have a PostgreSQL database set up on your ServerStadium cloud instance. You&#8217;re ready to start managing your data and leveraging the powerful features of ServerStadium&#8217;s cloud instances.</p>
<p>Our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> is filled with other tutorials, guides, and tips. If you need any assistance, don&#8217;t hesitate to contact our support team.</p>
</div>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-a-postgresql-database-on-serverstadiums-cloud-instances/">Setting Up a PostgreSQL Database on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setting Up a Docker Environment on ServerStadium&#8217;s Cloud Instances</title>
		<link>https://serverstadium.com/knowledge-base/setting-up-a-docker-environment-on-serverstadiums-cloud-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 May 2023 02:21:12 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11660</guid>

					<description><![CDATA[<p>Docker is a popular platform that simplifies deploying applications inside containers. This tutorial will guide you through setting up a Docker environment on your ServerStadium cloud instance. Remember to visit our Knowledge Base for additional tutorials and guides. Step 1: Register Your Account First, you&#8217;ll need to register an account on our Registration Page. After&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-a-docker-environment-on-serverstadiums-cloud-instances/">Setting Up a Docker Environment on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Docker is a popular platform that simplifies deploying applications inside containers. This tutorial will guide you through setting up a Docker environment on your <strong>ServerStadium</strong> cloud instance.</p>
<p>Remember to visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> for additional tutorials and guides.</p>
<h2>Step 1: Register Your Account</h2>
<p>First, you&#8217;ll need to register an account on our <a href="https://cp.serverstadium.com/regist-user" target="_new" rel="noopener">Registration Page</a>. After filling out your details and 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: Choose Your Cloud Instance</h2>
<p>From your <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">Cloud Dashboard</a>, go to the &#8216;Add VM&#8217; section. Here, you&#8217;ll find a variety of cloud instance options. Select the one that suits your needs. If you need help deciding, our <a href="https://serverstadium.com/pricing" target="_new" rel="noopener">Instance Pricing Guide</a> can guide you.</p>
<h2>Step 3: Install Docker</h2>
<p>With your cloud instance ready, you can proceed to install Docker. Connect to your instance via SSH and run 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-get update<br />
</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release<br />
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg</code><code class="!whitespace-pre hljs language-bash"></code><code class="!whitespace-pre hljs language-bash"></code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">echo</span> \<br />
<span class="hljs-string">"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \<br />
<span class="hljs-subst">$(lsb_release -cs)</span> stable"</span> | sudo <span class="hljs-built_in">tee</span> /etc/apt/sources.list.d/docker.list &gt; /dev/null<br />
</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt-get update<br />
</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt-get install docker-ce docker-ce-cli containerd.io<br />
</code></div>
</div>
<p>This will install Docker on your cloud instance. To verify the installation, type <code>docker --version</code>. You should see the version of Docker that&#8217;s been installed.</p>
<h2>Step 4: Run Your First Docker Container</h2>
<p>Now that Docker is installed, you can run your first Docker container. Let&#8217;s run a simple &#8220;Hello World&#8221; application to test everything is working correctly:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo docker run hello-world<br />
</code></div>
</div>
<p>You should see a message indicating that your Docker installation is working correctly.</p>
<h2>Conclusion</h2>
<p>Congratulations! You now have a Docker environment set up on your ServerStadium cloud instance. You&#8217;re ready to start deploying applications in Docker containers and leveraging the powerful features of ServerStadium&#8217;s cloud instances.</p>
<p>Our <a href="https://serverstadium.com/pricing/">Knowledge Base</a> is always filled with other tutorials, guides, and tips. If you need any help, don&#8217;t hesitate to contact our <a href="https://serverstadium.com/contact-us/">support team</a>.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-a-docker-environment-on-serverstadiums-cloud-instances/">Setting Up a Docker Environment on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Set Up a Python Development Environment on ServerStadium&#8217;s Cloud Instances</title>
		<link>https://serverstadium.com/knowledge-base/how-to-set-up-a-python-development-environment-on-serverstadiums-cloud-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 May 2023 02:08:36 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11657</guid>

					<description><![CDATA[<p>Setting up a Python development environment can sometimes be complex, especially for newcomers. However, with ServerStadium&#8216;s cloud instances, the process is straightforward. In this tutorial, we&#8217;ll guide you step by step through the entire process. Before we get started, be sure to visit our comprehensive Knowledge Base for a wealth of other useful tutorials and&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-set-up-a-python-development-environment-on-serverstadiums-cloud-instances/">How to Set Up a Python Development Environment on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Setting up a Python development environment can sometimes be complex, especially for newcomers. However, with <strong>ServerStadium</strong>&#8216;s cloud instances, the process is straightforward. In this tutorial, we&#8217;ll guide you step by step through the entire process.</p>
<p>Before we get started, be sure to visit our comprehensive <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> for a wealth of other useful tutorials and guides.</p>
<h2>Step 1: Register Your Account</h2>
<p>To kick off, you&#8217;ll need to register an account on our <a href="https://cp.serverstadium.com/regist-user" target="_new" rel="noopener">Registration Page</a>. Fill out your details, and create your account. Following registration, 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: Choose Your Cloud Instance</h2>
<p>Once you&#8217;re on your <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">Cloud Dashboard</a>, head over to the &#8216;Cloud Instances&#8217; section. Here, you&#8217;ll find a variety of cloud instance options to choose from. Select the one that best suits your needs. If you need help deciding, our <a href="https://serverstadium.com/knowledge-base/instance-selection-guide" target="_new" rel="noopener">Instance Pricing Guide</a> can guide you.</p>
<h2>Step 3: Install Python</h2>
<p>With your cloud instance ready, it&#8217;s time to install Python. You can do this by connecting to your instance via SSH and executing 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<br />
sudo apt install python3<br />
</code></div>
</div>
<p>This will install Python 3 on your cloud instance. To verify the installation, type <code>python3 --version</code>. You should see the version of Python that&#8217;s been installed.</p>
<h2>Step 4: Install a Code Editor</h2>
<p>For Python development, you&#8217;ll need a code editor. We recommend Visual Studio Code, which you can install with the following command:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo snap install --classic code<br />
</code></div>
</div>
<h2>Step 5: Set Up a Virtual Environment</h2>
<p>One best practice when working with Python is setting up a virtual environment. This lets you manage packages for different projects separately. Here&#8217;s how to do it:</p>
<p>First, install the <code>venv</code> module:</p>
<div class="bg-black rounded-md mb-4">
<div class="flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt install python3-venv<br />
</code></div>
</div>
<p>Next, navigate to your project directory and create a new virtual environment:</p>
<div class="bg-black rounded-md mb-4">
<div class="flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md"></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">cd</span> /path/to/your/project<br />
python3 -m venv <span class="hljs-built_in">env</span><br />
</code></div>
</div>
<p>To activate the virtual environment, use:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">source</span> <span class="hljs-built_in">env</span>/bin/activate<br />
</code></div>
</div>
<h2>Step 6: Install the Necessary Python Packages</h2>
<p>With your virtual environment activated, you can now install the Python packages you need using <code>pip</code>, Python&#8217;s package manager. For instance, to install Flask, a popular web framework, use:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">pip install flask<br />
</code></div>
</div>
<h2>Conclusion</h2>
<p>Congratulations! You now have a Python development environment on your ServerStadium cloud instance! You&#8217;re ready to dive into Python coding and harness the powerful capabilities of ServerStadium&#8217;s cloud instances.</p>
<p>Remember, our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> is a treasure trove of tutorials, guides, and helpful tips. If you ever need assistance, don&#8217;t hesitate to contact our <a href="https://serverstadium.com/contact-us/">support team</a>.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-set-up-a-python-development-environment-on-serverstadiums-cloud-instances/">How to Set Up a Python Development Environment on ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing Python 3.7-3.9 on Ubuntu 22.04 Jammy LTS using PPA</title>
		<link>https://serverstadium.com/knowledge-base/installing-python-3-7-3-9-on-ubuntu-22-04-jammy-lts-using-ppa/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 13 Sep 2022 03:02:00 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=2142</guid>

					<description><![CDATA[<p>Canonical recently announced the general availability of Ubuntu 22.04 Jammy Jellyfish LTS on April 21, 2022. Jammy has Python 3.10 installed already. Indeed, you can install more versions via the upstream repository, but it only provides Python 2.7 and Python 3.10 modules. In this article, I will show you how to install Python 3.7 up&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-python-3-7-3-9-on-ubuntu-22-04-jammy-lts-using-ppa/">Installing Python 3.7-3.9 on Ubuntu 22.04 Jammy LTS using PPA</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Canonical recently announced the general availability of Ubuntu 22.04 Jammy Jellyfish LTS on <a href="https://lists.ubuntu.com/archives/ubuntu-announce/2022-April/000279.html" target="_blank" rel="noreferrer noopener nofollow">April 21, 2022</a>. Jammy has Python 3.10 installed already. Indeed, you can install more versions via the upstream repository, but it only provides Python 2.7 and Python 3.10 modules. In this article, I will show you how to install Python 3.7 up to 3.9</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">TLDR</h2>



<pre class="wp-block-code"><code>sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install python3.8</code></pre>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Installing Python</h2>



<p class="wp-block-paragraph">First of all, you&#8217;ll need the following package installed so we can import any PPA (Personal Package Archive) repositories:</p>



<pre class="wp-block-code"><code>sudo apt install software-properties-common -y</code></pre>



<p class="wp-block-paragraph">Then, we will import <a href="https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa" target="_blank" rel="noreferrer noopener nofollow">deadsnake&#8217;s PPA</a>:</p>



<pre class="wp-block-code"><code>sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update</code></pre>



<p class="wp-block-paragraph">You can then install previous Python versions, for example, Python 3.7:</p>



<pre class="wp-block-code"><code>sudo apt install python3.7</code></pre>



<p class="wp-block-paragraph">The maintainer of the PPA informs that they only ship Python 3.7 as the lowest version for Jammy, so if you wish to install the older version, you might want to install it for source.</p>



<pre class="wp-block-code"><code>Supported Ubuntu and Python Versions
====================================

- Ubuntu 18.04 (bionic) Python2.3 - Python 2.6, Python 3.1 - Python 3.5, Python3.7 - Python3.11
- Ubuntu 20.04 (focal) Python3.5 - Python3.7, Python3.9 - Python3.11
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.</code></pre>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Install PIP</h2>



<p class="wp-block-paragraph">The previous python installation does not provide <code>pip</code> by default, so you will have to do:</p>



<pre class="wp-block-code"><code>python3.x -m ensurepip --upgrade</code></pre>



<p class="wp-block-paragraph">Then verify it using</p>



<pre class="wp-block-code"><code>pip --version</code></pre>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Important Thing to Note</h2>



<p class="wp-block-paragraph">Never change the default Python version of Ubuntu, as it will break many things. Either by changing <code>python3</code> symlink or using <code>update-alternatives</code> command.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">To summarize the article, it is easy to install previous versions of Python on Ubuntu 22.04 Jammy LTS thanks to deadsnake team&#8217;s PPA. Hopefully, you find this tutorial article helpful for your present and upcoming projects.</p>



<p class="wp-block-paragraph">For more articles and tutorials about technology, please visit ServerStadium&#8217;s <strong><a href="https://serverstadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener">Knowledge Base</a> </strong></p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-python-3-7-3-9-on-ubuntu-22-04-jammy-lts-using-ppa/">Installing Python 3.7-3.9 on Ubuntu 22.04 Jammy LTS using PPA</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Reverse Proxy management using Nginx Proxy Manager</title>
		<link>https://serverstadium.com/knowledge-base/reverse-proxy-management-using-nginx-proxy-manager/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Mon, 27 Dec 2021 07:24:00 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1719</guid>

					<description><![CDATA[<p>Managing proxy hosts can be tedious sometimes. Thanks to its user-friendly web interface, Nginx Proxy Manager allows you to manage your proxy hosts easily and swiftly. However, NPM (Nginx Proxy Manager) currently does not support Load Balancing configuration. But, for basic proxying use cases, this is more than enough! So, let&#8217;s jump on to it,&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/reverse-proxy-management-using-nginx-proxy-manager/">Reverse Proxy management using Nginx Proxy Manager</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Managing proxy hosts can be tedious sometimes. Thanks to its user-friendly web interface, Nginx Proxy Manager allows you to manage your proxy hosts easily and swiftly.</p>



<p class="wp-block-paragraph">However, NPM (Nginx Proxy Manager) currently does not support Load Balancing configuration. But, for basic proxying use cases, this is more than enough! So, let&#8217;s jump on to it, shall we?</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">TLDR Guide</h2>



<ol class="wp-block-list">
<li>Install <code>docker-ce</code> and <code>docker-compose</code></li>
<li>Create new folder <code>npm</code> or <code>nginxproxymanager</code> or anything else.</li>
<li>Save these lines as <code>docker-compose.yaml</code> in the folder</li>
</ol>



<pre class="wp-block-code"><code>version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt</code></pre>



<ol class="wp-block-list" start="4">
<li>Run the stack</li>
</ol>



<pre class="wp-block-code"><code>docker-compose up -d</code></pre>



<ol class="wp-block-list" start="5">
<li>Access the admin UI via <code>http://YOUR-IP:81</code> . Remember, it&#8217;s PORT 81.</li>
<li>Default credentials</li>
</ol>



<pre class="wp-block-code"><code>Email:    admin@example.com
Password: changeme</code></pre>



<ol class="wp-block-list" start="7">
<li>Change the default login.</li>
<li>Enjoy!</li>
</ol>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Prerequisites</h2>



<ol class="wp-block-list">
<li>Port 80, 81, and 443 are allowed on Firewall and Security Profile.</li>
<li>A domain name, at least.</li>
</ol>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Installation Steps</h2>



<p class="wp-block-paragraph">This installation guide would be OS-agnostic as this will run on any system with docker installed.</p>



<p class="wp-block-paragraph">Assuming that <code>docker-ce</code> and <code>docker-compose</code> has been installed on your server. (Otherwise, check out <a href="https://serverstadium.com/knowledge-base/how-to-deploy-portainer/">this article</a> and see only the docker installation part)</p>



<p class="wp-block-paragraph">First, create a docker network with any name you wish:</p>



<pre class="wp-block-code"><code>docker network create proxy_network</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="719" height="91" class="wp-image-1721" src="https://serverstadium.com/wp-content/uploads/2021/12/image.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/12/image.png 719w, https://serverstadium.com/wp-content/uploads/2021/12/image-300x38.png 300w" sizes="(max-width: 719px) 100vw, 719px" />
<figcaption>Create docker network</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Create a folder wherever you like and give it a name:</p>



<pre class="wp-block-code"><code>mkdir /opt/nginx_proxy
cd /opt/nginx_proxy</code></pre>



<p class="wp-block-paragraph">Then, save the following configuration as <code>docker-compose.yaml</code> :</p>



<pre class="wp-block-code"><code>version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

networks:
  default:
    external:
      name: proxy_network</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" class="wp-image-1722" src="https://serverstadium.com/wp-content/uploads/2021/12/image-1.png" alt="" />
<figcaption>Stack configuration</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">It&#8217;s a very basic configuration that will use SQLite as the database. So, if you wish to use MySQL/MariaDB instead, please use the following, and change the appropriate values:</p>



<pre class="wp-block-code"><code>version: "3"
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      # These ports are in format &lt;host-port&gt;:&lt;container-port&gt;
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db

  db:
    image: 'jc21/mariadb-aria:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/mysql</code></pre>



<p class="wp-block-paragraph">Then, bring up the stack:</p>



<pre class="wp-block-code"><code>docker-compose up -d</code></pre>



<p class="wp-block-paragraph">Lastly, wait until the process is done.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" class="wp-image-1724" src="https://serverstadium.com/wp-content/uploads/2021/12/image-3.png" alt="" />
<figcaption>NPM is up and running</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Your NPM (Nginx Proxy Manager) should be accessible via <code>http://YOUR_IP:81</code></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" class="wp-image-1725" src="https://serverstadium.com/wp-content/uploads/2021/12/image-4.png" alt="" width="623" height="430" srcset="https://serverstadium.com/wp-content/uploads/2021/12/image-4.png 830w, https://serverstadium.com/wp-content/uploads/2021/12/image-4-300x207.png 300w, https://serverstadium.com/wp-content/uploads/2021/12/image-4-768x530.png 768w" sizes="(max-width: 623px) 100vw, 623px" />
<figcaption>NPM login page</figcaption>
</figure>
</div>


<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Initial Setup</h2>



<p class="wp-block-paragraph">On the login page, enter the default NPM credentials as follows:</p>



<pre class="wp-block-code"><code>Email:    admin@example.com
Password: changeme</code></pre>



<p class="wp-block-paragraph">After successfully logging in, a dialog box will show up, and it will let you change the default credentials.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" class="wp-image-1726" src="https://serverstadium.com/wp-content/uploads/2021/12/image-5.png" alt="" />
<figcaption>Change email address</figcaption>
</figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="493" height="403" class="wp-image-1727" src="https://serverstadium.com/wp-content/uploads/2021/12/image-6.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/12/image-6.png 493w, https://serverstadium.com/wp-content/uploads/2021/12/image-6-300x245.png 300w" sizes="(max-width: 493px) 100vw, 493px" />
<figcaption>Change default password</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Now, NPM is ready! Yay~</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-1728" src="https://serverstadium.com/wp-content/uploads/2021/12/image-7.png" alt="" width="541" height="371" />
<figcaption>Nginx Proxy Manager dashboard</figcaption>
</figure>
</div>


<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Adding your first proxy host</h2>



<p class="wp-block-paragraph">NPM offers four types of proxy passes. Basic proxy pass called Proxy Hosts, redirection hosts, proxy streaming, and 404 hosts. This article will only cover the Proxy Hosts section, and I leave it to you to discover the rest 😉</p>



<p class="wp-block-paragraph">For your very first proxy host configuration, why don&#8217;t you proxy the NPM dashboard? Accessing it directly via IP: port is ugly! Now, let&#8217;s create it!</p>



<p class="wp-block-paragraph">First, ensure you already create an A record for your domain/subdomain that points to this server via your DNS manager. How to do it depends on your registrar/domain name provider.</p>



<p class="wp-block-paragraph">On the dashboard, click on the Proxy Hosts button. It should show something like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="683" height="307" class="wp-image-1729" src="https://serverstadium.com/wp-content/uploads/2021/12/image-8.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/12/image-8.png 683w, https://serverstadium.com/wp-content/uploads/2021/12/image-8-300x135.png 300w" sizes="(max-width: 683px) 100vw, 683px" />
<figcaption>Add new proxy host</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Click Add Proxy Host. And then, fill in the required fields as follows:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" class="wp-image-1730" src="https://serverstadium.com/wp-content/uploads/2021/12/image-9.png" alt="" /></figure>
</div>


<p class="wp-block-paragraph">The proxy host is on the same machine, so I prefer to put its private IP. Putting the public IP will work too. Make sure the forwarded port is 81. You can also cache assets, enable WebSockets support, and block common exploits. Here, I will enable the Block Common Exploits.</p>



<p class="wp-block-paragraph">Move to the SSL tab; unless you&#8217;re using Cloudflare SSL (automatically provided by default), you can use LetsEncrypt to generate a valid SSL certificate. And do not forget to enable the options you want.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>If you&#8217;re using Cloudflare, do not enable Force SSL option as it will result in redirection loop.</p>
</blockquote>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="477" height="532" class="wp-image-1731" src="https://serverstadium.com/wp-content/uploads/2021/12/image-10.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/12/image-10.png 477w, https://serverstadium.com/wp-content/uploads/2021/12/image-10-269x300.png 269w" sizes="(max-width: 477px) 100vw, 477px" /></figure>
</div>


<p class="wp-block-paragraph">Finally, click Save. Your Proxy Hosts page should now list your very first proxy host.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-1732" src="https://serverstadium.com/wp-content/uploads/2021/12/image-11.png" alt="" width="679" height="134" srcset="https://serverstadium.com/wp-content/uploads/2021/12/image-11.png 905w, https://serverstadium.com/wp-content/uploads/2021/12/image-11-300x59.png 300w, https://serverstadium.com/wp-content/uploads/2021/12/image-11-768x152.png 768w" sizes="(max-width: 679px) 100vw, 679px" /></figure>
</div>


<p class="wp-block-paragraph">Now, the moment of truth. Try to access the URL:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-1733" src="https://serverstadium.com/wp-content/uploads/2021/12/image-12.png" alt="" width="654" height="430" srcset="https://serverstadium.com/wp-content/uploads/2021/12/image-12.png 872w, https://serverstadium.com/wp-content/uploads/2021/12/image-12-300x197.png 300w, https://serverstadium.com/wp-content/uploads/2021/12/image-12-768x505.png 768w" sizes="(max-width: 654px) 100vw, 654px" />
<figcaption>It works!</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Hooray, it is working.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">That&#8217;s way too easy, right? Now, you can deploy your own Nginx Proxy Manager using docker-compose and manage your proxy hosts using a simple user interface.</p>



<p class="wp-block-paragraph">For more IT knowledge, you can access it freely in ServerStadium&#8217;s knowledge<a href="https://serverstadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener"> base. </a>Or, for real exciting experience, you can also <a href="https://cp.serverstadium.com/regist-user" target="_blank" rel="noreferrer noopener">sign up</a> in ServerStadium and find out what you can do in our dashboard.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/reverse-proxy-management-using-nginx-proxy-manager/">Reverse Proxy management using Nginx Proxy Manager</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Install and Configure Squid Proxy in Ubuntu</title>
		<link>https://serverstadium.com/knowledge-base/installing-and-configuring-squid-proxy-in-ubuntu/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 02 Oct 2020 08:48:13 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=437</guid>

					<description><![CDATA[<p>Squid is a full-featured web proxy cache server application that provides proxy and cache services for HTTP, FTP, and other popular network protocols that you can easily install in Ubuntu. This guide will show you how to create your own HTTP proxy using Squid, a highly customizable proxy/cache application, in Ubuntu 18.04 VM Instance in&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-and-configuring-squid-proxy-in-ubuntu/">Install and Configure Squid Proxy in Ubuntu</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="has-text-align-justify wp-block-paragraph">Squid is a full-featured web proxy cache server application that provides proxy and cache services for HTTP, FTP, and other popular network protocols that you can easily install in Ubuntu.</p>



<p class="wp-block-paragraph">This guide will show you how to create your own HTTP proxy using Squid, a highly customizable proxy/cache application, in Ubuntu 18.04 <a href="https://serverstadium.com/knowledge-base/deploying-a-virtual-machine-in-serverstadium/">VM Instance in ServerStadium</a>.</p>



<p class="has-text-align-justify wp-block-paragraph">An HTTP proxy acts as an intermediary between you and the internet. While connected to your Squid HTTP proxy, you will be able to:</p>



<ul class="wp-block-list">
<li>Anonymously access internet services.</li>
<li>Bypass certain regional and local network restrictions.</li>
</ul>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Installing Squid</h2>



<p class="has-text-align-justify wp-block-paragraph">First, make sure the server is up to date by running the following commands as sudo user:</p>



<pre class="wp-block-code"><code>$ sudo apt update &amp;&amp; sudo apt upgrade</code></pre>



<p class="has-text-align-justify wp-block-paragraph">After you ensure your system is up to date, continue with the Squid Installation.</p>



<pre class="wp-block-code"><code>$ sudo apt install squid</code></pre>



<p class="wp-block-paragraph">Then check the installation by using the following command; if the installation succeeded, it will produce this following output:</p>



<pre class="wp-block-code"><code>$ sudo systemctl status squid

Output:
● squid.service - LSB: Squid HTTP Proxy version 3.x
   Loaded: loaded (/etc/init.d/squid; generated)
   Active: active (running) since Thu 2020-09-17 12:06:07 UTC; 4min 46s ago
     Docs: man:systemd-sysv-generator(8)
.....</code></pre>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Configuring Firewalls</h2>



<p class="has-text-align-justify wp-block-paragraph">We should ensure that our Ubuntu VM Instance Squid Port (TCP Port 3128) is not blocked by ServerStadium Security Profile and UFW Firewall.</p>



<p class="wp-block-paragraph">To modify ServerStadium Cloud Security Profile, open the ServerStadium Cloud panel and navigate to <em><strong>Networking Sidemenu -&gt; Security Profile</strong></em>. Then, edit or create a new Security Profile.<br />Add a new Firewall Rule on the Security Profile page that opens TCP port 3128. Then apply the security profile.</p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="505" height="415" data-id="439" class="wp-image-439" src="https://serverstadium.com/wp-content/uploads/2020/09/CP_AddRule.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/CP_AddRule.png 505w, https://serverstadium.com/wp-content/uploads/2020/09/CP_AddRule-300x247.png 300w" sizes="(max-width: 505px) 100vw, 505px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1919" height="495" data-id="444" class="wp-image-444" src="https://serverstadium.com/wp-content/uploads/2020/09/CP_Firewall-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/CP_Firewall-1.png 1919w, https://serverstadium.com/wp-content/uploads/2020/09/CP_Firewall-1-300x77.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/CP_Firewall-1-1024x264.png 1024w, https://serverstadium.com/wp-content/uploads/2020/09/CP_Firewall-1-768x198.png 768w, https://serverstadium.com/wp-content/uploads/2020/09/CP_Firewall-1-1536x396.png 1536w" sizes="(max-width: 1919px) 100vw, 1919px" /></figure>
</figure>



<p class="wp-block-paragraph">We also need to ensure Inbound TCP port is allowed in Ubuntu UFW. To do this, run the following command in the Ubuntu VM we installed with Squid server.</p>



<pre class="wp-block-code"><code>$ sudo ufw allow 'Squid'</code></pre>



<p class="wp-block-paragraph">To verify the firewall status, type the following command and the output will be shown below</p>



<pre class="wp-block-code"><code>$ sudo ufw status

Output:
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere                  
Squid                      ALLOW       Anywhere                  
OpenSSH (v6)               ALLOW       Anywhere (v6)             
Squid (v6)                 ALLOW       Anywhere (v6) </code></pre>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Configuring Squid</h2>



<p class="wp-block-paragraph">Now that Squid is installed on our ServerStadium Cloud Ubuntu VM, we can configure it to accept connections and serve as an HTTP proxy.</p>



<p class="wp-block-paragraph">Squid can be configured by editing the <code>/etc/squid/squid.conf</code> file. You can also use separate files with configuration options which can be included using the “include” directive.</p>



<p class="wp-block-paragraph">The configuration file contains comments that describe what each configuration option does.</p>



<p class="wp-block-paragraph">Before making any changes, it is a good practice to back up the original configuration file by running the following commands:</p>



<pre class="wp-block-code"><code>$ sudo cp /etc/squid/squid.conf{,.orginal}</code></pre>



<p class="wp-block-paragraph">Edit the file by opening it using nano (or another text editor):</p>



<pre class="wp-block-code"><code>$ sudo nano /etc/squid/squid.conf</code></pre>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Configuring Client Access via IP ACL</h2>



<p class="wp-block-paragraph">In Squid, you can control how the clients can access the web resources using the Access Control Lists (ACLs).</p>



<p class="wp-block-paragraph">By default, Squid allows access only from the localhost.</p>



<p class="wp-block-paragraph">If all the clients using the proxy have a static IP address, you can create an ACL that includes the allowed IPs.</p>



<p class="wp-block-paragraph">Instead of adding the IP addresses in the main configuration file, we will create a new dedicated file that will hold the IPs:</p>



<pre class="wp-block-code"><code>$ sudo nano /etc/squid/allowSourceIP.txt

192.168.33.1
# All other allowed IPs</code></pre>



<p class="wp-block-paragraph">Once done, open the main configuration file and create a new ACL named <code>allowSourceIP</code> (first highlighted line) and allow access to that ACL using the <code>http_access</code> directive (second highlighted line):</p>



<pre class="wp-block-code"><code># ...
acl allowSourceIP  src "/etc/squid/allowSourceIP.txt"
http_access allow localhost
 #Allow access from localhost
http_access allow allowSourceIP #Allow access from IP List

# And finally deny all other access to this proxy
http_access deny all</code></pre>



<p class="wp-block-paragraph">The <code>http_access</code> directive works similarly to the firewall rules. Squid reads the rules from top to bottom, and when a rule matches, the rules below are not processed.</p>



<p class="wp-block-paragraph">Since the order of <code>http_access</code> rules are important. Make sure you add the line before <code>http_access deny all</code>.</p>



<p class="wp-block-paragraph">Please keep mindful that whenever you make changes to the config file, you need to restart the Squid service with the following command:</p>



<pre class="wp-block-code"><code>$ sudo systemctl restart squid</code></pre>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Configuring Client Access via Basic Authentication</h2>



<p class="wp-block-paragraph">Besides limiting access via IP, we can also configure Squid HTTP proxy via basic HTTP authentication.</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ol class="wp-block-list">
<li>Install htpasswd by installing the Apache utility programs. If you have installed Apache on your Cloudraya Ubuntu VM, you will already have it and can skip this step.</li>
</ol>



<pre class="wp-block-code"><code>$ sudo apt-get install apache2-utils</code></pre>



<p class="wp-block-paragraph">2. Create a file to store Squid users and passwords:</p>



<pre class="wp-block-code"><code>$ sudo touch /etc/squid/squid_usr</code></pre>



<p class="wp-block-paragraph">3. Change ownership of the password file:</p>



<pre class="wp-block-code"><code>$ sudo chown proxy /etc/squid/squid_usr</code></pre>



<p class="wp-block-paragraph">4. Check the location of the <code>ncsa_auth</code> file:</p>



<pre class="wp-block-code"><code>$ sudo dpkg -L squid | grep ncsa_auth</code></pre>



<p class="wp-block-paragraph">5. Edit the Squid configuration file (<code>/etc/squid/squid.conf</code>) and add the following lines at the beginning of the file. Make sure that you update <code>/usr/lib/squid/basic_ncsa_auth</code> below with the location of the <code>ncsa_auth</code> file that you checked in the previous step:</p>
</div></div>



<pre class="wp-block-code"><code>auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/squid_passwd
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users</code></pre>



<p class="wp-block-paragraph">Once you’ve saved and exited the file, complete user removal by restarting Squid:</p>



<pre class="wp-block-code"><code>$ sudo systemctl restart squid</code></pre>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Blocking access to restricted domain</h2>



<p class="wp-block-paragraph">One of the features of Squid proxy server is blocking websites for the client that connects to our Squid Proxy server. It can be done using <code>forbidden dstdomain</code> keyword in <strong>ACL</strong> directive.</p>



<p class="wp-block-paragraph">First, we need to create the file. Then add domain names that we need to restrict:</p>



<pre class="wp-block-code"><code>$ sudo nano /etc/squid/forbidden_domains.txt

Contains:
.facebook.com
.twitter.com
.tiktok.com</code></pre>



<p class="wp-block-paragraph">After we create the list of domains in a text file, we modify the Squid configuration file as follows:</p>



<pre class="wp-block-code"><code># ...
acl allowSourceIP src "/etc/squid/allowSourceIP.txt"

#Add a new ACL directive
acl forbidden dstdomain "/etc/squid/forbidden_domains" 

http_access allow localhost
 #Allow access from localhost
http_access allow allowSourceIP #Allow access from IP List
#Add the restricted server in the deny list
http_access deny forbidden

# And finally deny all other access to this proxy
http_access deny all</code></pre>



<p class="wp-block-paragraph">After that, don&#8217;t forget to restart the Squid service to apply the changes</p>



<pre class="wp-block-code"><code>$ sudo systemctl restart squid</code></pre>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Anonymizing Traffic</h2>



<p class="wp-block-paragraph">We also can anonymize clients that connect to our Squid proxy. Thus, IP address of the clients that connects to our Squid proxy will not be forwarded to servers that receive traffic from our Squid Proxy.</p>



<p class="wp-block-paragraph">This is done via the rules below. Add the following lines at the beginning of the Squid configuration file:</p>



<pre class="wp-block-code"><code>forwarded_for off
request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all</code></pre>



<p class="wp-block-paragraph">After that, close the config file and restart your Squid proxy.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Connecting to your Squid Proxy</h2>



<p class="wp-block-paragraph">Your Squid Proxy Server is now ready, Congratulations!</p>



<p class="wp-block-paragraph">You can configure your local browser or operating system’s network settings to use your ServerStadium VM as an HTTP proxy. The settings to do this will vary depending on your OS and browser.</p>



<p class="wp-block-paragraph">You may find several official articles below to configure your Client OS or Browser to connect to the Squid Proxy:</p>



<ul class="wp-block-list">
<li><a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/configure-proxy-internet">Configure Proxy on Windows</a></li>
<li><a href="https://support.apple.com/en-in/guide/mac-help/mchlp2591/mac">Proxy Server Settings on macOS</a></li>
<li><a href="https://support.mozilla.org/en-US/kb/connection-settings-firefox">Connection Settings in Firefox</a></li>
</ul>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-and-configuring-squid-proxy-in-ubuntu/">Install and Configure Squid Proxy in Ubuntu</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 loading="lazy" 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 loading="lazy" 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 loading="lazy" 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>
	</channel>
</rss>
