<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.seaoffate.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nigel</id>
	<title>Sea of Fate - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.seaoffate.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nigel"/>
	<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php/Special:Contributions/Nigel"/>
	<updated>2026-06-05T22:38:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=73</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=73"/>
		<updated>2025-03-05T06:32:42Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Configure NFS Server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User photoup&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local. if we try the plum.seaoffate.net now we should get the welcome to nginx default page because we haven&#039;t setup raisin yet.&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 &lt;br /&gt;
login to plum&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html/&lt;br /&gt;
 sudo unzip ~/piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
A MySQL database is needed for the CMS so login to mandarin then login to Mysql&lt;br /&gt;
 mysql -u root -p&lt;br /&gt;
Then create a database&lt;br /&gt;
 CREATE DATABASE piwigo_db;&lt;br /&gt;
Now we need a user for the database&lt;br /&gt;
 CREATE USER &#039;piwigo_user&#039;@&#039;192.168.100.20&#039; IDENTIFIED BY &#039;your_password&#039;;&lt;br /&gt;
This user can only connect from the IP address of plum if you want it less restrictive use &#039;%&#039; instead of &#039;192.168.100.20. We need to grant privileges to the user:&lt;br /&gt;
 GRANT ALL PRIVILEGES ON piwigo_db.* TO &#039;piwigo_user&#039;@&#039;192.168.100.20&#039;;&lt;br /&gt;
last we need to flush privileges and exit&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 EXIT; &lt;br /&gt;
We should now have the following set for the web install part&lt;br /&gt;
* Database Host: mandarin.seaoffate.local&lt;br /&gt;
* Database User: piwigo_user&lt;br /&gt;
* Database Password: your_password&lt;br /&gt;
* Database Name: piwigo_db&lt;br /&gt;
&lt;br /&gt;
===Complete the Piwigo Installation===&lt;br /&gt;
&lt;br /&gt;
Now with everything setup we are ready to complete the Piwigo install in the browser&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
* Administrator is sailor&lt;br /&gt;
* password is in keepass of mgtconsole&lt;br /&gt;
&lt;br /&gt;
We want to have the source photos to be store in the RO /photo and have a working directory for dynamic or cache photos to be somewhere on the main website (public_html). Ensure the _data directory exists within your Piwigo installation directory (e.g., /var/www/plum.seaoffate/public_html/_data). Set the permissions for the _data directory to allow Apache to write to it:&lt;br /&gt;
 sudo chmod -R 775 /var/www/plum.seaoffate/public_html/_data&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html/_data&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=72</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=72"/>
		<updated>2025-03-05T06:31:49Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Piwigo Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local. if we try the plum.seaoffate.net now we should get the welcome to nginx default page because we haven&#039;t setup raisin yet.&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 &lt;br /&gt;
login to plum&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html/&lt;br /&gt;
 sudo unzip ~/piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
A MySQL database is needed for the CMS so login to mandarin then login to Mysql&lt;br /&gt;
 mysql -u root -p&lt;br /&gt;
Then create a database&lt;br /&gt;
 CREATE DATABASE piwigo_db;&lt;br /&gt;
Now we need a user for the database&lt;br /&gt;
 CREATE USER &#039;piwigo_user&#039;@&#039;192.168.100.20&#039; IDENTIFIED BY &#039;your_password&#039;;&lt;br /&gt;
This user can only connect from the IP address of plum if you want it less restrictive use &#039;%&#039; instead of &#039;192.168.100.20. We need to grant privileges to the user:&lt;br /&gt;
 GRANT ALL PRIVILEGES ON piwigo_db.* TO &#039;piwigo_user&#039;@&#039;192.168.100.20&#039;;&lt;br /&gt;
last we need to flush privileges and exit&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 EXIT; &lt;br /&gt;
We should now have the following set for the web install part&lt;br /&gt;
* Database Host: mandarin.seaoffate.local&lt;br /&gt;
* Database User: piwigo_user&lt;br /&gt;
* Database Password: your_password&lt;br /&gt;
* Database Name: piwigo_db&lt;br /&gt;
&lt;br /&gt;
===Complete the Piwigo Installation===&lt;br /&gt;
&lt;br /&gt;
Now with everything setup we are ready to complete the Piwigo install in the browser&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
* Administrator is sailor&lt;br /&gt;
* password is in keepass of mgtconsole&lt;br /&gt;
&lt;br /&gt;
We want to have the source photos to be store in the RO /photo and have a working directory for dynamic or cache photos to be somewhere on the main website (public_html). Ensure the _data directory exists within your Piwigo installation directory (e.g., /var/www/plum.seaoffate/public_html/_data). Set the permissions for the _data directory to allow Apache to write to it:&lt;br /&gt;
 sudo chmod -R 775 /var/www/plum.seaoffate/public_html/_data&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html/_data&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=71</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=71"/>
		<updated>2025-03-05T06:07:36Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Complete the Piwigo Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local. if we try the plum.seaoffate.net now we should get the welcome to nginx default page because we haven&#039;t setup raisin yet.&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 &lt;br /&gt;
login to plum&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html/&lt;br /&gt;
 sudo unzip ~/piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
A MySQL database is needed for the CMS so login to mandarin then login to Mysql&lt;br /&gt;
 mysql -u root -p&lt;br /&gt;
Then create a database&lt;br /&gt;
 CREATE DATABASE piwigo_db;&lt;br /&gt;
Now we need a user for the database&lt;br /&gt;
 CREATE USER &#039;piwigo_user&#039;@&#039;192.168.100.20&#039; IDENTIFIED BY &#039;your_password&#039;;&lt;br /&gt;
This user can only connect from the IP address of plum if you want it less restrictive use &#039;%&#039; instead of &#039;192.168.100.20. We need to grant privileges to the user:&lt;br /&gt;
 GRANT ALL PRIVILEGES ON piwigo_db.* TO &#039;piwigo_user&#039;@&#039;192.168.100.20&#039;;&lt;br /&gt;
last we need to flush privileges and exit&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 EXIT; &lt;br /&gt;
We should now have the following set for the web install part&lt;br /&gt;
* Database Host: mandarin.seaoffate.local&lt;br /&gt;
* Database User: piwigo_user&lt;br /&gt;
* Database Password: your_password&lt;br /&gt;
* Database Name: piwigo_db&lt;br /&gt;
&lt;br /&gt;
===Complete the Piwigo Installation===&lt;br /&gt;
&lt;br /&gt;
Now with everything setup we are ready to complete the Piwigo install in the browser&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=70</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=70"/>
		<updated>2025-03-05T06:07:09Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Piwigo Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local. if we try the plum.seaoffate.net now we should get the welcome to nginx default page because we haven&#039;t setup raisin yet.&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 &lt;br /&gt;
login to plum&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html/&lt;br /&gt;
 sudo unzip ~/piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
A MySQL database is needed for the CMS so login to mandarin then login to Mysql&lt;br /&gt;
 mysql -u root -p&lt;br /&gt;
Then create a database&lt;br /&gt;
 CREATE DATABASE piwigo_db;&lt;br /&gt;
Now we need a user for the database&lt;br /&gt;
 CREATE USER &#039;piwigo_user&#039;@&#039;192.168.100.20&#039; IDENTIFIED BY &#039;your_password&#039;;&lt;br /&gt;
This user can only connect from the IP address of plum if you want it less restrictive use &#039;%&#039; instead of &#039;192.168.100.20. We need to grant privileges to the user:&lt;br /&gt;
 GRANT ALL PRIVILEGES ON piwigo_db.* TO &#039;piwigo_user&#039;@&#039;192.168.100.20&#039;;&lt;br /&gt;
last we need to flush privileges and exit&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
 EXIT; &lt;br /&gt;
