Optimal Virtualmin Template Settings

Create a file in /etc/skel/public_html/index.html with the following:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Under Construction</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400" rel="stylesheet">
<style media="screen" type="text/css">
html {
height:100%;
}
body {
color: #fff; 
margin: 0;
font-family: "Montserrat", sans-serif;
font-style: normal;
font-size: 14px;
line-height: 22px;
height: 100%; 
background-color: #fff;
}
h1 {
margin-top: 20px;
font-size: 50px;
opacity: 1;
}
@media all and (max-width: 980px) {
h1 {
font-size: 35px;
}
.under-construction p {
font-size: 20px;
}
}
@media all and (max-width: 767px) {
h1 {
font-size: 28px;
}
.under-construction p {
font-size: 16px;
}
}
h2 {
font-style: normal;
font-size: 14px;
line-height: 22px;
margin: 0;
}
.wrap {
height: auto; 
min-height: 100%; 
background-color: #3B4251;
}
.domain {
position: absolute; 
text-align: center; 
width: 100%; 
margin-left: -50%; 
top: 42.5%;
left: 50%;
}

.footer {
text-align: center;
color:#DCDCDC; 
margin:auto;
padding:15px 20px 18px 20px;
position:relative;
clear:both;
height:40px;
margin-top:-73px;
background-color:#444;
font-size: 12px;
line-height: 22px;
}
p {
margin: 0;
}

.footer a {
color:#DCDCDC; 
}
p.description {
padding-top: 10px;
font-size: 18px;
}
.uh-logo {
margin: 20px;
max-width: 40px;
}
.under-construction {
position: absolute; 
text-align: center; 
width: 100%; 
bottom: 5%;
font-size: 24px;
line-height: 1; 
font-weight: 300;
}
img {
filter: brightness(0) invert(1);
}


</style>
</head>
<body>
<div class="wrap">
<a href="https://uniquehosting.net/"><img class="uh-logo" src="https://uniquehosting.net/wp-content/uploads/2024/06/cropped-Unique-Hosting-Logo-32x32.png" alt="uniquehosting.net logo"></a>
<div class="domain">
<h1 id="site_domain">mydomain.com</h1>
</div>
<div class="under-construction">
<p>We're just getting ready... Check back soon!</p>
</div>
</div>
<script>
document.getElementById("site_domain").innerHTML = window.location.hostname;
</script>
</body>
</html>

Go to System Settings -> Server Templates -> Default Settings -> Website for Domain and paste the above in the text field labeled ‘Disabled Website HTML’. Then check the box labeled ‘Redirect all HTTP requests to HTTPS’ and click on the ‘Save’ button.

Now go to System Settings -> Server Templates -> Default Settings -> PHP Options

In the section labeled ‘PHP configuration variables for scripts’, add the following:

memory_limit at least 128M
post_max_size at least 256M
upload_max_filesize at least 256M

How to Set Inotify Limit PERMANENTLY on a Synology Diskstation

Go to Control Panel -> Task Scheduler. Create a New Task -> Triggered Task -> User-defined script.

In General Settings tab: give it a name (e.g. “Syncthing Sysctl Inotify Fix”) and Event = Boot-up.

In the Task Settings tab: enter this in the Run Command box:

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'

The sleep is to delay the setting to (hopefully) skip past any initialization that Synology does at boot time.

Click OK to close the task dialog, then enable the task and hit the Save button.

Reference

https://forum.syncthing.net/t/setting-inotify-limit-permanently-on-synology-diskstation/12221/3

How To Resize a Cloud Server File System

This guide explains how to expand the file system on a Vultr cloud server instance. If you have upgraded your cloud server to a plan with a larger disk or need to expand a partition while preserving data, follow these steps. A cloud server instance is sometimes called a Virtual Private Server or VPS.

This guide uses Ubuntu 20.04 as an example but applies to any Linux distribution with the fdisk and resize2fs tools. The example server has a 10 GB virtual disk with two partitions:

The virtual disk vda is 10 GB.

The first partition vda1 is 6 GB.

The second partition vda2 is 4 GB.

# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 10G 0 disk
├─vda1 252:1 0 6G 0 part /
└─vda2 252:2 0 4G 0 part

As an example, this guide will remove the second partition (vda2), then expand the first partition (vda1) to fill the virtual disk. This will preserve all data on vda1 and delete all data on vda2.
Use this example as a general guide for your particular situation. Continue reading

How to Install Nextcloud on a Synology the Easy Way

