<?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>MongoDB Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/mongodb/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/mongodb/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Fri, 05 Jan 2024 00:13:32 +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>MongoDB Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/mongodb/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Real-time Log Analysis and Visualization with Graylog</title>
		<link>https://serverstadium.com/knowledge-base/real-time-log-analysis-and-visualization-with-graylog/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 05 Jan 2024 00:13:32 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11871</guid>

					<description><![CDATA[<p>Introduction Implementing Graylog on ServerStadium’s infrastructure (VM Pricing, Dedicated Servers) offers an efficient way to handle log management. It is particularly useful for businesses looking to consolidate log data from various sources for real-time analysis and reporting. Prerequisites A ServerStadium VM or dedicated server (VM Pricing, Dedicated Servers) Basic knowledge of Linux server administration. MongoDB&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/real-time-log-analysis-and-visualization-with-graylog/">Real-time Log Analysis and Visualization with Graylog</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Introduction</h3>
<p>Implementing Graylog on ServerStadium’s infrastructure (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>) offers an efficient way to handle log management. It is particularly useful for businesses looking to consolidate log data from various sources for real-time analysis and reporting.</p>
<h3>Prerequisites</h3>
<ul>
<li>A ServerStadium VM or dedicated server (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>)</li>
<li>Basic knowledge of Linux server administration.</li>
<li>MongoDB and Elasticsearch installed on the server, as Graylog depends on these services.</li>
</ul>
<h3>Step 1: Set Up Your ServerStadium Environment</h3>
<ol>
<li><strong>Select a Server</strong>: Choose a ServerStadium server that can handle the storage and processing requirements of log data.</li>
<li><strong>Server Preparation</strong>:
<div class="shortcode-code">
<p> sudo apt update<br />
sudo apt upgrade </p></div></li>
</ol>
<h3>Step 2: Install MongoDB and Elasticsearch</h3>
<ol>
<li><strong>Install MongoDB</strong>:
<p>MongoDB is used by Graylog for metadata and configuration data:</p>
<div class="shortcode-code">
<p> sudo apt install -y mongodb </p></div></li>
<li><strong>Install Elasticsearch</strong>:
<p>Elasticsearch is used for log data storage and search:</p>
<div class="shortcode-code">
<p> wget -qO &#8211; https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add &#8211; sudo apt-get install apt-transport-https echo &quot;deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main&quot; | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list sudo apt update sudo apt install elasticsearch-oss </p></div>
<p>Configure and start Elasticsearch.</li>
</ol>
<h3>Step 3: Install and Configure Graylog</h3>
<ol>
<li><strong>Install Graylog</strong>:
<p>Add the Graylog repository and install Graylog:</p>
<div class="shortcode-code">
<p> wget https://packages.graylog2.org/repo/packages/graylog-4.0-repository_latest.deb sudo dpkg -i graylog-4.0-repository_latest.deb sudo apt update sudo apt install graylog-server </p></div></li>
<li><strong>Configure Graylog</strong>:
<p>Edit Graylog&#8217;s configuration file:</p>
<div class="shortcode-code">
<p> sudo nano /etc/graylog/server/server.conf </p></div>
<ul>
<li>Set the <code>password_secret</code> and <code>root_password_sha2</code>.</li>
<li>Configure <code>elasticsearch_hosts</code> to point to your Elasticsearch instance.</li>
<li>Set the web interface URL in <code>http_bind_address</code>.</li>
</ul>
</li>
<li><strong>Start Graylog</strong>:
<div class="shortcode-code">
<p> sudo systemctl start graylog-server </p></div></li>
</ol>
<h3>Step 4: Access Graylog Web Interface</h3>
<ol>
<li><strong>Access Graylog</strong>:
<p>Open a web browser and navigate to the configured web interface URL to access Graylog&#8217;s web interface.</li>
</ol>
<h3>Step 5: Configure Log Sources</h3>
<ol>
<li><strong>Set Up Log Sources</strong>:
<ul>
<li>In Graylog, set up log sources by configuring inputs corresponding to the type of log data you want to collect (e.g., Syslog, GELF).</li>
<li>Configure your servers or applications to forward logs to Graylog.</li>
</ul>
</li>
</ol>
<h3>Conclusion</h3>
<p>With Graylog deployed on your ServerStadium server, you gain valuable insights from log data in real-time. This enhances your ability to monitor, troubleshoot, and secure your infrastructure. For more advanced log analysis strategies, refer to our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">knowledge base</a> or contact our <a href="https://serverstadium.com/" target="_new" rel="noopener">support team</a>.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/real-time-log-analysis-and-visualization-with-graylog/">Real-time Log Analysis and Visualization with Graylog</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setting Up Wiki.js on ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/setting-up-wiki-js-on-serverstadium/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 06:00:47 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11828</guid>

					<description><![CDATA[<p>Introduction Wiki.js offers a sleek, user-friendly interface for creating and managing wikis and documentation. By setting up Wiki.js on ServerStadium&#8217;s infrastructure (VM Pricing, Dedicated Servers), you gain a powerful tool for collaborative content creation, whether for internal documentation, project wikis, or knowledge bases. Setting Up Wiki.js on ServerStadium Prerequisites A ServerStadium VM or dedicated server&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-wiki-js-on-serverstadium/">Setting Up Wiki.js on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Wiki.js offers a sleek, user-friendly interface for creating and managing wikis and documentation. By setting up Wiki.js on ServerStadium&#8217;s infrastructure (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>), you gain a powerful tool for collaborative content creation, whether for internal documentation, project wikis, or knowledge bases.</p>
<h2>Setting Up Wiki.js on ServerStadium</h2>
<h3>Prerequisites</h3>
<ul>
<li>A ServerStadium VM or dedicated server (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>).</li>
<li>Basic knowledge of Node.js and MongoDB, as Wiki.js is built on these technologies.</li>
</ul>
<h3>Step 1: Select and Prepare Your ServerStadium Server</h3>
<ol>
<li><strong>Choose a Server</strong>: Pick a ServerStadium server based on your expected traffic and data storage needs.</li>
<li><strong>Server Setup</strong>:
<div class="shortcode-code">
<p> sudo apt update<br />
sudo apt upgrade </p></div></li>
</ol>
<h3>Step 2: Install Node.js and MongoDB</h3>
<p>Wiki.js requires Node.js for its server-side logic and MongoDB as its database:</p>
<ol>
<li><strong>Install Node.js</strong>:
<div class="shortcode-code">
<p> curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash &#8211;<br />
sudo apt-get install -y nodejs </p></div></li>
<li><strong>Install MongoDB</strong>:
<div class="shortcode-code">
<p> sudo apt install -y mongodb </p></div>
<p>Start and enable MongoDB:</p>
<div class="shortcode-code">
<p> sudo systemctl start mongodb<br />
sudo systemctl enable mongodb </p></div></li>
</ol>
<h3>Step 3: Install and Configure Wiki.js</h3>
<ol>
<li><strong>Download Wiki.js</strong>:
<p>Visit the <a href="https://js.wiki/get-started" target="_new" rel="noopener">Wiki.js download page</a> to get the latest release. Use wget to download it directly to your server.</p>
<div class="shortcode-code">
<p> wget https://github.com/Requarks/wiki/releases/download/2.5.170/wiki-js.tar.gz<br />
mkdir wiki<br />
tar xzf wiki-js.tar.gz -C ./wiki </p></div></li>
<li><strong>Configure Wiki.js</strong>:
<p>Navigate to the Wiki.js directory and run the configuration wizard:</p>
<div class="shortcode-code">
<p> cd wiki<br />
node wiki configure </p></div>
<p>Follow the prompts to configure Wiki.js, including setting up the database and the initial admin account.</li>
</ol>
<h3>Step 4: Run Wiki.js</h3>
<ol>
<li><strong>Start Wiki.js</strong>:
<div class="shortcode-code">
<p> node server </p></div>
<p>This command starts Wiki.js on the default port (3000).</li>
</ol>
<h3>Step 5: Accessing Wiki.js</h3>
<ol>
<li><strong>Access Wiki.js</strong>:
<p>Navigate to <code>http://your_server_ip:3000</code> in your web browser to access your Wiki.js instance.</li>
<li><strong>Complete Setup</strong>:
<p>Finalize the setup through the web interface and start creating content.</li>
</ol>
<h3>Conclusion</h3>
<p>Your Wiki.js instance is now operational on ServerStadium, providing a modern platform for your documentation and wiki needs. For additional support, visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">knowledge base</a> or contact our support team.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-wiki-js-on-serverstadium/">Setting Up Wiki.js on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Database Optimization on ServerStadium Servers</title>
		<link>https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 04:16:18 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11787</guid>

					<description><![CDATA[<p>Introduction Optimizing database performance is key to maintaining fast and reliable data access, especially in high-demand environments. On ServerStadium servers, fine-tuning your database, whether it&#8217;s MySQL, PostgreSQL, or MongoDB, can lead to significantly improved performance. This guide offers tips and best practices for optimizing these popular database systems on ServerStadium&#8217;s infrastructure. Database Optimization on ServerStadium&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/">Database Optimization on ServerStadium Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Optimizing database performance is key to maintaining fast and reliable data access, especially in high-demand environments. On <a href="http://Https://ServerStadium">ServerStadium</a> servers, fine-tuning your database, whether it&#8217;s MySQL, PostgreSQL, or MongoDB, can lead to significantly improved performance. This guide offers tips and best practices for optimizing these popular database systems on ServerStadium&#8217;s infrastructure.</p>
<h2>Database Optimization on ServerStadium</h2>
<h3>Prerequisites</h3>
<ul>
<li>A ServerStadium VM or dedicated server (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>).</li>
<li>Basic knowledge of Linux and command-line interface.</li>
</ul>
<h3>General Optimization Tips</h3>
<p>Before diving into specific databases, here are some general optimization strategies:</p>
<ol>
<li><strong>Regular Maintenance</strong>: Regularly update and maintain your database software to the latest stable version.</li>
<li><strong>Monitor Performance</strong>: Utilize monitoring tools to track database performance and identify bottlenecks.</li>
<li><strong>Backup and Disaster Recovery</strong>: Regularly backup your databases and have a disaster recovery plan in place.</li>
</ol>
<h3>Optimizing MySQL on ServerStadium</h3>
<ol>
<li><strong>Tune Key Parameters</strong>: Adjust key settings in <code>my.cnf</code> like <code>innodb_buffer_pool_size</code>, <code>max_connections</code>, and <code>query_cache_size</code> based on your server&#8217;s resources and workload.</li>
<li><strong>Indexing</strong>: Properly index your tables to speed up query execution.</li>
<li><strong>Use EXPLAIN</strong>: Regularly use the <code>EXPLAIN</code> statement to analyze and optimize your SQL queries.</li>
<li><strong>Partitioning</strong>: Consider partitioning large tables to improve performance and management.</li>
</ol>
<h3>Optimizing PostgreSQL on ServerStadium</h3>
<ol>
<li><strong>Configuration Tuning</strong>: In <code>postgresql.conf</code>, tune parameters like <code>shared_buffers</code>, <code>work_mem</code>, <code>maintenance_work_mem</code>, and <code>effective_cache_size</code>.</li>
<li><strong>Vacuum and Analyze</strong>: Regularly run the <code>VACUUM</code> and <code>ANALYZE</code> commands to maintain database health.</li>
<li><strong>Index Maintenance</strong>: Use appropriate indexing strategies (B-tree, hash, GIN, etc.) for your queries and regularly monitor their performance.</li>
<li><strong>Connection Pooling</strong>: Use connection pooling to manage a large number of client connections efficiently.</li>
</ol>
<h3>Optimizing MongoDB on ServerStadium</h3>
<ol>
<li><strong>Sharding</strong>: Implement sharding to distribute data across multiple machines.</li>
<li><strong>Indexing</strong>: Proper indexing is crucial in MongoDB for query performance. Regularly review and optimize your indexes.</li>
<li><strong>Replication</strong>: Set up replication for data redundancy and high availability.</li>
<li><strong>Resource Allocation</strong>: Ensure that MongoDB has sufficient RAM and is configured to effectively use the available memory.</li>
</ol>
<h3>Conclusion</h3>
<p>Optimizing your database on ServerStadium servers can lead to significant performance improvements. By following these tips and regularly monitoring your database, you can ensure efficient, fast, and reliable data access.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/">Database Optimization on ServerStadium Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Building Your First Application with the MEAN Stack on ServerStadium VM Instances</title>
		<link>https://serverstadium.com/knowledge-base/building-mean-stack-app-serverstadium-vm-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 30 May 2023 21:16:55 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11690</guid>

					<description><![CDATA[<p>Once you have the MEAN Stack set up on your ServerStadium VM instance, you can start building your first application. This guide will walk you through the process of creating a simple application. Before we dive in, make sure you&#8217;ve followed our previous guide on Setting up a MEAN Stack on ServerStadium VM Instances. Step&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/building-mean-stack-app-serverstadium-vm-instances/">Building Your First Application with the MEAN Stack on ServerStadium VM Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Once you have the MEAN Stack set up on your ServerStadium VM instance, you can start building your first application. This guide will walk you through the process of creating a simple application.</p>
<p>Before we dive in, make sure you&#8217;ve followed our previous guide on <a href="https://serverstadium.com/knowledge-base/mean-stack-setup-serverstadium-vm-instances" target="_new" rel="noopener">Setting up a MEAN Stack on ServerStadium VM Instances</a>.</p>
<h2>Step 1: Create an Express.js Server</h2>
<p>Start by creating a new directory for your project and navigating into it:</p>
<pre><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">mkdir</span> mean-app
<span class="hljs-built_in">cd</span> mean-app
</code></pre>
<p>Initialize a new Node.js application:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">npm init -y
</code></pre>
</div>
<p>Install Express.js:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">npm install express
</code></pre>
</div>
<p>Create a new file named <code>server.js</code>:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">touch</span> server.js
</code></pre>
</div>
<p>Open <code>server.js</code> in your text editor and add the following code to create a basic Express.js server:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-javascript"><span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express'</span>);
<span class="hljs-keyword">const</span> app = <span class="hljs-title function_">express</span>();
<span class="hljs-keyword">const</span> port = <span class="hljs-number">3000</span>;

app.<span class="hljs-title function_">get</span>(<span class="hljs-string">'/'</span>, <span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  res.<span class="hljs-title function_">send</span>(<span class="hljs-string">'Hello World!'</span>);
});

app.<span class="hljs-title function_">listen</span>(port, <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">`Server is running at http://localhost:<span class="hljs-subst">${port}</span>`</span>);
});</code></pre>
<p>Run your server with <code>node server.js</code>. You should see &#8220;Server is running at http://localhost:3000&#8221; in your console. You can visit this URL in your browser to see your server in action.</p>
<h2>Step 2: Connect to MongoDB</h2>
<p>Install the MongoDB driver for Node.js:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">npm install mongodb
</code></pre>
</div>
<p>Update <code>server.js</code> to connect to your MongoDB database:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-javascript"><span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express'</span>);
<span class="hljs-keyword">const</span> mongodb = <span class="hljs-built_in">require</span>(<span class="hljs-string">'mongodb'</span>);
<span class="hljs-keyword">const</span> app = <span class="hljs-title function_">express</span>();
<span class="hljs-keyword">const</span> port = <span class="hljs-number">3000</span>;

mongodb.<span class="hljs-property">MongoClient</span>.<span class="hljs-title function_">connect</span>(<span class="hljs-string">'mongodb://localhost:27017'</span>, <span class="hljs-function">(<span class="hljs-params">err, client</span>) =&gt;</span> {
  <span class="hljs-keyword">if</span> (err) {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">error</span>(err);
    <span class="hljs-keyword">return</span>;
  }

  <span class="hljs-keyword">const</span> db = client.<span class="hljs-title function_">db</span>(<span class="hljs-string">'mydb'</span>);

  app.<span class="hljs-title function_">get</span>(<span class="hljs-string">'/'</span>, <span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
    res.<span class="hljs-title function_">send</span>(<span class="hljs-string">'Connected to MongoDB!'</span>);
  });

  app.<span class="hljs-title function_">listen</span>(port, <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">`Server is running at http://localhost:<span class="hljs-subst">${port}</span>`</span>);
  });
});
</code></pre>
</div>
<h2>Step 3: Create an Angular App</h2>
<p>Navigate to a different directory where you want to create your Angular app:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">cd</span> ..
ng new mean-angular-app
<span class="hljs-built_in">cd</span> mean-angular-app
</code></pre>
</div>
<p>Serve your Angular app:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">ng serve<br />
</code></div>
</div>
<p>You should see &#8220;Angular Live Development Server is listening on localhost:4200&#8221; in your console. You can visit this URL in your browser to see your Angular app.</p>
<h2>Step 4: Connect Angular to Express.js</h2>
<p>First, install the <code>http</code> package in your Angular app:</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">npm install @angular/common/http</code></pre>
<p>Update the <code>app.component.ts</code> file in your Angular app to make a GET request to your Express.js server</p>
<div class="bg-black rounded-md mb-4">
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-typescript"><span class="hljs-keyword">import</span> { <span class="hljs-title class_">HttpClient</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'@angular/common/http'</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">AppComponent</span> {
  title = <span class="hljs-string">'mean-angular-app'</span>;
  message = <span class="hljs-string">''</span>;

  <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-keyword">private</span> http: HttpClient</span>) {
    <span class="hljs-variable language_">this</span>.<span class="hljs-property">http</span>.<span class="hljs-title function_">get</span>(<span class="hljs-string">'http://localhost:3000'</span>).<span class="hljs-title function_">subscribe</span>(<span class="hljs-function">(<span class="hljs-params">data: <span class="hljs-built_in">any</span></span>) =&gt;</span> {
      <span class="hljs-variable language_">this</span>.<span class="hljs-property">message</span> = data;
    });
  }
}
</code></pre>
</div>
<p>Update the <code>app.component.html</code> file in your Angular app to display the message from your Express.js server:</p>
<pre class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-html"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>{{ message }}<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span></code></pre>
<h2>Conclusion</h2>
<p>Congratulations! You&#8217;ve just created your first MEAN Stack application on a ServerStadium VM instance. This guide only scratches the surface of what you can do with the MEAN Stack. To further your knowledge, explore our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> for more tutorials and guides.</p>
<p>Remember, our team at ServerStadium is always ready to assist you with your needs. Feel free to <a href="https://serverstadium.com/contact" target="_new" rel="noopener">reach out</a> to us if you have any questions or need further assistance.</p>
</div>
</div>
<p>The post <a href="https://serverstadium.com/knowledge-base/building-mean-stack-app-serverstadium-vm-instances/">Building Your First Application with the MEAN Stack on ServerStadium VM Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Step-by-Step MEAN Stack Setup on ServerStadium VM Instances</title>
		<link>https://serverstadium.com/knowledge-base/mean-stack-setup-serverstadium-vm-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 30 May 2023 21:02:29 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11688</guid>

					<description><![CDATA[<p>Setting up a MEAN Stack (MongoDB, Express.js, Angular, Node.js) can sometimes be complex, especially for newcomers. However, with ServerStadium&#8217;s VM 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&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/mean-stack-setup-serverstadium-vm-instances/">Step-by-Step MEAN Stack Setup on ServerStadium VM Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Setting up a MEAN Stack (MongoDB, Express.js, Angular, Node.js) can sometimes be complex, especially for newcomers. However, with ServerStadium&#8217;s VM 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/register-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 Cloud Dashboard.</p>
<h2 data-id="articleTOC_1">Step 2: Choose Your Cloud Instance</h2>
<p>From your Cloud Dashboard, go to the ‘Add VM’ section. Here, you’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 help you.</p>
<h2>Step 3: Install Node.js and NPM</h2>
<p>Node.js is a JavaScript runtime built on Chrome&#8217;s V8 JavaScript engine. It&#8217;s designed to build scalable network applications. Node.js uses an event-driven, non-blocking I/O model that is lightweight and efficient.</p>
<p>NPM (Node Package Manager) is the default package manager for Node.js. It&#8217;s used for installing, sharing, and distributing code, managing dependencies in your projects, and much more.</p>
<p>To install Node.js and NPM, you can 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 update</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt install nodejs npm<br />
</code></div>
</div>
<p>You can verify the installation with <code>nodejs -v</code> and <code>npm -v</code>.</p>
<h2>Step 4: Install MongoDB</h2>
<p>MongoDB is a source-available cross-platform document-oriented database program. It&#8217;s classified as a NoSQL database program, which means it doesn&#8217;t use the traditional tabular relational database structure. Instead, it uses JSON-like documents with optional schemas.</p>
<p>To install MongoDB, 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 install mongodb</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo systemctl status mongodb<br />
</code></div>
</div>
<p>The first command will install MongoDB, and the second will check the status of MongoDB to ensure it&#8217;s running correctly.</p>
<h2>Step 5: Install Express.js</h2>
<p>Express.js, or simply Express, is a web application framework for Node.js, designed for building web applications and APIs. It&#8217;s minimalistic and flexible and provides a robust set of features for web and mobile applications.</p>
<p>To install Express.js, you must create a project directory, navigate to it, and initialize a new Node.js application using NPM. After that, you can install Express.js:</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">mkdir</span></code><code class="!whitespace-pre hljs language-bash">myapp</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">cd</span> myapp</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">npm init</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">npm install express<br />
</code></div>
</div>
<h2>Step 6: Install Angular</h2>
<p>Angular is a platform for building web applications. It provides a way to create single-page applications requiring only HTML, CSS, and JavaScript on the client side.</p>
<p>To install Angular, you need to install Angular CLI (Command Line Interface), a command line tool used to scaffold and build Angular apps using node.js style (commonJs) modules. Not only does it provide you with scaffolding for your apps, but it also helps you manage your entire Angular project.</p>
<p>Install Angular CLI globally using NPM:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">npm install -g @angular/cli<br />
</code></div>
</div>
<p>You can verify the installation with <code>ng version</code>.</p>
<h2>Step 7: Create Your Application</h2>
<p>Now that your MEAN Stack is set up, you can start building your application. This involves creating an Express.js server, setting up routes for your application, connecting your application to your MongoDB database, and building your front-end with Angular.</p>
<p>If you&#8217;re new to the MEAN Stack, check out our introductory <a href="https://serverstadium.com/knowledge-base/mean-stack-intro" target="_new" rel="noopener">MEAN Stack tutorial</a> to get a detailed walk-through of how to create your first MEAN Stack application.</p>
<h2>Conclusion</h2>
<p>Congratulations! You now have a MEAN Stack set up in your ServerStadium VM instance! You&#8217;re ready to dive into web application development and harness the powerful capabilities of ServerStadium&#8217;s VM 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 support team.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/mean-stack-setup-serverstadium-vm-instances/">Step-by-Step MEAN Stack Setup on ServerStadium VM Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setting Up a MongoDB Database on ServerStadium Cloud Instances</title>
		<link>https://serverstadium.com/knowledge-base/setting-up-a-mongodb-database-on-serverstadium-cloud-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 May 2023 03:39:18 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11677</guid>

					<description><![CDATA[<p>MongoDB is a popular NoSQL database widely used in modern web applications. This tutorial will guide you through setting up a MongoDB database on 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 account&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-a-mongodb-database-on-serverstadium-cloud-instances/">Setting Up a MongoDB Database on ServerStadium Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>MongoDB is a popular NoSQL database widely used in modern web applications. This tutorial will guide you through setting up a MongoDB database on 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 MongoDB</h2>
<p>Log into your ServerStadium cloud instance and install MongoDB with 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">wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -<br />
</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">"deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse"</span> | sudo <span class="hljs-built_in">tee</span> /etc/apt/sources.list.d/mongodb-org-4.4.list</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt-get update</code></div>
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo apt-get install -y mongodb-org<br />
</code></div>
</div>
<p>These commands will add the MongoDB repository to your sources list, update your package list, and install MongoDB.</p>
<h2>Step 4: Start MongoDB Service</h2>
<p>Once MongoDB is installed, start the MongoDB service 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 systemctl start mongod<br />
</code></div>
</div>
<p>You can also set MongoDB to start automatically at boot with this 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 systemctl <span class="hljs-built_in">enable</span> mongod<br />
</code></div>
</div>
<h2>Step 5: Verify MongoDB Installation</h2>
<p>Verify that MongoDB is running correctly 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">mongo --<span class="hljs-built_in">eval</span> <span class="hljs-string">'db.runCommand({ connectionStatus: 1 })'</span><br />
</code></div>
</div>
<p>This command will return a status document that contains various information about the MongoDB connection.</p>
<h2>Conclusion</h2>
<p>Congratulations! You&#8217;ve successfully set up a MongoDB database on your ServerStadium cloud instance. You&#8217;re now ready to start building your MongoDB-based application.</p>
<p>Visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> for more tutorials and guides.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-a-mongodb-database-on-serverstadium-cloud-instances/">Setting Up a MongoDB Database on ServerStadium Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
