The Internet Connection Sharing tab can be found by viewing the Ethernet Properties of a network connection. This can be used to select a Hyper-V virtual switch in order to enable a Hyper-V virtual switch of the “Internal” network style Internet access via the Hyper-V server.
But what if you’d like to have more than one lab network setup in this way? PowerShell to the rescue:
If you implement infrastructure as code with something such as ansible, you will be able to spin up a new VM and automatically setup the software.
An interesting side effect of this is you can wipe and reload a system, running say System Center, over night just before the trial period ends. Perhaps this a gray area, getting around the intention of a trial period, but an interesting side effect none the less.
Using infrastructure as code requires that you back up everything, in order to restore things if desired. This means the home pc can also be reloaded at will, if network drives are used or some other backup method is used, leading to the fastest performance possible when otherwise a PC has the tendency to slow down over time.
Modify script to work in an SELinux enabled environment
Modify script to work with multisite
Modify script to allow a larger upload size
Run Docker Compose
Configure WordPress for multisite
Setup DNS entries & modify sites to use full domain names
What is great about this Docker setup is by stopping and then restarting the Docker Compose, WordPress will automatically be updated if a new release has come out. With a High Availability setup, you can restart one WordPress instance at a time, allowing for no downtime during upgrades.
# install docker sudo yum -y install docker
# add user who will be running docker to docker group sudo usermod -aG docker travis
# enable docker to start up at boot & start sudo systemctl enable docker sudo systemctl start docker
# install pip which will be used to install docker-compose sudo yum -y install python-pip
# create directory to store docker compose configuration & change to it
mkdir -p docker/wordpress
# create uploads.ini file which is used to configure a larger upload size
cat > uploads.ini
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 400M
file_uploads = On
max_execution_time = 180
# create docker-compose.yaml file
# original version: https://www.youtube.com/watch?v=pYhLEV-sRpY
cat > docker-compose.yaml
Notes on docker-compose.yaml: 1. MySQL is loaded via Container image. Data is stored in local volume. 2. MySQL & WordPress are able to interact via a local network wpsite. 3. With a Multisite configuration port 80 is required. 4. “Privileged” must be used as we are using an enforced SELinux environment.
# create directory to store wordpress files
# Start up WordPress via docker-compose
docker-compose up -d
# Configure firewall
firewall-cmd --permanent --add-port 80
Next a configuration file must be modified: ./html/wp-config-sample.php
Locate the string “That’s all, stop editing! …” and add the following lines after:
After logging into the WordPress site for the first time browse to: Tools -> Network, choose subdomains or subfolders and follow directions.
Finally, you can use a domain instead of a subdomain or subfolder by first creating a site with a subdomain or subfolder then, after configuring the domain in DNS, go back to the site and modifying the URL with the domain. For example: wp-1.com/travisloyd –> www.travisloyd.xyz