We should now have the following set for the web install part&lt;br /&gt;
* Database Host: mandarin.seaoffate.local&lt;br /&gt;
* Database User: piwigo_user&lt;br /&gt;
* Database Password: your_password&lt;br /&gt;
* Database Name: piwigo_db&lt;br /&gt;
&lt;br /&gt;
===Complete the Piwigo Installation===&lt;br /&gt;
&lt;br /&gt;
Now with everything setup we are ready to complete the Piwigo install in the browser&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=69</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=69"/>
		<updated>2025-03-05T03:58:22Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Configure the forwarders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local. if we try the plum.seaoffate.net now we should get the welcome to nginx default page because we haven&#039;t setup raisin yet.&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=68</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=68"/>
		<updated>2025-03-05T03:50:36Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Server Configs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local. if we try the plum.seaoffate.net now we should get the welcome to nginx default page because we haven&#039;t setup raisin yet.&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=67</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=67"/>
		<updated>2025-03-05T03:48:20Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=66</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=66"/>
		<updated>2025-03-05T03:48:03Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=65</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=65"/>
		<updated>2025-03-05T03:46:14Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Reverse Proxy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
====Configure the forwarders====&lt;br /&gt;
&lt;br /&gt;
First of all login to logan. We have to create some config files&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.local&lt;br /&gt;
Enter the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
save and exit then open the next config&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/photo.seaoffate.local&lt;br /&gt;
and fill in the following lines&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name photo.seaoffate.local;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
save and exit then do the last one with&lt;br /&gt;
 sudo nano /etc/nginx/sites-available/plum.seaoffate.net&lt;br /&gt;
and the following configuration&lt;br /&gt;
 server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name plum.seaoffate.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://192.168.100.20; # Plum&#039;s IP&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto $scheme;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
and save and exit.Next we need to enable the configs&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/photo.seaoffate.local /etc/nginx/sites-enabled/&lt;br /&gt;
 sudo ln -s /etc/nginx/sites-available/plum.seaoffate.net /etc/nginx/sites-enabled/&lt;br /&gt;
We should test with &lt;br /&gt;
 sudo nginx -t&lt;br /&gt;
and if all is well restart nginx&lt;br /&gt;
 sudo systemctl restart nginx &lt;br /&gt;
&lt;br /&gt;
Some final notes.&lt;br /&gt;
* Ensure port 80 is forwarded to 192.168.100.8 (Raisin)&lt;br /&gt;
* Ensure DNS records for plum.seaoffate.local and photo.seaoffate.local have been created on NS1&lt;br /&gt;
* Ensure DNS record has been created for plum.seaoffate.net on Cloudflare&lt;br /&gt;
* When testing the .net it will appear as https: even though we have not done that yet because Cloudflare is set to proxy so Cloudflare will present a ssl cert to the browser but only between the browser and Cloudflare is encrypted. We should do the SSL certs as soon as possible after testing.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=64</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=64"/>
		<updated>2025-03-05T03:30:01Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Server Configs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local, if photo does not work or keeps defaulting to https check ns1 to make sure there is an entry for photo.seoffate.local&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=63</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=63"/>
		<updated>2025-03-05T03:21:50Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Server Configs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
We can now test the plum webserver by browsing to http://plum.seaoffate.local and http://photo.seaoffate.local&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=62</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=62"/>
		<updated>2025-03-05T03:19:10Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Server Configs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
If we want the default index files from /var/www/html&lt;br /&gt;
 cd /var/html&lt;br /&gt;
 sudo cp *.* /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=61</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=61"/>
		<updated>2025-03-05T03:14:02Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Piwigo Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
 cd /var/www/plum.seaoffate/public_html&lt;br /&gt;
 sudo unzip piwigo-15.4.0.zip&lt;br /&gt;
 sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=60</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=60"/>
		<updated>2025-03-05T03:06:53Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Piwigo Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website on lemon and copy it to plum&lt;br /&gt;
 scp ~/Downloads/piwigo-15.4.0.zip nigel@plum.seaoffate.local:~/&lt;br /&gt;
 sudo cp ~/piwigo-15.4.0.zip /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
sudo chown -R www-data:www-data /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/public_html/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=59</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=59"/>
		<updated>2025-03-05T02:37:26Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Server Configs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate/public_html&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website.&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
sudo chown -R www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=58</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=58"/>
		<updated>2025-03-05T02:34:52Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Plum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
&lt;br /&gt;
====Server Configs====&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
The last one&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.net.conf&lt;br /&gt;
should contain the .net config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.net&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.net-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.net-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Once they are done we need to enable them all&lt;br /&gt;
 sudo a2ensite plum.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite photo.seaoffate.local.conf&lt;br /&gt;
 sudo a2ensite plum.seaoffate.net.conf&lt;br /&gt;
and disable the default&lt;br /&gt;
 sudo a2dissite 000-default.conf&lt;br /&gt;
We now restart apache with&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
====Piwigo Requirements====&lt;br /&gt;
&lt;br /&gt;
Get the webserver mods&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install php libapache2-mod-php php-mysql php-gd php-curl php-xml php-mbstring mysql-client&lt;br /&gt;
&lt;br /&gt;
Download Piwigo from the official website.&lt;br /&gt;
&lt;br /&gt;
Extract the Piwigo archive to /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
sudo chown -R www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
Mount Read-Only Photo Directory&lt;br /&gt;
&lt;br /&gt;
Create a symlink in Piwigo&#039;s _data/galleries directory&lt;br /&gt;
 sudo ln -s /photo /var/www/plum.seaoffate/_data/galleries/original_photos&lt;br /&gt;
&lt;br /&gt;
====Piwigo Configuration====&lt;br /&gt;
&lt;br /&gt;
Access Piwigo through your browser (e.g., plum.seaoffate.local).&lt;br /&gt;
&lt;br /&gt;
Follow the installation wizard, providing database details and administrator credentials.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Photos Directory&amp;quot; during install, ensure that it is set to the symlink directory, like _data/galleries/original_photos&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=57</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=57"/>
		<updated>2025-03-05T02:23:57Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;br /&gt;
&lt;br /&gt;
==Webserver Setup==&lt;br /&gt;
&lt;br /&gt;
There will be a webserver on Plum to display all of the photos. We will be installing Piwigo as the CMS.&lt;br /&gt;
&lt;br /&gt;
===Reverse Proxy===&lt;br /&gt;
&lt;br /&gt;
We will have to forward browser requests from both local and remote so there will be three config files to edit one for plum.seaoffate.local, photo.seaoffate.local and another config for plum.seaoffate.net.&lt;br /&gt;
&lt;br /&gt;
===Plum===&lt;br /&gt;
&lt;br /&gt;
The same set of servers to listen to as above so seperate config for plum.seaoffate.local, photo.seaoffate.local and plum.seaoffate.net. They will all be serving the same data so we create that first.&lt;br /&gt;
 sudo mkdir -p /var/www/plum.seaoffate&lt;br /&gt;
 sudo chown www-data:www-data /var/www/plum.seaoffate&lt;br /&gt;
Next we create Virtual Host Configuration Files  &lt;br /&gt;
 sudo nano /etc/apache2/sites-available/plum.seaoffate.local.conf&lt;br /&gt;
We need to put in the following config&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName plum.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/plum.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/plum.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
save and exit. Then the next with&lt;br /&gt;
 sudo nano /etc/apache2/sites-available/photo.seaoffate.local.conf&lt;br /&gt;
and fill in &lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerName photo.seaoffate.local&lt;br /&gt;
    DocumentRoot /var/www/plum.seaoffate&lt;br /&gt;
&lt;br /&gt;
    ErrorLog ${APACHE_LOG_DIR}/photo.seaoffate.local-error.log&lt;br /&gt;
    CustomLog ${APACHE_LOG_DIR}/photo.seaoffate.local-access.log combined&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=56</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=56"/>
		<updated>2025-03-05T01:50:27Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry &amp;amp; Plum Drive Sharing==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we create the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=55</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=55"/>
		<updated>2025-03-05T01:48:34Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
