Setup PHP 7.4 FPM with Apache on fresh Ubuntu Instance
sudo apt update
sudo apt upgrade
Install apache
sudo apt install apache2 libapache2-mod-fcgid
let controller = new AbortController(); | |
const trans = await fetch('/api/something.json',{cache: "only-if-cached", mode: "same-origin", signal: controller.signal}).then(res => { | |
const date = res.headers.get("date"), dt = date ? new Date(date).getTime() : 0; | |
console.log('hit cache'); | |
if (dt < (Date.now() - 100000)) { | |
console.log('refresh time'); | |
// if older than 1 minute | |
controller.abort() | |
controller = new AbortController(); | |
return fetch('/api/something.json', {cache: "reload", mode: "same-origin", signal: controller.signal}); |
//The CSS & JS part is completely based on this W3S article: https://www.w3schools.com/howto/howto_js_portfolio_filter.asp | |
function shortcode_posts_showcase() { | |
$args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'post' | |
); | |
$query = new WP_Query($args); | |
$posts_result = $query->posts; |
Setup PHP 7.4 FPM with Apache on fresh Ubuntu Instance
sudo apt update
sudo apt upgrade
Install apache
sudo apt install apache2 libapache2-mod-fcgid
# The idea is, we don't install certificates on WSL, instead we install them on | |
# Windows and point the path at WSL Apache/Ngnix configuration file. | |
# We use mkcert to generate certificates. | |
# https://github.com/FiloSottile/mkcert | |
# Install mkcert on Linux. Even though we don't generate certificate here, | |
# I am installing this only to check the constant is properly set or not. | |
# If you're Linux Ninja like my friend Bombay, you could do it without | |
# This package for sure. |
# Run windows Power Shell as administrator | |
pip install virtualenv | |
pip install virtualenvwrapper-win | |
# navigate the power shell to your project directory | |
virtualenv dev | |
cd dev | |
Set-ExecutionPolicy AllSigned | |
Set-ExecutionPolicy RemoteSigned | |
cd .. | |
.\dev\Scripts\activate |
version: "2" | |
services: | |
transmission: | |
image: linuxserver/transmission | |
container_name: transmission | |
environment: | |
- PUID=1001 | |
- PGID=1001 | |
- USER=username #optional | |
- PASS=password #optional |
api: | |
dashboard: true | |
entryPoints: | |
http: | |
address: ":80" | |
https: | |
address: ":443" | |
providers: |
version: "3" | |
networks: | |
proxy: | |
external: true | |
services: | |
public_apache: | |
image: httpd | |
labels: |
version: '3' | |
services: | |
traefik: | |
image: traefik:v2.0 | |
container_name: traefik | |
restart: unless-stopped | |
security_opt: | |
- no-new-privileges:true | |
networks: |