• Name: assignment_turned_in MUTiSM Magnum (official) | create 라이몽 (korean)

Specification

  • CPU: Intel™ i5-3337U
  • Memory: 8G
  • Stoage:
    • 128G (m.2 type SSD) — / partition
    • 500G (SATA HDD) — ~/storage partition
  • WiFi:
    • Intel® Dual Band Wireless-AC 3160 (802.11ac)
    • Realtek® WLAN USB Adapter (802.11ac)

Hosting Services

admin Júne's MuON Gateway — MU Gateway

admin Júne's Xchange Repository — Xchange Service

admin Júne's Wiki OWL — One Wiki LAB

Live Nginx Configuration for MUTiSM


+Work logs

  • Wordpress™ installed — Updated on 2018/09/10 00:44
  • Added first new user for x.meson.ml — Updated on 2018/09/10 00:43 | account_box Registered Users
  • Docker Client/Server installed — Updated on 2018/07/18 01:20
  • wiki.meson.one & x.meson.ml certificates are issued — Updated on 2018/07/17 11:17
  • mu.meson.one page is created and need to attention to edit — Updated on 2018/07/13 02:00
  • Let's Encrypted issued and installed — Updated on 2018/07/10 23:48

+Que to do


Sudo Group

In Ubuntu, Login with root

  ssh root@your_server_ip 

Add user, usually first user is required to input during installation steps.

  adduser firstuser

Add user in sudo group

  usermod -aG sudo firstuser

sudo without typing password

  sudo visudo 

Add following line.

  #includedir /etc/sudoers.d
  username ALL=(ALL) NOPASSWD: ALL

Network configuration

Install wpasupplicant for wireless connection.

  sudo apt install wpasupplicant 

check network adapters with ifconfig and iwconfig – need to install wireless-tools. Edit /etc/netplan/01-something.yaml for networkd or Network-Manager

network:
  ethernets:
    enp3s0:
      addresses: []
      dhcp4: true
      optional: true
      nameservers:
        search: [search.domain.ltd]
        addresses: [8.8.8.8,8.8.4.4]
  wifis:
    wlp2s0:
      addresses: []
      dhcp4: true
      optional: true
      nameservers:
        search: [search.domain.ltd]
        addresses: [1.1.1.1,1.0.0.1]
      access-points:
        ? "your ssid"
        :
          password: passphrase 
--- 
  renderer: networkd
  version: 2

Manual / Reference Guide for netplan

Live Netplan Configuration for MUTiSM


Manage connected WiFi SSID

in Network-Manager path: /etc/Network-Manager/system-connections

edit or delete SSID named file(s).


Compiling RTL8821AU wireless driver

purge installed driver, which is not working correctly and compile new driver.

  sudo apt purge rtl8812au-dkms
  sudo apt install git
  git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git
  cd rtl8812AU_8821AU_linux
  sudo make -f Makefile.dkms install 
  sudo modprobe rtl8812au

check driver is installed and recognized by system.

  modinfo rtl8812au | grep A811		// Linux kernel module 
  ifconfig    				// network adapters 
  iwconfig    				// wireless configuration 

Disable sleep/suspend/hibernate

When a system goes to sleep, suspend or hibernate mode, response from machine is extremely slow or timed out. Soon after waking up, system responses quickly. To prevent this,

  sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Let's Encrypted

Let's Encrypt — SSL/TLS certificates


Install Nginx

  sudo apt-get install nginx-extras     \\ heavier than other packages, full 

Install MySQL

  sudo apt-get install mysql-server 
 
  sudo mysql_secure_installation     \\ to secure MySQL weakness 

without sudo, root authentication identified by temporary password is required. Never pass it. Do with sudo


Install PHP

  sudo apt-get install php-fpm php-mysql 

Configure the PHP Processor

  sudo vi /etc/php/7.x/fpm/php.ini 

Comment out cgi.fix_pathinfo parameter and set value to 0

  cgi.fix_pathinfo=0

And restart service.

  sudo systemctl restart php7.x-fpm 

Nginx with PHP Processor

Default config of Nginx with PHP Processor

