Skip to content

Instantly share code, notes, and snippets.

View WillSquire's full-sized avatar

Will Squire WillSquire

View GitHub Profile
@WillSquire
WillSquire / install_mod_expire_freebsd.md
Last active April 8, 2024 13:10
Install and configure mod_expire on FreeBSD

Install and configure mod_expire on FreeBSD

Open Apache config file:

sudo ee /usr/local/etc/apache24/httpd.conf

Ensure the following is uncommented, then save and exit the file (remove # if present at the start of the line):

@WillSquire
WillSquire / opcache_install.md
Last active April 1, 2024 23:53
OpCache install & configuration

OpCache

Installation

Install OpCache on FreeBSD with (note 56 resembles the current PHP version 5.6):

cd /usr/ports/www/php56-opcache && sudo make config-recursive install distclean

Configuration

@WillSquire
WillSquire / ubuntu_server_setup.md
Last active September 24, 2023 18:32
Ubuntu server setup

Ubuntu Server

The steps taken to setup a Ubuntu web server.

Update

Update Aptitude:

sudo apt-get update
@WillSquire
WillSquire / install_apache_freebsd.md
Last active June 12, 2023 01:31
Install and configure Apache on FreeBSD

Apache

Installation

First navigate to Apache in the ports collection, then install the port at the given location and clean (note Apache version here is 24, this may change in future). For the configuration, selecting the mpm_event_module (async) configuration to compile down with. This handels concurrency better then mpm_worker_module by using a single listener thread, but is also multithreaded (where as mpm_prefork_module is not multithread and instead uses processes). Note that mpm_event_module will change the PHP module used:

cd /usr/ports/www/apache24 && sudo make config-recursive install distclean

Configuration

@WillSquire
WillSquire / install_mysql_freebsd.md
Last active September 7, 2021 17:55
Install and configure MySQL on FreeBSD

MySQL

Install

Using the path to the current mysqlXX-server port, download, install and clean (note the MySQL version here is 5.6, but this can change as future versions get released):

sudo make config-recursive install distclean -C /usr/ports/databases/mysql56-server

Essential:

  • lodash: Function utility lib.

Case specific:

To try:

Save docker images to file:

docker save -o destination/file.tar docker_image/name

Load docker images from file:

docker load -i destination/file.tar

Requires the passcode for the .pfx file prior.

Extract .key file from .pfx file (will need to set a password here too):

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]

Extract .crt file from .pfx file:

openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]

Run this is the terminal:

openssl req -x509 -out localhost.crt -keyout localhost.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=localhost' -extensions EXT -config <( \
   printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")

Reference:

@WillSquire
WillSquire / freebsd_git_deploy_server.md
Last active June 21, 2019 09:04
FreeBSD GIT deploy server - Deploy application to server via GIT push

FreeBSD GIT deploy server

Deploy software from a local machine to a remote machine via GIT push.

Server-side

Download and install GIT for the remote FreeBSD system with:

cd /usr/ports/devel/git && sudo make config-recursive install distclean