Nov 27, 2024

AntMedia Server : Install and Configure in Ubuntu Server

AntMedia Server (AMS) is an Open-Source, Self-Hosted Video Streaming Platform. It supports steaming of pre-recorded videos to supported website such as Youtube, Twitch, HTML etc.

For more information, visit their official website at (https://antmedia.io/)


1. Ensure that you already have Ubuntu installed and updated with the latest packages. Also you need to have Apache2 web server pre-installed, up and running.


2. First, download the latest version of AntMedia Server Community Edition.


sudo wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.11.3/ant-media-server-community-2.11.3.zip



3. Next is to download Installer Script file from AntMedia.


sudo wget -O install_ant-media-server.sh https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh



4. Now change the installer file to executable format.

sudo chmod +x install_ant-media-server.sh


5. To install the Community Edition, run the following command.

sudo ./install_ant-media-server.sh -i ant-media-server-community-2.11.3.zip


6. Configure the Apache Web Server.

sudo nano /etc/apache/sites-available/[domain.com].conf

Add the following configuration


<VirtualHost *:80>
   ServerAdmin webmaster@localhost
   ServerName [domain.com]

   ErrorLog /var/log/apache2/[domain.com]/error.log
   CustomLog /var/log/apache2/[domain.com]/access.log

   ProxyRequest off
   ProxyPass / http://127.0.0.1:5080/
   ProxyPassReverse / http://127.0.0.1:5080/

</VirtualHost>



7. Enable Apache modules accordingly.

sudo a2enmod proxy proxy_http


8. Enable the new virtual site.

sudo a2ensite [domain.com].conf


9. Enable SSL for AntMedia Server.

cd /usr/local/antmedia

sudo ./enable_ssl.sh -d [domain.com]


10. Ensure the following ports is accessible to the server.

Port Number

Protocol

Descriptions

80

TCP

SSL

5080

TCP

HTTP

5443

TCP

HTTPS

4200

UDP

SRT

1935

TCP

RTMP

50000 - 60000

UDP

WebRTC

5000

TCP

Multi-Nodes Cluster (optional)



11. Restart Apache Server.

sudo systemctl restart apache2


12. Open your favorite browser (eg. Google Chrome), browse the following URL.

http://[domain.com]:5080


13. Once the page have been loaded, you will be prompted to create the first administrator account. Procced to create the admin account and login afterward.


!!! HAPPY COMPUTING !!!

Nov 21, 2024

Proxmox Backup Server (PBS) : Setup No Subscription Repository

For the Proxmox Backup Server (PBS), to use it as a Community Edition. We need to setup the "No Subscriptions" repository.

This methods is only for Hobbyist, Developer and alike, not recommended for Production environment.


1. Login to PBS WebUI and select "Console", then type the following command.

nano /etc/apt/sources.list.d/pve-enterprise.list


2. Comment out the Enterprise Repository by adding a "#" sign at the front.


3. Then add the following line for the No Subscription Repository.

deb http://download.proxmox.com/debian/pbs bookworm pbs-no-subscription

* The "bookworm" is the debian release code name and may change, thus change the name accordingly.


4. Next, is to run the Update.

apt update && apt upgrade -y


5. Finally, restart the server.

reboot



!!! HAPPY COMPUTING !!!

Nov 18, 2024

NextCloud Install in Ubuntu Server

NextCloud is an Open Source, Self-Hosted or Cloud Hosted, File Sync and Sharing Platform. It's Secure, Private and Easy to use. Compatible with Windows, Linux, Android and Apple iOS devices.

This is assuming that you already have Ubuntu Server installed, patched and updated.

1. Download the latest version of NextCloud.

sudo wget https://download.nextcloud.com/server/releases/latest.zip


2. Install some required packages.


sudo apt install libmagickcore-6.q16-6-extra php php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml -y



3. Install Marid DB Server.

sudo apt install mariadb-server -y


4. Secure Marid DB installation, follow on-screen prompt and instructions.

sudo mysql_secure_installation


5. Configure Maria DB Server.


CREATE DATABASE nextcloud;

SHOW DATABASES;

GRANT ALL PRIVILEGES ON nextcloud.* TO 'ncuser'@'localhost' IDENTIFIED BY 'ncpass';

FLUSH PRIVILEGES;

QUIT;



6. Enable PHP Modules.

sudo phpenmod apcu bcmath gmp imagick intl


7. Install Unzip Apps.

sudo apt install unzip -y


8. Unzip the downloaded NextCloud file.

sudo unzip latest.zip


9. Copy and Rename the extracted NextCloud folder.

sudo cp nextcloud demo.com


10. Move the renamed folder to Apache server path.

sudo mv demo.com /var/www/


11. Grant permissions to NextCloud folder.

sudo chwon -R www-data:www-data /var/www/demo.com


12. Create Apache configuration file for NextCloud.


<VirtualHost *:80>
   ServerAdmin webmaster@local.com
   ServerName demo.com
   DocumentRoot /var/www/demo.com

   <Directory /var/www/demo.com>
     Options MultiViews FollowSymlinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>

   ErrorLog /var/log/apache2/demo.com/error.log
   TransferLog /var/log/apache2/demo.com/access.log

  <IfModule mod_headers.c>
     Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
   </IfModule>

</VirtualHost>



13. Configure and modify PHP file. Modify the value according to your requirements.


memory_limit = 512M

upload_max_filesize = 512M

max_execution_time = 360

post_max_size = 512M

date.timezone = Asia/Kuala_Lumpur

opcache.enable = 1

opcache.interned_strings_buffer = 16

opcache.max_accelerated_files = 10000

opcache.memory_consumption = 128

opcache.save_comments = 1

opcache.revalidate_freq = 1



14. Enabled Apache modules for NextCloud use.

sudo a2enmod dir env headers mime rewrite ssl


15. Enable APCU module in PHP.

sudo nano /etc/php/8.3/mods-available/apcu.ini

add the following line :-

apc.enable_cli = 1


16. Open your favorite browser, such as Google Chrome browser. And type the URL of NextCloud server (eg. http://demo.com). At the main screen, you need to configure the NextCloud Database (eg. nextcloud) created earlier including its username (eg. ncuser) & password (eg. ncpass). You also need to create the First Administrator account with a valid email address too.


17. NextCloud screen will auto refresh upon successful connection to the database, now login with the new administrator account created in earlier step.


18. Secure NextCloud with Let's Encrypt SSL.

sudo certbot --apache


19. Fix missing Indices in NextCloud.

sudo chmod +x /var/www/demo.com/occ

sudo /var/www/demo.com/occ db:add-missing-indices

sudo chmod -x /var/www/demo.com/occ


20. Change permissions of NextCloud config file.

sudo chmod 660 /var/www/demo.com/config/config.php

sudo chown root:www-data /var/www/demo.com/config/config.php


21. Modify NextCloud configuration file.

sudo nano /var/www/demo.com/config/config.php

Modify the following lines according to you needs :-


'memcache.local' => '\OC\Memcache\APCu',

'default_phone_region' => 'MY',

'maintenance_window_start' => 1,

'filelocking.enabled' => true,

'memcache.locking' => '\OC\MemCache\APCu',



22. Restart Apache server.

sudo systemctl restart apache2


23. Configure Crontab.

sudo crontab -u www-data -e

Add the following line :-

00 * * * 1 php -f /var/www/demo.com/cron.php



OPTIONAL STEPS

24. Remove Skeleton Files and Folders when User account is created.

sudo rm -R /var/www/demo.com/core/skeleton/Templates


25. Remove Work Flow Engine, to prevent User from installing WorkFlow.


sudo /var/www/demo.com/occ config:app:set workflowengine user_scope_disabled --value yes



26. Install "Redis" as MemCache for NextCloud.

sudo apt install redis php-redis -y

sudo systemctl enable redis

sudo systemctl start redis

sudo nano /var/www/demo.com/config/config.php


'memcache.local' => '\OC\Memcache\Redis',

'memcache.locking' => '\OC\Memcache\Redis',

'redis' => array(
     'host' => '/var/run/redis/redis.sock'.
     'port' => 0,
     'timemout' => 0.0,
     ),


sudo nano /etc/redis/redis.conf


unixsocket /var/run/redis/redis.sock

unixsocketperm 660


sudo usermod -aG redis www-data

sudo systemctl restart redis


27. If Redis is distributed, add following line into NextCloud config file :-

'memcache.distributed' => '\OC\Memcache\MemCached',


28. To clear all NextCloud log entries.

sudo -u www-data truncate /var/www/demo.com/data/nextcloud.log --size=0



!!! HAPPY COMPUTING !!!