fotografeer.nl

fotografeer.nl

  • Overzicht
  • Fotografeer tips
  • Blog
  • Albums
  • Categorieën
  • Sets
  • Aanvraag
Home / Essays / 2018

Share
2018/12/26

WordPress in Docker on ReadyNAS OS VM

Abstract

This blog post describes how to setup a virtualized ReadyNAS OS. Docker is then installed and configured to run Wordpress and MySQL in this environment.

Disclaimers

THIS HOWTO IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THIS HOWTO OR THE USE OR OTHER DEALINGS IN THIS HOWTO.

Netgear states: "Access by SSH is not discouraged, but is recommended for advanced users only. As such, using SSH is at the user's own risk."

This is how it worked in the situation of the baseline described below. Use it at your own risk.

Prerequisites

  • PC with Windows 7 SP1 with VirtualBox installed
  • Terminal emulation software
Prior Knowledge
  • ReadyNAS OS 6
  • WordPress installation procedure
  • Debian Linux command line syntax

Baseline

Even-though several combinations of items with other versions may be able to utilize this setup, this has only been tested on the baseline mentioned here:

  • Windows 7 SP1
  • VirtualBox 5.2.22 r126460 (Qt5.6.2)
  • VMDK disk image ReadyNASOS-6.6.0-x86_64.vmdk
  • WordPress 5.0.2
  • Putty 0.63

Please note that VirtualBox 6.0 is recently released.

References

This how-to builds on great work by others. Many thanks! See the links to their respective pages.

https://en.wikipedia.org/wiki/PuTTY
https://www.virtualbox.org/
https://www.virtualbox.org/wiki/Downloads
https://www.virtualbox.org/manual/ch03.html#installation_windows
https://gilsmethod.com/how-to-edit-the-default-virtual-machine-directories-in-virtualbox
https://github.com/ReadyNAS/sdk/wiki/Setup-ReadyNAS-OS-on-VirtualBox
https://www.docker.com/why-docker
https://hub.docker.com/_/wordpress/
https://docs.docker.com/compose/wordpress/
http://powareverb.github.io/Docker-on-ReadyNAS-OS6/

Background

After spending a lot of time of setting up 2 physical ReadyNAS machines to run this website, I'm reluctant to make changes to any settings, as it can potential break current functionality. Having a VM of the ReadyNAS OS is a great alternative to be able to experiment with new settings.

Since Koken CMS seems no longer being developed further, an alternative CMS is needed. Wordpress seems to be the obvious choice here.

With some hacking, Wordpress can be installed on the native ReadyNAS OS. While doing that, some issues popped up. E.g. getting the Wordpress .htaccess (mod_rewrite) to work proved difficult. And the versions of MySQL and PHP used in ReadyNAS OS are never the latest versions, since Netgear needs to deliver a stable OS for all it's customers, I guess. Latest versions of WordPress plugins may have requirements on MySQL that cannot be met.

WordPress runs on 3 main components:

  • Server-side scripting language: PHP
  • Web server: Apache (NGINX)
  • Database: MySQL (MariaDB)

Using Docker containers allows for a free choice of make and version for these 3 components without having to make changes to the ReadyNAS OS.

Below you can find the steps to come to a setup of Wordpress in Docker on ReadyNAS OS VM. Three product are used to enable this setup:

  • VMM: Virtual Box (to run ReadyNAS OS in a virtual machine on Windows)
  • Containerization: Docker (to run WordPress inside containers on the virtualized ReadyNAS OS)
  • CMS: WordPress (to create and manage your website)

VirtualBox

A Hypervisor (VMM) is needed to run the ReadyNAS OS Virtual Machine. First download VirtualBox. Then follow the installation instructions.

Set your default location to a disk with ample available space, so the VM for ReadyNAS OS that we are about to create can grow in size.

Now setup the ReadyNAS OS on VirtualBox.

