<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ugacomp Technologies</title>
    <description>The latest articles on DEV Community by Ugacomp Technologies (@ugacomp).</description>
    <link>https://dev.to/ugacomp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1409744%2Fade313fb-3d43-4c11-945d-609acd491359.png</url>
      <title>DEV Community: Ugacomp Technologies</title>
      <link>https://dev.to/ugacomp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ugacomp"/>
    <language>en</language>
    <item>
      <title>How to install Ant Media Server on Ubuntu</title>
      <dc:creator>Ugacomp Technologies</dc:creator>
      <pubDate>Fri, 03 May 2024 18:32:03 +0000</pubDate>
      <link>https://dev.to/ugacomp/how-to-install-ant-media-server-on-ubuntu-390a</link>
      <guid>https://dev.to/ugacomp/how-to-install-ant-media-server-on-ubuntu-390a</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YPQOGxLH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.tkqlhce.com/click-100701360-12454592" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YPQOGxLH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.tkqlhce.com/click-100701360-12454592" alt="Image description" width="" height=""&gt;&lt;/a&gt;(&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v31mk063w17h7r5d8d8u.png"&gt;https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v31mk063w17h7r5d8d8u.png&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Ant Media is a streaming server that can be installed on a Linus server for webRTC, HLS &amp;amp; DASH streaming. Here is how to set it up:&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Secure HLS &amp; DASH Streams in Ant Media</title>
      <dc:creator>Ugacomp Technologies</dc:creator>
      <pubDate>Tue, 09 Apr 2024 20:15:29 +0000</pubDate>
      <link>https://dev.to/ugacomp/how-to-secure-hls-dash-streams-in-ant-media-42cb</link>
      <guid>https://dev.to/ugacomp/how-to-secure-hls-dash-streams-in-ant-media-42cb</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7v1ukrjh521vm7asnl2t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7v1ukrjh521vm7asnl2t.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Third-party websites are likely to abuse your server resources if your Ant Media streams are not secured; to stop malicious and unauthorized stream embedding. If you're into the business of live streaming, you will understand that server resources are critical and expensive. if anybody can feed on your streaming resources, you're likely tp go out of business quickly as you will keep incurring huge costs. &lt;/p&gt;

&lt;p&gt;To stop people from abusing your streaming resources, you can stop third-party domains from embedding your Ant Media HLS and DASH streams. In this article, we would like to give you a brief clue of what you need to implement.  &lt;/p&gt;

&lt;p&gt;But we recommend that you &lt;a href="https://www.ugacomp.com/how-to-secure-hls-dash-streams-in-ant-media-server/"&gt;read the full guide on how to implement everything related to secure Ant Media HLS and DASH streams.&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Nginx and setting up the Reverse Proxy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In short, the first step is to install Nginx server on the same machine where Ant Media server. Doing this will allow you to implement the important part of this step, which is configuring the reverse proxy using the nano /etc/nginx/nginx.conf file:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample nginx.conf configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the sample template configuration you’re going to put into the nginx.conf file:&lt;/p&gt;

&lt;p&gt;user nginx;&lt;br&gt;
worker_processes auto;&lt;br&gt;
pid /var/run/nginx.pid;&lt;br&gt;
worker_rlimit_nofile 1048576;&lt;/p&gt;