==Strawberry to share /mnt/shared/photo==&lt;br /&gt;
&lt;br /&gt;
===Setup the Hard Drive===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we creat the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=54</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=54"/>
		<updated>2025-03-05T01:46:38Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
===Setup Strawberry to share /mnt/shared/photo===&lt;br /&gt;
&lt;br /&gt;
First we need to login to strawberry and format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we creat the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
We should test that the SFTP server is working by using a SFTP client like filezilla to connect and upload a text file from a local VM like the mgtConsole(lemon). use the following settings&lt;br /&gt;
* host = strawberry.seaoffate.local&lt;br /&gt;
* username = photoup&lt;br /&gt;
* password = whatever was set when photoup was created&lt;br /&gt;
* port = 22&lt;br /&gt;
We should be able to upload a test.txt file to the directory photo if not troubleshoot before going to the next thing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plum Setup===&lt;br /&gt;
&lt;br /&gt;
Now that the photo directory is setup and exported by strawberry we can mount it as a NFS share in Plum. To that end login to Plum then install the nfs client&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-common&lt;br /&gt;
Create Mount Point&lt;br /&gt;
 sudo mkdir /photo&lt;br /&gt;
Mount NFS Share by editing the /etc/fstab file&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
add a line &lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /photo nfs ro,defaults 0 0&lt;br /&gt;
this mounts the /mnt/shared/photo directory from strawberry to /photo on plum with ro pemissions. if we wanted to call it pictures we would have it as&lt;br /&gt;
 192.168.100.21:/mnt/shared/photo /pictures nfs ro,defaults 0 0&lt;br /&gt;
save and exit. Then do &lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
We can check that the shared photo directory is working by doing &lt;br /&gt;
 ls /photo&lt;br /&gt;
WE should se the test.txt file there we can test that it is RO by deleting it&lt;br /&gt;
 sudo rm test.txt&lt;br /&gt;
It should return the error message&lt;br /&gt;
 rm: cannot remove &#039;test.txt&#039;: Read-only file system&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=53</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=53"/>
		<updated>2025-03-05T01:22:10Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
===Setup Strawberry to share /mnt/shared/photo===&lt;br /&gt;
&lt;br /&gt;
First we need to format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we creat the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
Save and exit. Then to apply the export we do&lt;br /&gt;
sudo exportfs -a&lt;br /&gt;
sudo systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=52</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=52"/>
		<updated>2025-03-05T01:20:28Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
===Setup Strawberry to share /mnt/shared/photo===&lt;br /&gt;
&lt;br /&gt;
First we need to format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we creat the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
make sure permissions are correct for /mnt/shared&lt;br /&gt;
 sudo chown root:root /mnt/shared&lt;br /&gt;
 sudo chmod 755 /mnt/shared&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to export the directory by editing the exports file&lt;br /&gt;
 /etc/exports&lt;br /&gt;
and add the line&lt;br /&gt;
 /mnt/shared/photo 192.168.100.20(ro,sync,no_subtree_check)&lt;br /&gt;
&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
Save and exit. Now apply the config and make sure it works&lt;br /&gt;
 sudo sshd -t&lt;br /&gt;
 sudo systemctl restart ssh&lt;br /&gt;
 sudo systemctl status ssh&lt;br /&gt;
&lt;br /&gt;
===&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=51</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=51"/>
		<updated>2025-03-05T01:11:17Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
===Setup Strawberry to share /mnt/shared/photo===&lt;br /&gt;
&lt;br /&gt;
First we need to format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we craet the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&lt;br /&gt;
 Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=50</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=50"/>
		<updated>2025-03-05T01:10:07Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
===Setup Strawberry to share /mnt/shared/photo===&lt;br /&gt;
&lt;br /&gt;
First we need to format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we craet the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
To do any SFTP uploads we will need an user to upload photos, we will call it &amp;quot;photoup&amp;quot;&lt;br /&gt;
 sudo adduser photoup&lt;br /&gt;
set permissions with&lt;br /&gt;
 sudo chown uploader:uploader /mnt/shared/photo&lt;br /&gt;
 sudo chmod 775 /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
===Configure NFS Server===&lt;br /&gt;
&lt;br /&gt;
We need to install the NFS server&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; sudo apt install nfs-kernel-server&lt;br /&gt;
We need to edit the sshd config &lt;br /&gt;
 /etc/ssh/sshd_config&lt;br /&gt;
Towards the bottom there should be a line &lt;br /&gt;
 Subsystem       sftp    /usr/lib/openssh/sftp-server&lt;br /&gt;
just below that line add&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Match User uploader&lt;br /&gt;
    ChrootDirectory /mnt/shared&lt;br /&gt;
    ForceCommand internal-sftp&lt;br /&gt;
    AllowTcpForwarding no&lt;br /&gt;
    X11Forwarding no&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=49</id>
		<title>Plum (Photo)</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Plum_(Photo)&amp;diff=49"/>
		<updated>2025-03-05T00:57:30Z</updated>

		<summary type="html">&lt;p&gt;Nigel: Created page with &amp;quot;==Introduction==  The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&amp;#039;s OS as normal but read only access to the photo archive.  ==Strawberry==  To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be upl...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The host plum.seaoffate.net will be at an IP address of production.20. The purpose will be to show photos using Piwigo. The main premise is that plum will have a hard drive for it&#039;s OS as normal but read only access to the photo archive.&lt;br /&gt;
&lt;br /&gt;
==Strawberry==&lt;br /&gt;
&lt;br /&gt;
To separate the photo archive from the webserver and avoid any data loss of the original photos we will store the files on a different VM and share the files by a read only NFS. All pictures will be uploaded to this other VM that has read and write access. This other host is named strawberry and has an IP address of prod.21. &lt;br /&gt;
&lt;br /&gt;
===Hard Drive===&lt;br /&gt;
&lt;br /&gt;
Strawberry has a normal HD for it&#039;s OS but it has a large additional drive from the pearpool/PoolForPear/Pdata/shared, this is listed as AllSharedFiles on datacenter-&amp;gt;storage and has an initial size of 4TB. It is mounted at /mnt/shared. To give a plum access to photos there is a directory called photo, this is the limit of plum&#039;s sight of the files on /mnt/shared and if some other VM needs to have access to a different share we could create another share off of mnt/shared or share /mnt/shared completely.&lt;br /&gt;
&lt;br /&gt;
===Setup Strawberry to share /mnt/shared/photo===&lt;br /&gt;
&lt;br /&gt;
First we need to format the Hard disk and mount it to /mnt/shared. Run &lt;br /&gt;
 lsblk &lt;br /&gt;
or &lt;br /&gt;
 sudo fdisk -l &lt;br /&gt;
to identify the disk to mount, it will probably be &amp;quot;sdb&amp;quot; or &amp;quot;/dev/sdb&amp;quot; or some thing similar it will be the large one in any case as we are starting with 4tb. We will not be creating a new partition, just directories, so no need for that, we will format the entire drive. To format the entire drive with ext4 we use the command (obviously, use the actual drive shown by lsblk or fdisk -l)&lt;br /&gt;
 sudo mkfs.ext4 /dev/sdb&lt;br /&gt;
Next we craet the mount point for /mnt/shared if it does not already exist&lt;br /&gt;
 sudo mkdir /mnt/shared&lt;br /&gt;
If it does exist see if there is anything stored there and possibly move it somewhere else. but if it is empty it is ok to use as is. Now there is somewhare to mount the drive we can use the mount command&lt;br /&gt;
 sudo mount /dev/sdb /mnt/shared&lt;br /&gt;
