User Tools

Site Tools


computing:selfhostedwp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:selfhostedwp [2023/06/30 04:26] oemb1905computing:selfhostedwp [2025/06/01 19:39] (current) oemb1905
Line 29: Line 29:
      
   sudo apt remove libapache2-mod-php* --purge   sudo apt remove libapache2-mod-php* --purge
 +  sudo apt install php8.3-fpm php8.3-cgi
   sudo a2enmod ssl   sudo a2enmod ssl
   sudo a2enmod headers   sudo a2enmod headers
   sudo a2enmod cache   sudo a2enmod cache
   sudo a2enmod rewrite   sudo a2enmod rewrite
-  sudo a2enmod setenvif +  sudo a2enmod setenvif 
 +  sudo a2dismod php8.1
   sudo a2dismod php8.2   sudo a2dismod php8.2
 +  sudo a2dismod php8.3
   sudo a2dismod mpm_prefork   sudo a2dismod mpm_prefork
   sudo a2enmod mpm_event   sudo a2enmod mpm_event
   sudo a2enmod proxy   sudo a2enmod proxy
   sudo a2enmod proxy_fcgi   sudo a2enmod proxy_fcgi
-  sudo a2enconf php8.2-fpm +  sudo a2enconf php8.3-fpm 
-  sudo a2enconf php8.2-cgi+  sudo a2enconf php8.3-cgi
   sudo apache2ctl configtest     sudo apache2ctl configtest  
   sudo systemctl restart apache2   sudo systemctl restart apache2
-  sudo systemctl restart php8.2-fpm+  sudo systemctl restart php8.3-fpm
  
 There are two standard ways to configure php-fpm. One of those is to use ProxyPassReverse, however, this will disable the use of .htaccess in your WordPress root which is not ideal. The next common way which I prefer and use here, is to add a FilesMatch condition to your virtual host as follows. Within the <Include> and </Include> portion of your default-ssl.conf virtual host, add something like: There are two standard ways to configure php-fpm. One of those is to use ProxyPassReverse, however, this will disable the use of .htaccess in your WordPress root which is not ideal. The next common way which I prefer and use here, is to add a FilesMatch condition to your virtual host as follows. Within the <Include> and </Include> portion of your default-ssl.conf virtual host, add something like:
Line 189: Line 192:
   </IfModule>   </IfModule>
  
-Personally, I don't think anyone should be using ftp. Sftp is fine, and if someone needs that, here's an example of a simple sftp server using proftp:+I was getting a stubborn TLS redirect error for images. To address this, I went into ''/wp-content/themes/mytheme/header.php'' and added: 
 + 
 +  /** added this to secure images **/ 
 +  <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> 
 + 
 + 
 +Personally, I don't think anyone should be using ftp. Sftp is fine, and if someone needs that, here's an example of a simple sftp server using proftp. Noteyou can also just use ssh nowadays as openssh-server includes a ready made sftp server. I retain this for historical knowledge.
  
   sudo apt install proftpd ftp ftp-ssl    sudo apt install proftpd ftp ftp-ssl 
Line 217: Line 226:
 Refresh WordPress and it should see the sftp server and allow you to make changes that way. Note: The sftp server is public and anyone can access this with proper credentials even if it not for WordPress so use a proper password and make sure your TLS configuration is working. Your instance should now be pretty solid. The only other thing you might want is more than one WordPress site subdomain, for example, site1.cooldomain.com, site2.cooldomain.com, etc. If that's the case, then hop on over to my [[https://wiki.haacksnetworking.com/doku.php?id=computing:wpmultisite|Word Press Multisite]] tutorial.  Refresh WordPress and it should see the sftp server and allow you to make changes that way. Note: The sftp server is public and anyone can access this with proper credentials even if it not for WordPress so use a proper password and make sure your TLS configuration is working. Your instance should now be pretty solid. The only other thing you might want is more than one WordPress site subdomain, for example, site1.cooldomain.com, site2.cooldomain.com, etc. If that's the case, then hop on over to my [[https://wiki.haacksnetworking.com/doku.php?id=computing:wpmultisite|Word Press Multisite]] tutorial. 
  
- --- //[[jonathan@haacksnetworking.org|oemb1905]] 2023/06/30 03:23//+ --- //[[alerts@haacksnetworking.org|oemb1905]] 2025/06/01 19:37//
computing/selfhostedwp.1688099212.txt.gz · Last modified: 2023/06/30 04:26 by oemb1905