&lt;p&gt;events {&lt;br&gt;
    worker_connections 1048576;&lt;br&gt;
    multi_accept on;&lt;br&gt;
    use epoll;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;http {&lt;br&gt;
    sendfile on;&lt;br&gt;
    tcp_nopush on;&lt;br&gt;
    tcp_nodelay on;&lt;br&gt;
    server_tokens off;&lt;br&gt;
    keepalive_timeout 300s;&lt;br&gt;
    types_hash_max_size 2048;&lt;br&gt;
    include /etc/nginx/mime.types;&lt;br&gt;
    default_type application/octet-stream;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ssl settings
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers         HIGH:!aNULL:!MD5;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

# logs settings
log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"'
                  '"$hostname" "upstream: $upstream_addr"';
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

# gzip
gzip on;
gzip_disable "msie6";
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript text/javascript application/x-javascript text/xml application/xml application/xml+rss application/vnd.ms-fontobject application/x-font-ttf font/opentype font/x-woff image/svg+xml image/x-icon;

# proxy settings
proxy_redirect off;
proxy_http_version 1.1;
proxy_read_timeout 10s;
proxy_send_timeout 10s;
proxy_connect_timeout 10s;

#redirect all http requests to https
server {
    listen 80 default_server;
    server_name _;
    return 301 https://$host$request_uri;
}  

#Origin Configuration
#Change {YOUR_DOMAIN} with your fully qualified domain name. 
server {
        listen 443 ssl;
        ssl_certificate /etc/letsencrypt/live/{YOUR_DOMAIN}/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/{YOUR_DOMAIN}/privkey.pem;
        server_name yourdomain.com;

        location / {
          if ($http_referer !~* "^https?://(www\.)?Whitelisted-domain-name\.com"){
          return 403;
    }
            proxy_pass http://AMS-server-IP:5080;
            proxy_http_version 1.1;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
        }
    }

#Dashboard Configuration (To allow access to your AMS dashboard on different port which should be allowed only for specific IPs)
#Change {YOUR_DOMAIN} with your fully qualified domain name. 
server {
        listen 4444 ssl;
        ssl_certificate /etc/letsencrypt/live/{YOUR_DOMAIN}/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/{YOUR_DOMAIN}/privkey.pem;
        server_name yourdomain.com;

        location / {
            proxy_pass http://AMS-Server-IP:5080;
            proxy_http_version 1.1;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Whitelisting the allowed domains&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From the above code, you will need to find the following block:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   location / {
          if ($http_referer !~* "^https?://(www\.)?Whitelisted-domain-name\.com"){
          return 403;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;it's important to note that this block is critical and  without it, you can't whitelist the domains you want to allow to embed your Ant Media HLS streams.&lt;/p&gt;

&lt;p&gt;Unwhitelisted domains won't be allowed to embed your streams on their sites. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.ugacomp.com/how-to-secure-hls-dash-streams-in-ant-media-server/"&gt;It’s important to note that the process of securing Ant Media HLS and DASH streams is a bit tricky for a beginner, but you have to follow this guide which simplifies it for you&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>streaming</category>
      <category>hls</category>
      <category>linux</category>
      <category>nginx</category>
    </item>
    <item>
      <title>Is it possible to test Apache for Syntax errors</title>
      <dc:creator>Ugacomp Technologies</dc:creator>
      <pubDate>Tue, 09 Apr 2024 05:02:37 +0000</pubDate>
      <link>https://dev.to/ugacomp/is-it-possible-to-test-apache-for-syntax-errors-47of</link>
      <guid>https://dev.to/ugacomp/is-it-possible-to-test-apache-for-syntax-errors-47of</guid>
      <description>&lt;p&gt;Yes, you can test Apache Webserver for syntax errors using various mechanisms like:&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the configtest command:
&lt;/h2&gt;

&lt;p&gt;On your terminal, you can run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apachectl configtest&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will determine if apache has syntax errors or not. If there are some syntax errors, you be able to identify the affected lines in the apache configuration file. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the systemctl status command&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you can also use the following command to determine if your apache server is affected by syntax errors:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl status apache2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above command is usually underrated but it offers a better understanding of whether your apache has syntax errors or not. In most cases, if there some errors, this command will be able to list the affected line in the configuration file. &lt;/p&gt;

&lt;p&gt;Now, if you want to fix and learn more about how Aoache Syntax errors, you can read this &lt;a href="https://www.ugacomp.com/how-to-test-the-apache-server-for-syntax-errors/"&gt;full guide&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Should I use Nginx or Apache Server?</title>
      <dc:creator>Ugacomp Technologies</dc:creator>
      <pubDate>Sat, 06 Apr 2024 22:51:26 +0000</pubDate>
      <link>https://dev.to/ugacomp/should-i-use-nginx-or-apache-server-306p</link>
      <guid>https://dev.to/ugacomp/should-i-use-nginx-or-apache-server-306p</guid>
      <description>&lt;p&gt;Both Nginx and Apache are popular webservers that are used to host applications and websites on the world wide web. &lt;/p&gt;

&lt;p&gt;While Nginx and apache offer tremendous benefits, their capabilities could vary based on how each of them handle things like:&lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic content handling (Nginx)
&lt;/h2&gt;

&lt;p&gt;Dynamic content are website elements or features that are generated on-the-fly in response to user interactions or other external factors. Unlike static content, which remains the same every time it is accessed, dynamic content can change based on various conditions, such as user input, database queries, or system events.&lt;/p&gt;

&lt;p&gt;Nginx is known for being efficient in handling dyanmic content compared to apache webserver. This is because Nginx uses an event-driven and asynchronous architecture, allowing it to efficiently manage and processe incoming connections and requests without relying on a separate thread or process for each connection.&lt;/p&gt;

&lt;p&gt;Nginx utilizes an event-driven, non-blocking I/O model, where a single worker process can handle multiple connections concurr. When Nginx receives a request, it initiates non-blocking I/O operations to read or write data from sockets, file descriptors, or upstream servers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.ugacomp.com/how-to-optimize-performance-in-nginx/"&gt;RECOMMENDED READING: How to optimize performance in Nginx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead of waiting for these operations to complete, Nginx continues to process other requests or events, maximizing resource utilization and responsiveness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic Content Handling (Apache Server)
&lt;/h2&gt;

&lt;p&gt;On the other hand, Apache web server is not particularly good at handling dynamic content. This is because it uses a multi-process multi-threaded architecture and so it processes each request in a separate thread or process, which can consume more system resources, especially under heavy loads.&lt;/p&gt;

&lt;p&gt;However, to be able to increase apache's capabilities to handle dynamic content, &lt;a href="https://www.ugacomp.com/how-to-implement-performance-tunning-in-apache-webserver/"&gt;you will need to implement a couple performance tunning techniques&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Scalability
&lt;/h2&gt;

&lt;p&gt;Scalability is an important aspect and feature when it comes to webservers. This capability makes it possible to increase the potential of your webserver infrastructure so the growing traffic needs are served efficiently. &lt;/p&gt;

&lt;p&gt;Both Nginx and apache offer the potential to scale up the deployment capabilities using load balancing techniques.&lt;/p&gt;

&lt;p&gt;The Nginginx load balancer is widely used in enterprise-grade application deployment scenarios. on the other hand, Apache's load balancer can be activated using the mod_proxy and mod_proxy_balancer modules.&lt;/p&gt;

&lt;p&gt;If your traffic is growing, you will need to scale your webserver infrastructure to avoid unexpected downtime due to resource depletion. Of course, both Nginx and Apache can be scaled effectively, but Nginx is generally considered easier to implement for large-scale deployments due to its event-driven architecture and lightweight design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration and setup
&lt;/h2&gt;

&lt;p&gt;Nginx is widely known for being easier to set up compared to Apache. This is because Nginx syntax is easier to manipulate. However, Apache's configuration complexity comes from the fact that it relies on additional modules for customization. Apache is not so beginner-friendly when it comes to setting up and customize its functionality.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Resource Consumpation
&lt;/h2&gt;

&lt;p&gt;The Apache Webserver is known for being resource-intensive, especially when dealing with dynamic content handling. This is because each request requires a separate process or thread that runs in the background, consuming more server resources. &lt;/p&gt;

&lt;p&gt;Nginx on the other hand has been documented for being reource-efficient due to its event-driven and asynchronous architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.ugacomp.com/how-does-nginx-compare-to-apache-server/"&gt;RECOMMENDED READING: How does Nginx compare to Apache Server?&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nginx</category>
      <category>apache</category>
      <category>linux</category>
      <category>webserver</category>
    </item>
  </channel>
</rss>