There are several ways to setup the network connections for the virtual machine. Here we use NAT. Make sure to configure some NAT port translation to be able to connect to the VM from your Windows applications. In the VirtualBox Manager, select Network -> Adapter 1 -> Port forwarding.
Use the + button on the right to add rules for:

  • SSH 22 -> 22
  • HTTP 80 -> 80
  • HTTPS 433 -> 433
  • MySQL 3306 -> 3306
  • WordPress (on Docker) 8000 -> 8000
  • ReadyNAS OS configuration

    Browse to http://localhost/ to access the ReadyNAS Admin Page.

    Authenticate with default ReadyNAS Admin username and password:
    admin
    password

    Follow the instructions on screen as if you were setting up a physical ReadyNAS. Note the provided Hostname nas-XX-XX-XX. You might need it later on. Part of the procedure is to change your default admin password.

    Authenticate again with the admin username and (new) password.

    A pop-up window will alert you of the availability of new firmware. Upgrade to the new firmware version. When the progress bar almost reaches the far right, normally it would auto-refresh once the installation is complete. I needed to refresh the browser to see the admin page again.

    Go to "Settings" and enable "SSH".

    Docker

    Got to "Apps" -> "Available Apps".

    Click the Install button below the Docker CLI logo. Wait for the installation to finish.The Docker CLI will show up in the "Installed Apps" with the switch set to on.

    Now switch to your terminal emulator on Windows and login as root to localhost:22. In the terminal window, find the docker version and run the hello-world container to verify correct installation.You should see the text "Hello from Docker!" as part of the output.

    # docker -v
    Docker version 18.06.1-ce, build e68fc7a
    # docker run hello-world
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    d1725b59e92d: Pull complete
    Digest: sha256:b3a26e22bf55e4a5232b391281fc1673f18462b75cdc76aa103e6d3a2bce5e77
    Status: Downloaded newer image for hello-world:latest
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/
    

    Wordpress

    First create a location where your Docker project for Wordpress can live. In the ReadyNAS Admin page, go to the Shares tab.

    Click the "New share" button in the top right corner to create a new share called e.g. "Projects". In the terminal emulator, create the project.

    # cd /data/Projects/
    # mkdir my_wordpress_project

    The latest version of Compose can be found on https://github.com/docker/compose/releases. E.g. 1.23.2. Use this version number in the URL of the curl command. Install and test the Docker Composer.

    # curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    # chmod +x /usr/local/bin/docker-compose
    # docker-compose --version
    docker-compose version 1.23.1, build b02f1306

    Next, go to the new project folder in the "Projects" share and follow the instructions below (based on the "Quickstart: Compose and WordPress" page) to create a YAML file that can be use by Docker Compose to retrieve and start the needed containers.

    # cd my_wordpress_project/
    # vi docker-compose.yml
    version: '3.3'
    services:
       db:
         image: mysql:5.7
         volumes:
           - db_data:/var/lib/mysql
         restart: always
         environment:
           MYSQL_ROOT_PASSWORD: somewordpress
           MYSQL_DATABASE: wordpress
           MYSQL_USER: wordpress
           MYSQL_PASSWORD: wordpress
       wordpress:
         depends_on:
           - db
         image: wordpress:latest
         ports:
           - "8000:80"
         restart: always
         environment:
           WORDPRESS_DB_HOST: db:3306
           WORDPRESS_DB_USER: wordpress
           WORDPRESS_DB_PASSWORD: wordpress
    volumes:
        db_data: {}
    # docker-compose up -d
    Creating network "my_first_project_default" with the default driver
    Creating volume "my_first_project_db_data" with default driver
    Pulling db (mysql:5.7)...
    5.7: Pulling from library/mysql
    a5a6f2f73cd8: Pull complete
    936836019e67: Pull complete
    283fa4c95fb4: Pull complete
    1f212fb371f9: Pull complete
    e2ae0d063e89: Pull complete
    5ed0ae805b65: Pull complete
    0283dc49ef4e: Pull complete
    a7905d9fbbea: Pull complete
    cd2a65837235: Pull complete
    5f906b8da5fe: Pull complete
    e81e51815567: Pull complete
    Pulling wordpress (wordpress:latest)...
    latest: Pulling from library/wordpress
    a5a6f2f73cd8: Already exists
    633e0d1cd2a3: Pull complete
    fcdfdf7118ba: Pull complete
    4e7dc76b1769: Pull complete
    c425447c8835: Pull complete
    75780b7b9977: Pull complete
    33ed51bc30e8: Pull complete
    7c4215700bc4: Pull complete
    d4f613c1e621: Pull complete
    de5465a3fde0: Pull complete
    6d373ffaf200: Pull complete
    991bff14f001: Pull complete
    d0a8c1ecf326: Pull complete
    aa3627a535bb: Pull complete
    a36be75bb622: Pull complete
    98ebddb8e6ca: Pull complete
    ed6e19b74de1: Pull complete
    18b9cc4a2286: Pull complete
    dfe625c958ac: Pull complete
    Creating my_first_project_db_1_d278ded39132 ... done
    Creating my_first_project_wordpress_1_e65d5f77183a ... done
    
    # docker ps
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
    993c01433ea9        wordpress:latest    "docker-entrypoint.s…"   5 minutes ago       Up 5 minutes        0.0.0.0:8000->80/tcp   my_first_project_wordpress_1_2762b868a024
    f9ba1041050d        mysql:5.7           "docker-entrypoint.s…"   5 minutes ago       Up 5 minutes        3306/tcp, 33060/tcp    my_first_project_db_1_923ac948ded6
    


    Browse to http://localhost:8000 to see the WordPress setup pages. Follow the instructions on screen.

    On the "Success!" page, select the "Log In" button. This will take you to the Wordpress Dashboard.

    Browse to http://localhost:8000/ to see the "My First Project" pages.

    Your setup is now ready and you are running WordPress in Docker on ReadyNAS OS VM!

