Install Humhub Social Network on Ubuntu 22.04

Install Jaringan Sosial Humhub pada Ubuntu 22.04

  • Update repository ubuntu
apt update && apt install unzip wget curl -y
  • Install nginx
add-apt-repository ppa:ondrej/nginx -y && apt update
apt install nginx nginx-core nginx-full -y
  • Install PHP 8.1
apt install software-properties-common -y 
add-apt-repository ppa:ondrej/php
apt update

apt install php8.1 -y
apt install -y php8.1-{common,cli,gd,curl,mysql,xml,mbstring,zip,ldap,xmlrpc,curl,intl,fpm,imagick,dev,imap,apcu,opcache,soap,memcached,redis,bcmath,sqlite3}
  • Install MariaDB 10.10
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.10
apt install mariadb-server mariadb-client -y

mysql_secure_installation

  • Buat database untuk install humhub
mysql -u root -p

CREATE DATABASE humhub;
GRANT ALL PRIVILEGES ON humhub.* TO 'humhub'@'localhost' IDENTIFIED BY 'P@ssw0rd!';
FLUSH PRIVILEGES;
  • Setting virtual host untuk humhub
nano /etc/nginx/conf.d/humhub.conf

server {
   listen 80;
   server_name humhub.marikita.online;
   root /var/www/humhub;

   location / {
       index index.php index.html index.htm;
       try_files $uri $uri/ /index.php?$args;
   }

         add_header X-Frame-Options "SAMEORIGIN";
         add_header X-Content-Type-Options "nosniff";
         add_header X-Xss-Protection "1; mode=block";
         add_header Referrer-Policy strict-origin-when-cross-origin;
         add_header Access-Control-Allow-Origin "*";
         add_header Strict-Transport-Security "max-age=15552000; includeSubDomains;preload";

         location ~* /\.(?!well-known\/) {
                 deny all;
         }

         location ~\.(ini|log|conf)$ {
                 deny all;
         }

   location ~ \.php$ {
      include /etc/nginx/fastcgi_params;
      fastcgi_pass unix:/run/php/php8.1-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
      fastcgi_read_timeout 300;
      proxy_read_timeout 600;
   }
}
wget https://download.humhub.com/downloads/install/humhub-1.14.2.zip
unzip humhub-*.zip && mv humhub-1.14.2 /var/www/humhub 
chown -R www-data:www-data /var/www/humhub 
  • Setting php.ini
nano /etc/php/8.1/fpm/php.ini

memory_limit = 512
post_max_size = 100M
upload_max_filesize = 100M
date.timezone = Asia/Jakarta
  • Setting php8.1-fpm
/etc/php/8.1/fpm/pool.d/www.conf

[www] ganti menjadi > [sys-ops.marikita.online]
pm.max_children = 10
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500
  • Restart service nginx dan php8.1-fpm
systemctl restart nginx php8.1-fpm
  • Opsional, install ssl let’s encrypt
apt install certbot python3-certbot-nginx -y
certbot --nginx --agree-tos --redirect -m [email protected] -d humhub.marikita.online

  • Akses humhub lewat web browser dengan url: http://ip_address atau http://domain
  • Pastikan pada system check tidak ada masalah (hijau)
  • Masukan konfigurasi database sesuai dengan yang sebelumnya sudah di buat
  • Konfigurasi scheduled jobs dan Urls
crontab -e -u www-data
* * * * * /var/www/humhub/protected/yii queue/run >/dev/null 2>&1
* * * * * /var/www/humhub/protected/yii cron/run >/dev/null 2>&1

systemctl restart cron

--------------------------

systemctl restart cron

nano /var/www/humhub/protected/config/common.php
<?php
/**
 * This file provides to overwrite the default HumHub / Yii configuration by your local common (Console and Web) environments
 * @see http://www.yiiframework.com/doc-2.0/guide-concept-configurations.html
 * @see http://docs.humhub.org/admin-installation-configuration.html
 * @see http://docs.humhub.org/dev-environment.html
 */
return [
'components' => [
'urlManager' => [
'showScriptName' => false,
'enablePrettyUrl' => true
]
]
];
  • Konfigurasi Humhub dan aplikasi pendukung
  • Buat user admin untuk akses ke dalam Humhub dan install contoh konten pada humhub
  • Login ke dalam Humhub

herdiana3389

A system administrator with skills in system administration, virtualization, linux, windows, networking, cloud computing, container, etc.