this will mount dev/sdb to the mount point /mnt/shared. To prove that it worked try &lt;br /&gt;
 ls /mnt/shared&lt;br /&gt;
You should see the lost+found directory, which is created by ext4. We now need to configure /etc/fstab (for Automatic Mounting). We will need the UUID to add to /etc/fstab so run &lt;br /&gt;
 sudo blkid /dev/sdb&lt;br /&gt;
and copy the UUID number. Next we need to edit fstab&lt;br /&gt;
 sudo nano /etc/fstab&lt;br /&gt;
and add the line &lt;br /&gt;
 UUID=your_uuid /mnt/shared ext4 defaults 0 2&lt;br /&gt;
Replace your_uuid with the value from blkid /dev/sdb.Save and exit. To verify that the fstab edits were ok use&lt;br /&gt;
 sudo mount -a&lt;br /&gt;
If there is anything wrong there should be an error message. The last thing to do is to create the photo directory&lt;br /&gt;
 sudo mkdir /mnt/shared/photo&lt;br /&gt;
&lt;br /&gt;
===Create an Upload user===&lt;br /&gt;
&lt;br /&gt;
to&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=48</id>
		<title>Webservers</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=48"/>
		<updated>2025-03-04T23:22:16Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==temporary notes==&lt;br /&gt;
&lt;br /&gt;
new webserver plum 192.168.100.20 enp6s18 using strawberry as a sftp server&lt;br /&gt;
&lt;br /&gt;
== webservers Purposes ==&lt;br /&gt;
&lt;br /&gt;
four webservers with the primary job of serving websites have been defined.&lt;br /&gt;
&lt;br /&gt;
===Logan (Wiki)===&lt;br /&gt;
&lt;br /&gt;
logan has been setup as a webserver to have the wiki website. It&#039; IP is prod.12 It can be accessed by logan.seaoffate.local, wiki.seaoffate.local or wiki.seaoffate.net&lt;br /&gt;
&lt;br /&gt;
===Lime (default)===&lt;br /&gt;
&lt;br /&gt;
The default website is hosted on lime. The IP is prod.10. It can be accessed by lime.seaoffate.local, www.seaoffate.local or www.seaoffate.local.&lt;br /&gt;
&lt;br /&gt;
===Fig (files)===&lt;br /&gt;
&lt;br /&gt;
not setup yet ip will is prod.11 &lt;br /&gt;
&lt;br /&gt;
===[[Plum (Photo)]]===&lt;br /&gt;
&lt;br /&gt;
This one is to host the photo website, probably Piwigo. It can be accessed at plum.seaoffate.local, photo.seaoffate.local or plum.seaoffate.net. The Ip will be Prod.20. The setup here is to have a normal HD for the webserver but a NFS share for the base photos with only RO access. The actual directory where the photos are shared from will be another VM called strawberry (IP prod.21).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Website log files and locations ==&lt;br /&gt;
&lt;br /&gt;
The Docroots are &lt;br /&gt;
 /var/www/wiki.seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/files.seaoffate.local/public_html&lt;br /&gt;
&lt;br /&gt;
The access logs are seperate for each config &lt;br /&gt;
&lt;br /&gt;
===www.seaoffate on Lime===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-access.log&lt;br /&gt;
and the local are&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===wiki.seaoffate on Logan===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-access.log&lt;br /&gt;
and the .local are &lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-access.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===Nginx Log Files===&lt;br /&gt;
&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=47</id>
		<title>Webservers</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=47"/>
		<updated>2025-03-04T22:53:13Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* temporary notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==temporary notes==&lt;br /&gt;
&lt;br /&gt;
new webserver plum 192.168.100.20 enp6s18 using strawberry as a sftp server&lt;br /&gt;
&lt;br /&gt;
== Website log files and locations ==&lt;br /&gt;
&lt;br /&gt;
The Docroots are &lt;br /&gt;
 /var/www/wiki.seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/files.seaoffate.local/public_html&lt;br /&gt;
&lt;br /&gt;
The access logs are seperate for each config &lt;br /&gt;
&lt;br /&gt;
===www.seaoffate on Lime===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-access.log&lt;br /&gt;
and the local are&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===wiki.seaoffate on Logan===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-access.log&lt;br /&gt;
and the .local are &lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-access.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===Nginx Log Files===&lt;br /&gt;
&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=46</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=46"/>
		<updated>2025-03-04T18:18:05Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; there is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port.  The assignments are&lt;br /&gt;
&lt;br /&gt;
* Raisin ..***02&lt;br /&gt;
* Lime ...****03&lt;br /&gt;
* Fig ....****04&lt;br /&gt;
* Logan ..****05&lt;br /&gt;
* NS1 ....****06&lt;br /&gt;
* Lemon ..****07&lt;br /&gt;
* Alpine .****08&lt;br /&gt;
* Plum ...****09&lt;br /&gt;
* strawberry**10&lt;br /&gt;
It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. when testing try the user nigel@&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=45</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=45"/>
		<updated>2025-03-04T17:35:14Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; there is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port.  The assignments are&lt;br /&gt;
* Mandarin ***01&lt;br /&gt;
* Raisin ..***02&lt;br /&gt;
* Lime ...****03&lt;br /&gt;
* Fig ....****04&lt;br /&gt;
* Logan ..****05&lt;br /&gt;
* NS1 ....****06&lt;br /&gt;
* Lemon ..****07&lt;br /&gt;
* Alpine .****08&lt;br /&gt;
* Plum ...****09&lt;br /&gt;
It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. when testing try the user nigel@&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=44</id>
		<title>Webservers</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=44"/>
		<updated>2025-03-04T17:30:50Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==temporary notes==&lt;br /&gt;
&lt;br /&gt;
new webserver plum 192.168.100.20 enp6s18&lt;br /&gt;
&lt;br /&gt;
== Website log files and locations ==&lt;br /&gt;
&lt;br /&gt;
The Docroots are &lt;br /&gt;
 /var/www/wiki.seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/files.seaoffate.local/public_html&lt;br /&gt;
&lt;br /&gt;
The access logs are seperate for each config &lt;br /&gt;
&lt;br /&gt;
===www.seaoffate on Lime===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-access.log&lt;br /&gt;
and the local are&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===wiki.seaoffate on Logan===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-access.log&lt;br /&gt;
and the .local are &lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-access.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===Nginx Log Files===&lt;br /&gt;
&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;br /&gt;
DocumentRoot /var/www/files.seaoffate.local/public_html&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=43</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=43"/>
		<updated>2025-03-01T17:42:46Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; there is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port.  The assignments are&lt;br /&gt;
* Mandarin ***01&lt;br /&gt;
* Raisin ..***02&lt;br /&gt;
* Lime ...****03&lt;br /&gt;
* Fig ....****04&lt;br /&gt;
* Logan ..****05&lt;br /&gt;
* NS1 ....****06&lt;br /&gt;
* Lemon ..****07&lt;br /&gt;
* Alpine .****08&lt;br /&gt;
&lt;br /&gt;
It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. when testing try the user nigel@&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=42</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=42"/>
		<updated>2025-03-01T17:30:29Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; there is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port. It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. The assignments are&lt;br /&gt;
* Mandarin ***01&lt;br /&gt;
* Raisin ..***02&lt;br /&gt;
* Lime ...****03&lt;br /&gt;
* Fig ....****04&lt;br /&gt;
* Logan ..****05&lt;br /&gt;
* NS1 ....****06&lt;br /&gt;
* Lemon ..****07&lt;br /&gt;
* Alpine .****08&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=41</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=41"/>
		<updated>2025-03-01T17:19:18Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; there is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port. It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. The assignments are&lt;br /&gt;