Read more in Blog

Share
2018/05/17

Digitaal Tijdperk

Analoog of digitaal?

Toen in het begin van deze eeuw de digitale camera's in opmars waren moest er een afweging gemaakt worden of ik verder wilde met fotorolletjes of zou overstappen naar een digitale camera. Mijn Nikon F-801s is een prima camera maar niet digitaal.

Nikon F-801S

De ver doorontwikkelde kwaliteit van film leverde destijds nog betere resultaten dan digitale camera's. Daarnaast had ik in de loop der jaren al een behoorlijk archief met negatieven en dia's opgebouwd. Ook mijn ouders hadden nog een aardige stapel 120 (6 x 6 cm) en 135 (24 x 36 mm) negatieven liggen.

Scanner

Uiteindelijk maar besloten om een gulden middenweg te kiezen. Door de aanschaf van een high-end negatief scanner kon ik de F-801s langer blijven gebruiken en de beelden toch digitaal maken en op Internet gebruiken.

Nikon Super Coolscan 8000 ED

Na ontwikkeling van een fotorolletje via de fotospeciaalzaak werd onmiddelijk alles gescand op hoge resolutie. Toen begon ook de taak om alle oude negatieven te scannen. In de loop der jaren werd hieraan waar mogelijk tijd besteed.

Na meer dan 15 jaar, twee onderhouds beurten en een reparatie van de scanner is het dan eindelijk zover. Meer dan 15.000 negatieven en dia's gescand die bijna 600 GB aan data oplevert. Eindelijk volledig digitaal!

Analoog beeld materiaal in digitaal tijdperk

Hierdoor wordt het mogelijk om oude familie-foto's te delen.

Terug te kijken op foto opdrachten van de 1e fotocursus.

Oude portretten nogmaals gebruiken.

En recent analoog werk online te zetten.

Canton Tower

Camera

