- Spin up a new App server, choose PHP 8
- SSH into it and run
sudo -ito become root - Run
pecl install swooleand enable what you need. (I disabled curl as it did not work for me) - Add a new Site to your server and use git to pull in your Laravel project that has Octane installed.
- Point your DNS to your new site
- Enable SSL using Lets Encrypt
- Change your new Sites Nginx settings to (assuing your site is named octane.example.com):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ------------------------------------------------ | |
| # Config files are located in /etc/wireguard/wg0 | |
| # ------------------------------------------------ | |
| # ---------- Server Config ---------- | |
| [Interface] | |
| Address = 10.10.0.1/24 # IPV4 CIDR | |
| Address = fd86:ea04:1111::1/64 # IPV6 CIDR | |
| PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started | |
| PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deb http://deb.debian.org/debian buster main contrib non-free | |
| deb-src http://deb.debian.org/debian buster main contrib non-free | |
| deb http://deb.debian.org/debian buster-updates main contrib non-free | |
| deb-src http://deb.debian.org/debian buster-updates main contrib non-free | |
| deb http://deb.debian.org/debian buster-backports main contrib non-free | |
| deb-src http://deb.debian.org/debian buster-backports main contrib non-free | |
| deb http://security.debian.org/debian-security/ buster/updates main contrib non-free |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html {{ HTML_ATTRS }}> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id={{ ENV.GA_ID }}"></script> | |
| <script> | |
| console.log(`GA_ID: {{ ENV.GA_ID }}`) | |
| </script> | |
| <head> | |
| {{ HEAD }} | |
| </head> | |
| <body {{ BODY_ATTRS }}> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Get Preview Image from Youtube video link (not from embeded code) and download it if video exist | |
| * @author Maxim Ishchenko <[email protected]> | |
| * @version 1.0* | |
| * @uses | |
| * | |
| * $getThumbs = new YoutubeThumbs('https://youtu.be/xxxxxxxxxxx', 'quality', 'directory'); | |
| * echo '<img src="'.$getThumbs->getThumbnail().'"/>'; |
When setting these options consider the following:
- How long is your average request?
- What is the maximum number of simultaneous visitors the site(s) get?
- How much memory on average does each child process consume?
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function swphp() { | |
| versions=("7.4" "8.0") | |
| for i in "${versions[@]}"; do | |
| if [[ "$i" = $1 ]]; then | |
| brew unlink php && brew link --overwrite --force php@$1 | |
| echo "PHP changed to "$1 | |
| return | |
| fi | |
| done |