server {
    listen 80 default_server;
    listen [::]:80 default_server;
 
    root /var/www/html;
    index index.php index.html index.htm index.nginx-debian.html;
 
    server_name server_domain_or_IP;
 
    location / {
        try_files $uri $uri/ =404;
    }
 
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
 
    location ~ /\.ht {
        deny all;
    }
}

To use php-fpm, need to edit /etc/php/7.x/fpm/pool.d/www.conf

;listen = 127.0.0.1:9000 
listen = /run/php/php7.0-fpm.sock;  # which creates socket for php-fpm 

pm = dynamic
pm.max_children = 50
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 32
pm.max_requests = 500

pm. values could be changed according to resources such as physical memory and an average usage of each php processor.


Install Wordpress™

Install required services

Prerequisite: Nginx, MySQL (MariaDB) and related PHP modules

  sudo apt install nginx 
  sudo apt-get install mariadb-server mariadb-client

Install related PHP modules. if one or two modules are not listed on Ubuntu default repository, add additional repository.

  sudo apt install php7.1-fpm php7.1-common php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-gd php7.1-xml php7.1-intl php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-zip php7.1-curl

Add third-party repository for PHP

  sudo apt-get install software-properties-common
  sudo add-apt-repository ppa:ondrej/php

Secure Database

  sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Just press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y

Restart MySQL (MariaDB) service

  sudo systemctl restart mysql.service

Configure PHP-FPM

  sudo nano /etc/php/7.x/fpm/php.ini

version 7.x is different depending on update. August 2018, version is 7.2

Edit following lines with suggested values

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 100M
cgi.fix_pathinfo=0
max_execution_time = 360
date.timezone = America/Chicago

Create Wordpress database

  sudo mysql -u root -p

Database name is wordpress here.

CREATE DATABASE wordpress;

Create database user named wordpressuser here.

CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'new_password_here';

new_password_here is your own password.

GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

If you see the error message, omit the password.

GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' WITH GRANT OPTION;

Save changes and exit.

FLUSH PRIVILEGES;
EXIT;

Download Wordpress

  cd /tmp && wget https://wordpress.org/latest.tar.gz
  tar -zxvf latest.tar.gz
  sudo mv wordpress /var/www/html/wordpress

Configure web service with Nginx

Create Nginx virtual sites and apply SSL

Configure SSL with Let's Encrypt

Run through web browser to set up initially. — index.php and follow instruction step by step.


Install ownCloud

Memory caching configuration

info Referral manuals — by ownCloud Documentation

Install Redis
sudo apt install redis-server php-redis
Check running service
sudo ps ax | grep redis
sudo netstat -tlnp | grep redis
Clearing the Redis Cache
sudo redis-cli
  SELECT <dbIndex>
  FLUSHDB
Add configuration in ownCloud

Edit /var/www/owncloud/config/config.php if ownCloud root is /var/www/owncloud and add the followings,

<?php
$CONFIG = array (
... ... ... 
...
),
'memcache.local' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => 'true',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
'timeout' => 0,
'dbindex' => 0,
),
); 

Run background jobs

Add crontab with web user such as www-data

# crontab -u www-data -e

Add job

*  *  *  *  * /usr/bin/php -f /path/to/your/owncloud/cron.php

Reset MySQL password

Stop the MySQL service

sudo /etc/init.d/mysql stop

Start MySQL without a password

sudo mysqld_safe --skip-grant-tables &

Connect to MySQL

mysql -uroot

Set a new MySQL root password

use mysql;
update user set authentication_string=PASSWORD("mynewpassword") where User='root';
flush privileges;
quit

Stop and start the MySQL service

sudo /etc/init.d/mysql stop
...
sudo /etc/init.d/mysql start

Log in to the database

mysql -u root -p

Solved Problems

Has sum mismatch

Symptom: Error showing Has sum mismatch during update procedures.

Solution: Delete saved repositories.

sudo rm /var/lib/apt/lists/*   
or 
sudo rm -r /var/lib/apt/lists/* -vf

and update again

sudo apt update 

  • deb_mutism
  • Last modified: 2019/04/16 05:12
  • by Júne Park