* Mandarin ***01&lt;br /&gt;
* Raisin ..***02&lt;br /&gt;
* Lime ...****03&lt;br /&gt;
* Fig ....****04&lt;br /&gt;
* Logan ..****05&lt;br /&gt;
* NS1 ....****06&lt;br /&gt;
* Lemon ..****07&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=40</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=40"/>
		<updated>2025-03-01T17:11:51Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* SSH Access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; there is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port. It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. The assignments are&lt;br /&gt;
* Mandarin ***01&lt;br /&gt;
* Raisin ..***02&lt;br /&gt;
* Lime ...****03&lt;br /&gt;
* Fig ....****04&lt;br /&gt;
* Logan ..****05&lt;br /&gt;
* NS1 ....****06&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=39</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=39"/>
		<updated>2025-03-01T17:10:56Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; ther is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port. It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. The assignments are&lt;br /&gt;
* Mandarin ***01&lt;br /&gt;
* Raisin ..***02&lt;br /&gt;
* Lime ...****03&lt;br /&gt;
* Fig ....****04&lt;br /&gt;
* Logan ..****05&lt;br /&gt;
* NS1 ....****06&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=38</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=38"/>
		<updated>2025-03-01T16:26:39Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; ther is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port. It would make sense to have them as aliases in Pfsense, each alias will take the form SSH_int_&#039;&#039;hostname&#039;&#039;. The assignments are&lt;br /&gt;
* Mandarin ****01&lt;br /&gt;
* Raisin ****02&lt;br /&gt;
* Lime ****03&lt;br /&gt;
* Fig ****04&lt;br /&gt;
* Logan ****05&lt;br /&gt;
* NS1 ****06&lt;br /&gt;
* mandarin ****07&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=37</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=37"/>
		<updated>2025-03-01T16:19:23Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Port Assignments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; ther is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port. It would make sense to have them as aliases in Pfsense. The assignments are&lt;br /&gt;
* Mandarin ****01&lt;br /&gt;
* Raisin ****02&lt;br /&gt;
* Lime ****03&lt;br /&gt;
* Fig ****04&lt;br /&gt;
* Logan ****05&lt;br /&gt;
* NS1 ****06&lt;br /&gt;
* mandarin ****07&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=36</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=36"/>
		<updated>2025-03-01T16:14:36Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one pass rule for each interface because when I am &amp;quot;inside&amp;quot; ther is no NAT so I can address the hosts by hostname.&lt;br /&gt;
&lt;br /&gt;
===Port Assignments===  &lt;br /&gt;
&lt;br /&gt;
As previously stated each host will listen to SSH on a different port. It would make sense to have them as aliases in Pfsense. The assignments are&lt;br /&gt;
* mandarin ****01&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=35</id>
		<title>External Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=External_Access&amp;diff=35"/>
		<updated>2025-03-01T15:53:02Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* SSH Access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
I will want access to various hosts for file shares and configuration. This is where I will describe it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SSH Access==&lt;br /&gt;
&lt;br /&gt;
I will want access to the hosts inside the network not least the production hosts to continue the configuration while I am somewhere else. The problem is that Pfsense can only forward based on port so if I want to SSH to Lime from outside of the WAN port of Pfsense there is no way of the firewall from knowing that  mean Lime and not Lemon. I could setup a bastion host to forward on SSH to the various hosts and I may well set it up at a later date just so that I know how but it is a bit of overkill for such a small number hosts. I have instead chosen to have each host listen at a different port so all I need is to have a table showing which port to which host, it will still be secure as it will still be SSH but instead. I will still need a firewall port forward rule for each host internally I will only need one&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=30</id>
		<title>Webservers</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=30"/>
		<updated>2025-03-01T07:30:07Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Website log files and locations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Website log files and locations ==&lt;br /&gt;
&lt;br /&gt;
The Docroots are &lt;br /&gt;
 /var/www/wiki.seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/seaoffate.local/public_html&lt;br /&gt;
&lt;br /&gt;
The access logs are seperate for each config &lt;br /&gt;
&lt;br /&gt;
===www.seaoffate on Lime===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-access.log&lt;br /&gt;
and the local are&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===wiki.seaoffate on Logan===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-access.log&lt;br /&gt;
and the .local are &lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-access.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===Nginx Log Files===&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=29</id>
		<title>Webservers</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Webservers&amp;diff=29"/>
		<updated>2025-03-01T07:26:21Z</updated>

		<summary type="html">&lt;p&gt;Nigel: Created page with &amp;quot;==Introduction==   == Website log files and locations ==  The Docroots are   /var/www/wiki.seaoffate.local/public_html and  /var/www/seaoffate.local/public_html  The access logs are seperate for each config   ===www.seaoffate on Lime===  For the .net they are  /var/log/apache2/www.seaoffate.net-error.log  /var/log/apache2/www.seaoffate.net-access.log and the local are  /var/log/apache2/lime.seaoffate.local-error.log  /var/log/apache2/lime.seaoffate.local-access.log  ===w...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Website log files and locations ==&lt;br /&gt;
&lt;br /&gt;
The Docroots are &lt;br /&gt;
 /var/www/wiki.seaoffate.local/public_html&lt;br /&gt;
and&lt;br /&gt;
 /var/www/seaoffate.local/public_html&lt;br /&gt;
&lt;br /&gt;
The access logs are seperate for each config &lt;br /&gt;
&lt;br /&gt;
===www.seaoffate on Lime===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/www.seaoffate.net-access.log&lt;br /&gt;
and the local are&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/lime.seaoffate.local-access.log&lt;br /&gt;
&lt;br /&gt;
===wiki.seaoffate on Logan===&lt;br /&gt;
&lt;br /&gt;
For the .net they are&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.net-access.log&lt;br /&gt;
and the .local are &lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/wiki.seaoffate.local-access.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-error.log&lt;br /&gt;
 /var/log/apache2/logan.seaoffate.local-access.log&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Virtual_Machines&amp;diff=28</id>
		<title>Virtual Machines</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Virtual_Machines&amp;diff=28"/>
		<updated>2025-02-28T20:25:36Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Virtual Machine Installation &amp;amp; Configuration Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
There will be a variety of Virtual Machines contained within the [[Home Lab]]. A Brief description will be provided here with a more complete set of notes on each individual VM on the links.&lt;br /&gt;
&lt;br /&gt;
==Virtual Machine Installation &amp;amp; Configuration Notes==&lt;br /&gt;
&lt;br /&gt;
===Qemu Agent Install===&lt;br /&gt;
&lt;br /&gt;
All VMs should have the qemu guest installed even server installs, it will allow the guest VM to communicate with Proxmox and give better options from the Proxmox . For Debian / Ubuntu type.&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; install qemu-guest-agent&lt;br /&gt;
For Windows VMs there is a cd that can be referenced when defining the VM. On the OS page as soon as the Guest OS &amp;quot;Microsoft Windows&amp;quot; is selected a tick box, with the title &amp;quot;Add additional drive for VirtIO Drivers&amp;quot; appears. When selected find an ISO image &amp;quot;Virtio-win.iso&amp;quot;. If it is not available it can be added to the ISO library on Proxmox by downloading it from [https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso] or [https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso].&lt;br /&gt;
&lt;br /&gt;
==Virtual Machines==&lt;br /&gt;
A fairly high description of each of the VMs in use in the [[Home Lab]].&lt;br /&gt;
&lt;br /&gt;
===Firewall===&lt;br /&gt;
 &lt;br /&gt;