Nu de kwaliteit van de huidige digitale camera's sterk is verbeterd en het nauwelijks meer mogelijk is om een fotorolletje ontwikkeld te krijgen, heeft de onvermijdelijke overstap naar een digitale camera enkele jaren geleden plaats gevonden. Ook omdat het publiceren van digitale foto's vele malen sneller is en je meteen resultaat kan controleren.

Read more in Blog

coolscan

Share
2018/05/10

Licht - Tegenlicht

Zon in de rug

Wanneer je als beginnend fotograaf ging shoppen voor je 1e camera bij een fotospeciaalzaak in de jaren 80 en 90 werd je meestal aangeraden om "de zon in de rug" te houden bij het maken van foto's. Een simpele regel om te voorkomen dat je als beginner tegenvallende resultaten zou krijgen bij tegenlicht.

Tegenlicht

Tegenlicht treed op wanneer je tegen een lichtbron in fotografeert. Bijvoorbeeld wanneer je "de zon in het gezicht" hebt. Je kunt controleren of je tegenlicht hebt door te kijken naar de schaduw van het onderwerp. Wanneer dit enigzins in de richting van de camera wijst is er sprake van tegenlicht.

Dragonflight Fantasy Costumes bij Kasteel de Haar

Lichtmeetsystemen zijn op zoek naar een gemiddelde belichtingstijd waarbij de lichte én de donkere partijen goed weergegeven kunnen worden. Wanneer de achtergrond zoals hierboven de lucht, het kasteel en het water feller verlicht zijn dan de voorkant van het onderwerp is de consequentie dat het onderwerp te donker wordt afgebeeld. Dit is precies het probleem met tegenlicht.

Middag uur

Wanneer de zon op zijn hoogst staat is is het verschil tussen licht en schaduw het grootst en komt het licht recht van boven. Daarom wordt het vaak afgeraden om in de periode rond het middaguur foto's te maken. Het contrast is zo groot dat de achtergrond zwaar overbelicht wordt wanneer het onderwerp goed is belicht.

Lisa Lisette

Licht reflecties in de lens

Bij tegenlicht is er veel kans dat er licht in de lens valt en daar rond reflecteert wat rare effecten veroorzaakt. Met een zonnekap kun je dit zo veel mogelijk beperken maar nooit helemaal voorkomen. In deze foto zit links onderin een lichtvlek.

Dragonflight Fantasy Costumes

In het gras in de schaduw onder de voeten lijkt een soort zwevende lichtbol te zitten. Ook dit is het gevolg van licht wat reflecteert binnen in een lens.

Ellen Verwey

Soms zie je ook de vorm van de diafragma opening enkele malen in verschillende grootte terug in een foto.

The Forest Creatures
Angela Van Gemert Van Doremalen en Yvonne Van De Kemenade-van Doremalen

Inzoomen

Een pragmatische oplossing om de effecten van tegenlicht tegen te gaan is het in zoomen op je onderwerp. Hierdoor wordt je onderwerp een groter deel van het beeldoppervlak en de lichtmeter kan nu makkelijker de juiste belichting bepalen. Daarbij bestaat er nog wel een kans dat de achtergrond overbelicht wordt.

Foto bewerking

Een andere pragmatische oplossing is het gebruiken van fotobewerkings-programma's.

Daisykesie Fantasy en Janet V-d Heuvel

Door de helderheid in de foto te verhogen zorg je dat de voorkant van het onderwerp goed belicht wordt. Daardoor overbelicht je dan weer vaak de achtergrond.

Daisykesie Fantasy en Janet V-d Heuvel

De schaduwen en hoge lichten kunnen vaak nog op andere manieren gemanipuleerd worden in fotobewerkings-programma's.

Daisykesie Fantasy en Janet V-d Heuvel

Uiteindelijk blijven dit kunstgrepen en kun je beter voorkomen dan genezen.

Contrast