Begin by installing a package called “Container Manager”. This should have created a new folder in your drive volume called ‘docker’. Create a new folder within this folder called “nextcloud”. Then create 7 new folders inside the nextcloud folder called “config”, “db”, “custom_apps”, “themes”, “html”, “redis”, and “data”. Now right click on the nextcloud folder that you have just created and click Properties. Go to the Permission tab then click Advanced options. From the drop-down menu choose “Make inherited permissions explicit“. Select Everyone then click the Edit tab. Check all Read and Write Permissions and click on Done. After you click Done check “Apply to this folder, sub-folders and files“ then click on Save. Now open up the “Container Manager” package and click on “Project”. Name it “nextcloud” and select “/docker/nextcloud” for the project path. Choose “Create docker-compose.yml” for source and add the following:

version: '3.9'
services:
  mariadb:
    image: mariadb:latest
    container_name: Nextcloud-DB
    security_opt:
      - no-new-privileges:true
    user: 1026:100
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF
    volumes:
      - ./db:/var/lib/mysql:rw
      - ./db:/etc/mysql/conf.d:rw
    environment:
      - MYSQL_ROOT_PASSWORD=[PASSWORD]
      - MYSQL_PASSWORD=[PASSWORD]
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - TZ=America/Los_Angeles
    restart: on-failure:5
      
  redis:
    image: redis:latest
    container_name: Nextcloud-REDIS
    hostname: nextcloudredis
    user: 1026:100
    healthcheck:
     test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    volumes:
      - ./redis:/data:rw
    environment:
      TZ: America/Los_Angeles
    restart: on-failure:5
      
  nextcloud:
    image: nextcloud:latest
    container_name: Nextcloud
    ports:
      - 9333:80
    depends_on:
      mariadb:
       condition: service_started
      redis:
       condition: service_healthy
    environment:
      - REDIS_HOST=nextcloudredis
      - NEXTCLOUD_TRUSTED_DOMAINS=[DOMAIN] 10.0.1.11
      - TRUSTED_PROXIES=[DOMAIN] 10.0.1.11
      - OVERWRITEHOST=[DOMAIN]
      - OVERWRITEPROTOCOL=https
      - MYSQL_PASSWORD=[PASSWORD]
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=mariadb
    healthcheck:
     test: curl -f http://localhost:80/ || exit 1
    volumes:
      - ./html:/var/www/html:rw
      - ./custom_apps:/var/www/html/custom_apps:rw
      - ./config:/var/www/html/config:rw
      - ./data:/var/www/html/data:rw
      - ./themes:/var/www/html/themes:rw
    restart: on-failure:5
    
  cron:
   image: nextcloud:apache
   container_name: Nextcloud-CRON
   restart: always
   volumes:
     - ./config:/var/www/html/config:rw
     - ./html:/var/www/html:rw
     - ./custom_apps:/var/www/html/custom_apps:rw
     - ./data:/var/www/html/data:rw
   entrypoint: /cron.sh
   depends_on:
    mariadb:
       condition: service_started
    redis:
       condition: service_started

Replace [PASSWORD] with unique strong passwords and [DOMAIN] with your own domain name. Continue to build the project. Once completed, you should be able to access the Nextcloud UI by typing “https://[SYNOLOGY_IP]:9333” in your web browser. Go ahead and create an admin user. Once installed, you will be logged in. If you are using LDAP you can enable the “LDAP user and group backend” app and configure it with uid=root,cn=users,dc=[SUBDOMAIN],dc=[DOMAIN],dc=[DOMAINSUFFIX] for the User DN. Now we just need to create a reverse proxy so that we don’t have to access Nextcloud with an IP address and port number. This can be done by going to Control Panel -> Login Portal -> Advanced in your Synology and clicking on the “Reverse Proxy” button. Enter your domain name for source and the IP address of your Synology for the destination. Be sure to specify port 9333 for the destination. Last, there is a file that needs to be modified. This might be fixed in a future version, but for now open up the .htaccess file in the html folder and look for the following lines:

RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]

Change it to the following replacing [DOMAIN] with your own domain name:

RewriteRule ^\.well-known/carddav https://[DOMAIN]/remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav https://[DOMAIN]/remote.php/dav/ [R=301,L]

Also, add the following line in the <IfModule mod_headers.c> section:

Header always set Strict-Transport-Security "max-age=15552000"

That’s it! Now you should be able to access Nextcloud with your domain name. If you need to run any commands as the web server user, go into Container Manager and click on ‘Container’, then right click on ‘Nextcloud’ and select ‘Open Terminal’. Then run the command like so:

# su - www-data -s /bin/bash -c 'php /var/www/html/occ db:add-missing-indices'

Reference

https://mariushosting.com/synology-how-to-install-nextcloud-using-docker/