====[[Pfsense]]====&lt;br /&gt;
&lt;br /&gt;
The firewall and gateway to the whole of the [[Home Lab]]. The Virgin router will forward all incoming traffic from the Internet to the WAN port of the firewall at 192.168.0.125. The Firewall has five other internal interfaces to  link to the Home Lab environment. 192.168.99.10/24 is the MGT VLAN it should be severely restricted to maintain security it is the only VLAN to be able to access the WebGUI of Pfsense. The Production VLAN is where all of the file and web servers are, the gateway address is 192.168.100.1/24. The Infra VLAN gateway 192.168.110.10/24 is where any supporting services will be located, at present there is only a Nameserver. I have reserved a VLAN called VPNnet with a gateway address of 192.168.130.1/24 for a VPN server to provide a VPN tunnel from remote terminals, there will not be many concurrent connections so a /24 network will be more than sufficient. The last VLAN has a Pfsense interface of 192.168.111.1/24 for any Desktop VM terminals that I will use while i am out, I have called this terminals. Further details of the [[Pfsense]] firewall can be found [[Pfsense | here]].&lt;br /&gt;
&lt;br /&gt;
===MGT VLAN===&lt;br /&gt;
&lt;br /&gt;
====[[Management kiosk]]====&lt;br /&gt;
&lt;br /&gt;
A desktop Linux used to configure other VMs including Pfsense. As it is so sensitive i have kept it isolated on the MGT VLAN. There I have setup passwordless ssh to various other VMs as well. The host is called Lemon and has an IP Address of 192.168.99.20/24.&lt;br /&gt;
&lt;br /&gt;
====[[CA Server]]====&lt;br /&gt;
&lt;br /&gt;
I have setup a host specifically to issue SSL certificates. The host name is Alpine with an IP of 192.168.99.25/24. &lt;br /&gt;
&lt;br /&gt;
===Infra Vlan===&lt;br /&gt;
&lt;br /&gt;
====[[Nameserver]]====&lt;br /&gt;
&lt;br /&gt;
There is only one nameserver at the moment called ns1 192.168.110.11/24. It is the only host on the Infra VLAN.&lt;br /&gt;
&lt;br /&gt;
===VPNNet VLAN===&lt;br /&gt;
&lt;br /&gt;
====[[VPNserver]]====&lt;br /&gt;
&lt;br /&gt;
There will be a VPN server called vanilla at 192.168.130.5/24. It will control VPN access to the rest of the network.&lt;br /&gt;
&lt;br /&gt;
===Terminals===&lt;br /&gt;
&lt;br /&gt;
====[[Remote Access Terminal]]====&lt;br /&gt;
&lt;br /&gt;
There will be two VMs setup on teminals VLAN (192.168.111.0/24 with a desktop that I will provide for remote access one of them will be Linux (Ubuntu), hostname Lychee and the other will be Windows 11 Pro with a hostname Wahoo.  &lt;br /&gt;
&lt;br /&gt;
===Prodution===&lt;br /&gt;
&lt;br /&gt;
====[[Reverse Proxy]]====&lt;br /&gt;
&lt;br /&gt;
The Reverse proxy Ngnix install is hosted on Raisin 192.168.100.9/24. It should be setup to fetch SSL certs from Letsencrypt and copy the certs to the various webservers that need them. It&#039;s primary role, of course is to manage access to the webservers.&lt;br /&gt;
&lt;br /&gt;
===[[Webservers]]===&lt;br /&gt;
&lt;br /&gt;
There wil be at least two webservers, One hosting www.seaoffate.net and the other hosting wiki.seaoffate.net. These will also be servicing .local addresses. MySQL will be on a different host. There will be other hosts that have some sort of webserver on them but not as a primary role.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===[[File server]]===&lt;br /&gt;
&lt;br /&gt;
There is a file server called fig at 192.168.100.11. It will also have a webserver installed and will answer to files.seaoffate.net &amp;amp; files.seaoffate.local. It should be configured to serve files using NFS,FTP and SMB locally but only SFTP externally. &lt;br /&gt;
&lt;br /&gt;
===[[MySQL Server]]===&lt;br /&gt;
&lt;br /&gt;
Manderin at 192.168.100.8/24 is hosting the MySQL Databases.I will probably install phpmyadmin at some point to make DB management a bit easier but I doubt if I will give it external access.&lt;br /&gt;
&lt;br /&gt;
===Future VMs===&lt;br /&gt;
&lt;br /&gt;
I may well setup a streaming server with some sort of NFS RO share from the file server.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Virtual_Machines&amp;diff=27</id>
		<title>Virtual Machines</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Virtual_Machines&amp;diff=27"/>
		<updated>2025-02-28T20:24:02Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* Virtual Machine Installation &amp;amp; Configuration Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
There will be a variety of Virtual Machines contained within the [[Home Lab]]. A Brief description will be provided here with a more complete set of notes on each individual VM on the links.&lt;br /&gt;
&lt;br /&gt;
==Virtual Machine Installation &amp;amp; Configuration Notes==&lt;br /&gt;
&lt;br /&gt;
All VMs should have the qemu guest installed even server installs, it will allow the guest VM to communicate with Proxmox and give better options from the Proxmox . For Debian / Ubuntu type.&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; install qemu-guest-agent&lt;br /&gt;
For Windows VMs there is a cd that can be referenced when defining the VM. On the OS page as soon as the Guest OS &amp;quot;Microsoft Windows&amp;quot; is selected a tick box, with the title &amp;quot;Add additional drive for VirtIO Drivers&amp;quot; appears. When selected find an ISO image &amp;quot;Virtio-win.iso&amp;quot;. If it is not available it can be added to the ISO library on Proxmox by downloading it from [https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso] or [https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso].&lt;br /&gt;
&lt;br /&gt;
==Virtual Machines==&lt;br /&gt;
A fairly high description of each of the VMs in use in the [[Home Lab]].&lt;br /&gt;
&lt;br /&gt;
===Firewall===&lt;br /&gt;
 &lt;br /&gt;
====[[Pfsense]]====&lt;br /&gt;
&lt;br /&gt;
The firewall and gateway to the whole of the [[Home Lab]]. The Virgin router will forward all incoming traffic from the Internet to the WAN port of the firewall at 192.168.0.125. The Firewall has five other internal interfaces to  link to the Home Lab environment. 192.168.99.10/24 is the MGT VLAN it should be severely restricted to maintain security it is the only VLAN to be able to access the WebGUI of Pfsense. The Production VLAN is where all of the file and web servers are, the gateway address is 192.168.100.1/24. The Infra VLAN gateway 192.168.110.10/24 is where any supporting services will be located, at present there is only a Nameserver. I have reserved a VLAN called VPNnet with a gateway address of 192.168.130.1/24 for a VPN server to provide a VPN tunnel from remote terminals, there will not be many concurrent connections so a /24 network will be more than sufficient. The last VLAN has a Pfsense interface of 192.168.111.1/24 for any Desktop VM terminals that I will use while i am out, I have called this terminals. Further details of the [[Pfsense]] firewall can be found [[Pfsense | here]].&lt;br /&gt;
&lt;br /&gt;
===MGT VLAN===&lt;br /&gt;
&lt;br /&gt;
====[[Management kiosk]]====&lt;br /&gt;
&lt;br /&gt;
A desktop Linux used to configure other VMs including Pfsense. As it is so sensitive i have kept it isolated on the MGT VLAN. There I have setup passwordless ssh to various other VMs as well. The host is called Lemon and has an IP Address of 192.168.99.20/24.&lt;br /&gt;
&lt;br /&gt;
====[[CA Server]]====&lt;br /&gt;
&lt;br /&gt;
I have setup a host specifically to issue SSL certificates. The host name is Alpine with an IP of 192.168.99.25/24. &lt;br /&gt;
&lt;br /&gt;
===Infra Vlan===&lt;br /&gt;
&lt;br /&gt;
====[[Nameserver]]====&lt;br /&gt;
&lt;br /&gt;
There is only one nameserver at the moment called ns1 192.168.110.11/24. It is the only host on the Infra VLAN.&lt;br /&gt;
&lt;br /&gt;
===VPNNet VLAN===&lt;br /&gt;
&lt;br /&gt;
====[[VPNserver]]====&lt;br /&gt;
&lt;br /&gt;
There will be a VPN server called vanilla at 192.168.130.5/24. It will control VPN access to the rest of the network.&lt;br /&gt;
&lt;br /&gt;
===Terminals===&lt;br /&gt;
&lt;br /&gt;
====[[Remote Access Terminal]]====&lt;br /&gt;
&lt;br /&gt;
There will be two VMs setup on teminals VLAN (192.168.111.0/24 with a desktop that I will provide for remote access one of them will be Linux (Ubuntu), hostname Lychee and the other will be Windows 11 Pro with a hostname Wahoo.  &lt;br /&gt;
&lt;br /&gt;
===Prodution===&lt;br /&gt;
&lt;br /&gt;
====[[Reverse Proxy]]====&lt;br /&gt;
&lt;br /&gt;
The Reverse proxy Ngnix install is hosted on Raisin 192.168.100.9/24. It should be setup to fetch SSL certs from Letsencrypt and copy the certs to the various webservers that need them. It&#039;s primary role, of course is to manage access to the webservers.&lt;br /&gt;
&lt;br /&gt;
===[[Webservers]]===&lt;br /&gt;
&lt;br /&gt;
There wil be at least two webservers, One hosting www.seaoffate.net and the other hosting wiki.seaoffate.net. These will also be servicing .local addresses. MySQL will be on a different host. There will be other hosts that have some sort of webserver on them but not as a primary role.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===[[File server]]===&lt;br /&gt;
&lt;br /&gt;
There is a file server called fig at 192.168.100.11. It will also have a webserver installed and will answer to files.seaoffate.net &amp;amp; files.seaoffate.local. It should be configured to serve files using NFS,FTP and SMB locally but only SFTP externally. &lt;br /&gt;
&lt;br /&gt;
===[[MySQL Server]]===&lt;br /&gt;
&lt;br /&gt;
Manderin at 192.168.100.8/24 is hosting the MySQL Databases.I will probably install phpmyadmin at some point to make DB management a bit easier but I doubt if I will give it external access.&lt;br /&gt;
&lt;br /&gt;
===Future VMs===&lt;br /&gt;
&lt;br /&gt;
I may well setup a streaming server with some sort of NFS RO share from the file server.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Virtual_Machines&amp;diff=26</id>
		<title>Virtual Machines</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Virtual_Machines&amp;diff=26"/>
		<updated>2025-02-28T20:23:11Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
There will be a variety of Virtual Machines contained within the [[Home Lab]]. A Brief description will be provided here with a more complete set of notes on each individual VM on the links.&lt;br /&gt;
&lt;br /&gt;
==Virtual Machine Installation &amp;amp; Configuration Notes==&lt;br /&gt;
&lt;br /&gt;
All VMs should have the qemu guest installed even server installs, it will allow the guest VM to communicate with Proxmox and give better options from the Proxmox . For Debian / Ubuntu type.&lt;br /&gt;
 sudo apt update &amp;amp;&amp;amp; install qemu-guest-agent&lt;br /&gt;
For Windows VMs there is a cd that can be referenced when defining the VM. On the OS page as soon as the Guest OS &amp;quot;Microsoft Windows&amp;quot; is selected a tick box, with the title &amp;quot;Add additional drive for VirtIO Drivers&amp;quot; appears. When selected find an ISO image &amp;quot;Virtio-win.iso&amp;quot;. If it is not available it can be added to the ISO library on Proxmox by downloading it from [https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso] or [https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Virtual Machines==&lt;br /&gt;
A fairly high description of each of the VMs in use in the [[Home Lab]].&lt;br /&gt;
&lt;br /&gt;
===Firewall===&lt;br /&gt;
 &lt;br /&gt;
====[[Pfsense]]====&lt;br /&gt;
&lt;br /&gt;
The firewall and gateway to the whole of the [[Home Lab]]. The Virgin router will forward all incoming traffic from the Internet to the WAN port of the firewall at 192.168.0.125. The Firewall has five other internal interfaces to  link to the Home Lab environment. 192.168.99.10/24 is the MGT VLAN it should be severely restricted to maintain security it is the only VLAN to be able to access the WebGUI of Pfsense. The Production VLAN is where all of the file and web servers are, the gateway address is 192.168.100.1/24. The Infra VLAN gateway 192.168.110.10/24 is where any supporting services will be located, at present there is only a Nameserver. I have reserved a VLAN called VPNnet with a gateway address of 192.168.130.1/24 for a VPN server to provide a VPN tunnel from remote terminals, there will not be many concurrent connections so a /24 network will be more than sufficient. The last VLAN has a Pfsense interface of 192.168.111.1/24 for any Desktop VM terminals that I will use while i am out, I have called this terminals. Further details of the [[Pfsense]] firewall can be found [[Pfsense | here]].&lt;br /&gt;
&lt;br /&gt;
===MGT VLAN===&lt;br /&gt;
&lt;br /&gt;
====[[Management kiosk]]====&lt;br /&gt;
&lt;br /&gt;
A desktop Linux used to configure other VMs including Pfsense. As it is so sensitive i have kept it isolated on the MGT VLAN. There I have setup passwordless ssh to various other VMs as well. The host is called Lemon and has an IP Address of 192.168.99.20/24.&lt;br /&gt;
&lt;br /&gt;
====[[CA Server]]====&lt;br /&gt;
&lt;br /&gt;
I have setup a host specifically to issue SSL certificates. The host name is Alpine with an IP of 192.168.99.25/24. &lt;br /&gt;
&lt;br /&gt;
===Infra Vlan===&lt;br /&gt;
&lt;br /&gt;
====[[Nameserver]]====&lt;br /&gt;
&lt;br /&gt;
There is only one nameserver at the moment called ns1 192.168.110.11/24. It is the only host on the Infra VLAN.&lt;br /&gt;
&lt;br /&gt;
===VPNNet VLAN===&lt;br /&gt;
&lt;br /&gt;
====[[VPNserver]]====&lt;br /&gt;
&lt;br /&gt;
There will be a VPN server called vanilla at 192.168.130.5/24. It will control VPN access to the rest of the network.&lt;br /&gt;
&lt;br /&gt;
===Terminals===&lt;br /&gt;
&lt;br /&gt;
====[[Remote Access Terminal]]====&lt;br /&gt;
&lt;br /&gt;
There will be two VMs setup on teminals VLAN (192.168.111.0/24 with a desktop that I will provide for remote access one of them will be Linux (Ubuntu), hostname Lychee and the other will be Windows 11 Pro with a hostname Wahoo.  &lt;br /&gt;
&lt;br /&gt;
===Prodution===&lt;br /&gt;
&lt;br /&gt;
====[[Reverse Proxy]]====&lt;br /&gt;
&lt;br /&gt;
The Reverse proxy Ngnix install is hosted on Raisin 192.168.100.9/24. It should be setup to fetch SSL certs from Letsencrypt and copy the certs to the various webservers that need them. It&#039;s primary role, of course is to manage access to the webservers.&lt;br /&gt;
&lt;br /&gt;
===[[Webservers]]===&lt;br /&gt;
&lt;br /&gt;
There wil be at least two webservers, One hosting www.seaoffate.net and the other hosting wiki.seaoffate.net. These will also be servicing .local addresses. MySQL will be on a different host. There will be other hosts that have some sort of webserver on them but not as a primary role.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===[[File server]]===&lt;br /&gt;
&lt;br /&gt;
There is a file server called fig at 192.168.100.11. It will also have a webserver installed and will answer to files.seaoffate.net &amp;amp; files.seaoffate.local. It should be configured to serve files using NFS,FTP and SMB locally but only SFTP externally. &lt;br /&gt;
&lt;br /&gt;
===[[MySQL Server]]===&lt;br /&gt;
&lt;br /&gt;
Manderin at 192.168.100.8/24 is hosting the MySQL Databases.I will probably install phpmyadmin at some point to make DB management a bit easier but I doubt if I will give it external access.&lt;br /&gt;
&lt;br /&gt;
===Future VMs===&lt;br /&gt;
&lt;br /&gt;
I may well setup a streaming server with some sort of NFS RO share from the file server.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Open_several_ssh_terminals_at_once&amp;diff=25</id>
		<title>Open several ssh terminals at once</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Open_several_ssh_terminals_at_once&amp;diff=25"/>
		<updated>2025-02-28T18:59:47Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Continuing the theme of &#039;&#039;&#039;[[Random stuff]]&#039;&#039;&#039; and more particularly of &#039;&#039;&#039;[[Code Snippets]]&#039;&#039;&#039; and &#039;&#039;&#039;[[Linux Bash &amp;amp; Shell]]&#039;&#039;&#039;. This is how to open several terminals at once.&lt;br /&gt;
&lt;br /&gt;
==The First version==&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
Open a text file with the ext of .sh&lt;br /&gt;
 nano ./open_prod_terminals.sh&lt;br /&gt;
Copy the following into the file.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #&lt;br /&gt;
 # Open SSH sessions in separate terminal windows&lt;br /&gt;
 gnome-terminal --tab --title=&amp;quot;logan&amp;quot; -- bash -c &amp;quot;ssh logan; exec bash&amp;quot;&lt;br /&gt;
 gnome-terminal --tab --title=&amp;quot;fig&amp;quot; -- bash -c &amp;quot;ssh fig; exec bash&amp;quot;&lt;br /&gt;
 gnome-terminal --tab --title=&amp;quot;mandarin&amp;quot; -- bash -c &amp;quot;ssh mandarin; exec bash&amp;quot;&lt;br /&gt;
 #&lt;br /&gt;
 exit 0&lt;br /&gt;
Save and exit. Next we have to make it executable.&lt;br /&gt;
 chmod +x ./open_prod_terminals.sh&lt;br /&gt;
From now we can use ./open_prod_terminals.sh to open several terminals at once. &lt;br /&gt;
&lt;br /&gt;
===create an alias===&lt;br /&gt;
&lt;br /&gt;
The text is a bit long and i will not want to type out the whole thing so instead we will create an alias of ./open_prod_terminals.sh. To do this open the shell configuration file&lt;br /&gt;
 nano ~/.bashrc&lt;br /&gt;
Scroll down to the bottom and add the line &lt;br /&gt;
 alias sshp=&#039;./open_prod_terminals.sh&#039; # alias to open production host ssh all at once &lt;br /&gt;
Save and exit. to reload the .bashrc so the alias is available immediately we need to &amp;quot;source&amp;quot; it.&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Now type sshp to open a SSH session to the Production terminals.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Open_several_ssh_terminals_at_once&amp;diff=24</id>
		<title>Open several ssh terminals at once</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Open_several_ssh_terminals_at_once&amp;diff=24"/>
		<updated>2025-02-28T18:42:21Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Continuing the theme of &#039;&#039;&#039;[[Random stuff]]&#039;&#039;&#039; and more particularly of &#039;&#039;&#039;[[Code Snippets]]&#039;&#039;&#039; and &#039;&#039;&#039;[[Linux Bash &amp;amp; Shell]]&#039;&#039;&#039;. This is how to open several terminals at once.&lt;br /&gt;
&lt;br /&gt;
==The First version==&lt;br /&gt;
&lt;br /&gt;
Open a text file with the ext of .sh&lt;br /&gt;
 nano ./open_prod_terminals.sh&lt;br /&gt;
Copy the following into the file.&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
 # Open SSH sessions in separate terminal windows&lt;br /&gt;
 gnome-terminal --tab --title=&amp;quot;logan&amp;quot; -- bash -c &amp;quot;ssh logan; exec bash&amp;quot;&lt;br /&gt;
 gnome-terminal --tab --title=&amp;quot;fig&amp;quot; -- bash -c &amp;quot;ssh fig; exec bash&amp;quot;&lt;br /&gt;
 gnome-terminal --tab --title=&amp;quot;mandarin&amp;quot; -- bash -c &amp;quot;ssh mandarin; exec bash&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 exit 0&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Open_several_ssh_terminals_at_once&amp;diff=23</id>
		<title>Open several ssh terminals at once</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Open_several_ssh_terminals_at_once&amp;diff=23"/>
		<updated>2025-02-28T18:35:06Z</updated>

		<summary type="html">&lt;p&gt;Nigel: Created page with &amp;quot;==Introduction== Continuing the theme of &amp;#039;&amp;#039;&amp;#039;Random stuff&amp;#039;&amp;#039;&amp;#039; and more particularly of &amp;#039;&amp;#039;&amp;#039;Code Snippets&amp;#039;&amp;#039;&amp;#039;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Continuing the theme of &#039;&#039;&#039;[[Random stuff]]&#039;&#039;&#039; and more particularly of &#039;&#039;&#039;[[Code Snippets]]&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Linux_Bash_%26_Shell&amp;diff=22</id>
		<title>Linux Bash &amp; Shell</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Linux_Bash_%26_Shell&amp;diff=22"/>
		<updated>2025-02-28T18:34:33Z</updated>

		<summary type="html">&lt;p&gt;Nigel: /* =Open several ssh terminals at once */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Continuing the theme of &#039;&#039;&#039;[[Random stuff]]&#039;&#039;&#039; and more particularly of &#039;&#039;&#039;[[Code Snippets]]&#039;&#039;&#039; here is some shell scripts for Linux&lt;br /&gt;
&lt;br /&gt;
==The Scripts==&lt;br /&gt;
&lt;br /&gt;
===[[Open several ssh terminals at once]]===&lt;br /&gt;
&lt;br /&gt;
I had already set up password less terminals opening to several common hosts with the format &amp;quot;ssh hostname&amp;quot;, I thought it would be nice to open a terminal to all of the prod hosts from a script. then i thought it would be good to give it an alias.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Linux_Bash_%26_Shell&amp;diff=21</id>
		<title>Linux Bash &amp; Shell</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Linux_Bash_%26_Shell&amp;diff=21"/>
		<updated>2025-02-28T18:34:22Z</updated>

		<summary type="html">&lt;p&gt;Nigel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Continuing the theme of &#039;&#039;&#039;[[Random stuff]]&#039;&#039;&#039; and more particularly of &#039;&#039;&#039;[[Code Snippets]]&#039;&#039;&#039; here is some shell scripts for Linux&lt;br /&gt;
&lt;br /&gt;
==The Scripts==&lt;br /&gt;
&lt;br /&gt;
===[[Open several ssh terminals at once]]==&lt;br /&gt;
&lt;br /&gt;
I had already set up password less terminals opening to several common hosts with the format &amp;quot;ssh hostname&amp;quot;, I thought it would be nice to open a terminal to all of the prod hosts from a script. then i thought it would be good to give it an alias.&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
	<entry>
		<id>https://wiki.seaoffate.net/index.php?title=Linux_Bash_%26_Shell&amp;diff=20</id>
		<title>Linux Bash &amp; Shell</title>
		<link rel="alternate" type="text/html" href="https://wiki.seaoffate.net/index.php?title=Linux_Bash_%26_Shell&amp;diff=20"/>
		<updated>2025-02-28T18:24:41Z</updated>

		<summary type="html">&lt;p&gt;Nigel: Created page with &amp;quot;==Introduction==  Continuing the theme of Random stuff and more particularly of&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Continuing the theme of [[Random stuff]] and more particularly of&lt;/div&gt;</summary>
		<author><name>Nigel</name></author>
	</entry>
</feed>