===== Opus Imperium โ”€ MUTiSM Magnum ===== {{:ubuntu-18.04-lts-features.png?nolink&300|}} Name: {{mdi>cards?28&color=#dd4814}} ''**MUTiSM** Magnum'' (official) | {{mdi>creation?28&color=#dd4814}} ''๋ผ์ด๋ชฝ'' (korean) ---- ==== Specification ==== {{mdi>cpu-64-bit?28&color=#dd4814}} CPU: ''Intelยฎ Coreโ„ข i5-3337U CPU @ 1.80GHz (2 cores)'' --- [[https://meson.in/31n12gL|Product info]] {{mdi>memory?28&color=#dd4814}} Memory: ''**8G**'' {{mdi>database-plus?28&color=#dd4814}} Storages: * ''**128G**'' (m.2 type SSD) --- ''**/**'' partition * ''**500G**'' (SATA HDD) --- ''**~/storage**'' partition === Live status of storages === Mounted on Type Size Used Avail Use% / ext4 117G 15G 97G 13% /home/web-data ext4 916G 262G 608G 31% /home/www-data ext4 458G 49G 387G 12% {{mdi>wifi?28&color=#dd4814}} Wireless: * Intelยฎ Dual Band Wireless-AC 3160 (802.11ac) * Realtekยฎ WLAN USB Adapter (802.11ac) --- {{mdi>wifi-strength-off?14}} not working after ''focal fossa'' ---- ==== Hosting Services ==== **''[[https://mu.meson.one/|Jรบne's MuON Gateway]]''** --- MU Gateway **''[[https://x.meson.ml|Jรบne's Xchange Repository]]''** --- Xchange Service **''[[https://wiki.meson.one|Jรบne's Wiki OWL]]''** --- One Wiki LAB Showing lively on OWL {{fa>opera?14&color=#cc0f16}} for ''**MUTiSM** Magnum'' {{fa>lock?color=#808080}} ---- ==== ๏ผ‹Work logs ==== * Upgrade ''php 8.2'' and purge ''php 7.4'', ''php 8.0'' --- Updated on //2023/06/04 02:51// * Upgrade ''php 8.0'' --- Updated on //2021/01/26 17:24// * Upgrade ''mariadb 10.5'' --- Updated on //2020/08/31 13:25// * ''adjust & optimize'' value of ''php-fpm'' -- ''/etc/php/7.x/fpm/pool.d/www.conf'' --- Updated on //2020/07/25 21:42// * ''Upgrade'' Ubuntu **''20.04''** - ''focal fossa'' --- Updated on //2020/07/24 01:23// * Change ''backup rsync'' to another partition --- Updated on //2020/06/27 04:01// * Migrate ''mariadb 10.3.22'' from ''mysql'' --- Updated on //2020/03/30 01:42// * {{fa>certificate}} ''Renew SSL certificates'' (Let's Encrypt) done --- Updated on //2019/08/01 21:17// * **Nextcloud** ''install'' --- Updated on //2019/05/17 01:02// * {{fa>wordpress?color=#21759b}} Wordpress(tm) ''installed'' --- Updated on //2018/09/10 00:44// * {{fa>user?color=#da1884}} Added first ''new user'' for ''x.meson.ml'' --- Updated on //2018/09/10 00:43// | {{mdi>account-multiple-plus-outline}} [[::private:june_todo#xmesonml|Registered Users]] {{fa>lock}} * **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// * {{fa>certificate}} ''Renew SSL certificates'' (Let's Encrypt) done --- Updated on //2019/05/23 02:16// === ๏ผ‹Que to do === * [[http://blog.filerun.com/how-to-install-filerun-on-ubuntu-16/|Install FileRun]], [[http://docs.filerun.com/filerun_install_guide|Installation Guide]] --- Online file management * Front page for ''mu.meson.one'' ---- ==== 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 {{fa>link}} [[http://manpages.ubuntu.com/manpages/bionic/man5/netplan.5.html|Manual / Reference Guide for netplan]] {{fa>sliders?color=#d20962&2x}} Live [[:secured:server_config##netplan_configuration|Netplan Configuration]] for ''**MUTiSM**'' {{fa>lock?color=#808080}} ---- ==== Manage connected WiFi SSID ==== in ''Network-Manager'' ''path'': ''**/etc/Network-Manager/system-connections**'' ''edit'' or ''delete'' ''**SSID**'' named file(s). ---- ==== Compiling RTL8811AU 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 Action to do next is [[deb_gilead#suspendtarget_is_masked|Suspend.target is masked]] ---- ==== Let's Encrypted ==== {{fa>certificate?color=#BBAA00}} [[:rpi_nimbus#let_s_encrypt|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 {{fa>exclamation-triangle?color=#BBAA00}} 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 ==== 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 = ?? pm.start_servers = 8 pm.min_spare_servers = 4 pm.max_spare_servers = 8 pm.max_requests = 500 ''pm.'' values could be changed according to resources such as physical memory and an average usage of each php processor. Guide for adjusting values are ^ Setting Name ^ Suggested value ^ | ''max_children'' | (Total RAM - Memory used for Linux, DB, etc.) / process size | | ''start_servers'' | Number of CPU cores x 4 | | ''min_spare_servers'' | Number of CPU cores x 2 | | ''max_spare_servers'' | Same as start_servers | | | | Available memory size can be guessed by commanding ''free -hl'' and process size used by ''php7.x-fpm'' is calculated by scripts [[https://raw.githubusercontent.com/pixelb/ps_mem/master/ps_mem.py|ps_mem.py]] and ''sudo python ps_mem.py | grep php-fpm'' 12.9 MiB + 18.7 MiB = 31.6 MiB php-fpm7.3 (4) memory consumed by each php-fpm is assumed as ''31.6 Mbyte''. ---- ==== 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 [[:rpi_nimbus#let_s_encrypt|Configure SSL with Let's Encrypt]] Run through web browser to set up initially. --- ''index.php'' and follow instruction step by step. ---- ==== Install Nextcloud ==== === Memory caching configuration === {{mdi>information-variant?24&color=#be0027}} [[https://doc.owncloud.org/server/admin_manual/configuration/server/caching_configuration.html|Referral manuals]] --- by ownCloud Documentation \\ {{mdi>information-variant?24&color=#be0027}} [[https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html|Referral manuals]] --- by Nextcloud 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 FLUSHDB == Add configuration in ownCloud == Edit ''/var/www/owncloud/config/config.php'' if ownCloud root is ''/var/www/owncloud'' and add the followings, '\\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 ---- === Setting for uploading large size files === ''edit'' php_value in ''/etc/php/7.x/fpm/php.ini'' upload_max_filesize 16G post_max_size 16G max_input_time 3600 max_execution_time 3600 upload_tmp_dir = /var/big_temp_file/ output_buffering = 0 {{mdi>lightbulb-on?28&color=#003666}} ''max_execution_time'' could be ''**21600**'' if showing error during assembling file(s). ''edit'' ''/etc/php/7.x/fpm/pool.d/www.conf'' request_terminate_timeout = 300 ''edit'' ''fastcgi_read_timeout'' value in Nginx virtual host configuration location ~ .php$ { root /var/www/sites/nginxtips.com; try_files $uri =404; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 300; } {{mdi>lightbulb-on?32&color=#003666}} ''fastcgi_read_timeout'' could be ''**21600**'' if showing error during assembling file(s). * {{fa>lightbulb-o?24}} --- on Nextcloud Administration Manual * {{fa>lightbulb-o?24}} --- Fix 504 timeout problem ---- === Enable PHP OPcache === [[https://docs.nextcloud.com/server/23/admin_manual/installation/server_tuning.html#enable-php-opcache|Nextcloud Manual]] ---- === Post installation === Check overview * The PHP module "imagick" in this instance has no SVG support. sudo apt install php-imagick imagemagick ---- ==== 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 ====== ==== Stuck during update in Nextcloudโ„ข ==== {{fa>bug}} **Symptom**: Stuck in page showing ''Step 4 is currently in process. Please reload this page later'' during Nextcloud (tm) update using updater. {{fa>lightbulb-o}} **Solution**: ''Delete'' ''.step'' file in ''nextcloud-data/updater-randomstring/**.step**''. ---- ==== Has sum mismatch ==== {{fa>bug}} **Symptom**: Error showing ''**Has sum mismatch**'' during update procedures. {{fa>lightbulb-o}} **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 ---- ==== No apps found for your version ==== {{fa>bug}} **Symptom**: Error showing **No apps found for your version** in Nextcloud (tm) Apps. {{fa>lightbulb-o}} **Solution**: ''Edit'' Fetching time in script, located in ''../nextcloud_root/lib/private/App/AppStore/Fetcher/Fetcher.php''. } $options = [ - 'timeout' => 10, + 'timeout' => 300, ]; ---- ==== the 'ssl' directive is deprecated ==== {{fa>bug}} **Symptom**: Error shows ''2020/07/28 18:13:52 [warn] 42175#42175: the "ssl" directive is deprecated, use the "listen ... ssl ..." directive instead in /etc/nginx'' {{fa>lightbulb-o}} **Solution** Edit ''/etc/nginx/sites-available/site.conf'' server { # Add ssl in listen listen 443 ssl http2 default_server; listen [::]:443 ssl http2 default_server; # ... comment out ssl on; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; port_in_redirect off; #ssl on; Check related error and warning sudo nginx -t ----