Both sides previous revisionPrevious revisionNext revision | Previous revision |
servers:windows:nginx:friendica [2025/10/13 10:03] – [PHP-FPM] Sean Rhone | servers:windows:nginx:friendica [2025/10/13 13:30] (current) – [WSL] Sean Rhone |
---|
| |
* [[windows;11_ltsc_server|Windows 11 (24H2)]] | * [[windows;11_ltsc_server|Windows 11 (24H2)]] |
* [[servers;windows;nginx_php_php-cgi|nginx + PHP + PHP-CGI]] | * [[servers;windows;nginx_php_php-cgi|nginx]] |
* [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]] | * [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]] |
* [[programs;windows;git|Git]] | * [[programs;windows;git|Git]] |
* [[servers;windows;mariadb|MariaDB]] | * [[servers;windows;mariadb|MariaDB]] |
| |
| ==== WSL ==== |
| |
| * [[windows;notes;wsl|WSL]] |
| * [[windows;opensuse_tumbleweed_wsl|openSUSE Tumbleweed]] |
| * [[servers;windows;php_php-fpm_wsl|PHP + PHP-FPM]] |
| |
====== Dependencies ====== | ====== Dependencies ====== |
* https://friendi.ca/resources/requirements/ | * https://friendi.ca/resources/requirements/ |
* https://wiki.friendi.ca/docs/install#requirements | * https://wiki.friendi.ca/docs/install#requirements |
| * 2025/10/13: ''php-posix'' is required ((no known alternative on Windows, hence WSL)) |
| |
"wsl.exe" --distribution openSUSE-Tumbleweed | "wsl.exe" --distribution openSUSE-Tumbleweed --user root -- zypper install --no-confirm php-composer2 php8-curl php8-fileinfo php-gd php8-gmp php8-pdo php8-mbstring php8-intl php8-mysql php8-zip php8-openssl php8-posix php8-opcache |
| |
sudo zypper install php-composer2 php8-curl php8-fileinfo php-gd php8-gmp php8-pdo php8-mbstring php8-intl php8-mysql php8-zip php8-openssl php8-posix php8-opcache | |
| |
exit | |
| |
====== Download Source ====== | ====== Download Source ====== |
===== PHP ===== | ===== PHP ===== |
| |
"wsl.exe" --distribution openSUSE-Tumbleweed | "wsl.exe" --distribution openSUSE-Tumbleweed --user root -- nano '/etc/php8/fpm/php-fpm.d/social.conf' |
| |
sudo -e '/etc/php8/fpm/php-fpm.d/social.conf' | |
| |
<code> | <code> |
===== Composer ===== | ===== Composer ===== |
| |
"wsl.exe" --distribution openSUSE-Tumbleweed | **** |
| |
cd '/tmp' && '/usr/bin/composer' --working-dir='/mnt/c/www/social' --no-cache install --no-dev | "wsl.exe" --distribution openSUSE-Tumbleweed -- '/usr/bin/composer' --working-dir='/mnt/c/www/social' --no-cache install --no-dev |
| |
exit | ====== nginx + PHP-FPM Configuration ====== |
| |
====== nginx + PHP-CGI Configuration ====== | ===== PHP-FPM ===== |
| |
===== PHP-CGI ===== | |
| |
"notepad.exe" "%SystemDrive%\www\nginx\default.d\social.conf" | "notepad.exe" "%SystemDrive%\www\nginx\default.d\social.conf" |
| |
"%SystemDrive%\www\scripts\social\PHP-FPM.bat" | "%SystemDrive%\www\scripts\social\PHP-FPM.bat" |
| |
==== logrotate ==== | |
| |
* Sets ''php-fpm.log'' permissions so ''php-fpm'' can run non-root | |
* TODO: Put under separate PHP-FPM conf page | |
| |
"wsl.exe" --distribution openSUSE-Tumbleweed | |
| |
sudo rm -f '/var/log/php-fpm.log' && echo 'x' | sudo tee '/var/log/php-fpm.log' > '/dev/null' | |
| |
sudo -e '/etc/logrotate.d/99-php-fpm.log' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/logrotate.d/99-php-fpm.log' | |
| |
<code> | |
'/var/log/php-fpm.log' { | |
create '0640' 'CHANGEME' 'CHANGEME' | |
daily | |
rotate 0 | |
nocompress | |
missingok | |
notifempty | |
nocopy | |
nomail | |
noshred | |
} | |
| |
# End</code> | |
| |
sudo logrotate --force '/etc/logrotate.d/99-php-fpm.log' | |
| |
exit | |
| |
===== Update ===== | ===== Update ===== |
====== Settings ====== | ====== Settings ====== |
| |
* TODO | * ''x'' is WSL IP shown on host |
| |
| ipconfig |
| |
| "notepad.exe" "%SystemDrive%\www\social\config\local.config.php" |
| |
| <code> |
| 'database' => [ |
| 'hostname' => 'x',</code> |
| |
| <code> |
| 'system' => [ |
| 'basepath' => '/mnt/c/www/social',</code> |
| |
====== Files ====== | ====== Files ====== |
"wsl.exe" --distribution openSUSE-Tumbleweed -- '/usr/sbin/php-fpm' -c '/etc/php8/fpm/php-fpm.d/social.conf' -F | "wsl.exe" --distribution openSUSE-Tumbleweed -- '/usr/sbin/php-fpm' -c '/etc/php8/fpm/php-fpm.d/social.conf' -F |
| |
'/usr/bin/php' '/srv/www/social/bin/console.php' worker | "wsl.exe" --distribution openSUSE-Tumbleweed -- '/usr/bin/php' '/mnt/c/www/social/bin/console.php' worker |
| |
"wsl.exe" --distribution openSUSE-Tumbleweed -- '/usr/bin/composer' --working-dir='/mnt/c/www/social' --no-cache install --no-dev | "wsl.exe" --distribution openSUSE-Tumbleweed -- '/usr/bin/composer' --working-dir='/mnt/c/www/social' --no-cache install --no-dev |
| |