Om in tegenlicht situaties goede resultaten te behalen is het zaak om het contrast te leren beheersen. Dit vergt enige oefening maar levert uiteindelijk de beste resultaten. Zorg dat er meer licht van voren op het onderwerp valt. Het verschil in de lichthoeveelheid op de achtergrond en het onderwerp neemt dan af. Hiermee verlaag je het contrast. Daardoor heeft de ingebouwde lichtmeter geen probleem om een goede belichtingstijd te kiezen.

Models: Jasper de Hoog en Angela Mombers
Historical costume maker: Angela Mombers

Inflitsen

Door een flitser op je camera te plaatsen kun je zorgen voor meer licht van voren. Plaats wel een diffusor op de flitser zodat je difuus invul-licht krijgt. Daarnaast kunnen ook daglicht-lampen gebruikt worden. Professionele fotografen hebben soms complete licht installaties bij waarmee ze het contrast nog beter kunnen beheersen.

Reflectiescherm

Reflectie schermen hebben hetzelfde doel: contrastbeheersing. Binnen kun je prima een plaat tempex van de lokale bouwmarkt als reflectie scherm gebruiken. Voor buiten zijn ze minder handig omdat ze door hun vast formaat lastig te vervoeren zijn. Ze vangen veel wind en kunnen daardoor op locatie wegwaaien en breken. Vanuit milieu aspect niet wenselijk. Dan ben je beter af met een licht opvouwbaar reflectie scherm die in allerlei soorten en maten te verkrijgen zijn.

Sabine en Pauline van der Stadt

Het voordeel van het gebruik van een reflectiescherm is dat de hoeveelheid gereflecteerd licht altijd recht evenredig blijft met de hoeveelheid tegenlicht. Er treed wel wat verlies op in de hoeveelheid gereflecteerd licht. Maar het contrasverschil is vrijwel geheel opgeheven en de camera is in staat een goed belichte foto vast te leggen.

Doorzichtig

Bloemblaadjes, doorschijnende stof, glas, plastic, etc. zijn doorzichtig. Tegenlicht benadrukt dit.

Daisykesie Fantasy en Janet V-d Heuvel

Diepte

Tegenlicht veroorzaakt een lichtrand op haar en schouders. Deze lichtrand helpt om het onderwerp los te maken van de achtergrond en hiermee het gevoel van diepte te versterken.

Mir Anda

Read more in Fotografeer tips

Share
2018/05/09

Elfia 2018

De meest opvallende portretten van Elfia 2018.

Anique Waagenaar
Aimara Cosplay
Jaselant
Robin van Kemenade
Costume: R'n'D Costuming
Janet V-d Heuvel
Models: Jasper de Hoog en Angela Mombers
Historical costume maker: Angela Mombers
Mordariel

Read more in Elfia, Portret

elfia

Share
2018/03/24

Vogelperspectief

Een hoger standpunt waarbij de camera neerkijkt op het onderwerp wordt meestal aangeduidt als vogelperspectief.

Een hoog uitkijkpunt is meestal genoeg om een vogelperspectief te creëren.

Door de opkomst van drones is het mogelijk om camera's tot grote hoogtes te brengen.

Een drone op 40 meter of hoger maakt een ultiem vogelperspectief mogelijk.

Ook vanuit een vliegtuig maak je foto's met een vogelperspectief.

Read more in Fotografeer tips

View all essays by month
View all essays by category
  1. 14

    Blog

  2. 13

    Fotografeer tips

  3. 6

    Portret

  4. 6

    Elfia

View all essays by tag
  1. 9

    arduino

  2. 8

    attiny85

  3. 8

    nano

  4. 6

    elfia

  5. 2

    coolscan

Tweet
  • Overzicht
  • Fotografeer tips
  • Blog
  • Essays
  • Albums
  • Inhoud
  • Twitter
  • Facebook
© 1979-2025 Peter van Loon - fotografeer.nl - since 2003 | Built with Koken