This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
computing:selfhostedwp [2023/06/29 04:29] – oemb1905 | computing:selfhostedwp [2023/06/29 04:58] – oemb1905 | ||
---|---|---|---|
Line 19: | Line 19: | ||
sudo apt-get install php8.2-{common, | sudo apt-get install php8.2-{common, | ||
| | ||
- | In this particular configuration, I am not using libapache2-mod-php. Instead I am using mpm_event and php-fpm. This is not necessary for many smaller instances or self-hosted scenarios. If you are new to self-hosting, | + | Apache2 will set up a 000-default.conf automatically and your host should now resolve. Be sure to set up TLS with certbot. Here's my preferred method: |
+ | |||
+ | sudo apt install certbot letsencrypt python3-certbot-apache | ||
+ | sudo certbot --authenticator standalone --installer apache -d wordpress.com --pre-hook " | ||
+ | crontab -e | ||
+ | <30 2 * * 1 / | ||
+ | |||
+ | Once you have the LAMP stack setup and TLS properly configured, it's time to make some decisions on your php handler and your apache2 multi-processing module (mpm). There' | ||
| | ||
sudo apt remove libapache2-mod-php --purge | sudo apt remove libapache2-mod-php --purge | ||
Line 37: | Line 44: | ||
sudo systemctl restart apache2 | sudo systemctl restart apache2 | ||
sudo systemctl restart php8.2-fpm | sudo systemctl restart php8.2-fpm | ||
- | | ||
- | Move index.php to the top priority as follows: | ||
- | | ||
- | sudo nano / | ||
- | < | ||
- | | ||
- | Optionally, we can install phpmyadmin, and if you do, you should secure as follows: | ||
+ | There are two standard ways to configure php-fpm. One of those is to use ProxyPassReverse, | ||
+ | |||
+ | < | ||
+ | SetHandler " | ||
+ | </ | ||
+ | |||
+ | That takes care of configuring php-fpm and mpm_event. Before proceeding, navigate to your tld.domain in a web browser and make sure that your site resolves properly. If it does not, then you should debug your setup. To do that, there' | ||
+ | |||
+ | sudo apt install phpmyadmin | ||
sudo htpasswd -c / | sudo htpasswd -c / | ||
- | sudo nano / | + | sudo nano / |
- | + | ||
- | Enter the following in the file that opens: | + | |
- | + | ||
< | < | ||
< | < | ||
< | < | ||
<Require valid-user> | <Require valid-user> | ||
+ | |||
+ | If you don't need phpmyadmin, you can optionally make a phpinfo page instead: | ||
+ | |||
+ | sudo nano / | ||
+ | sudo htpasswd -c / | ||
+ | sudo nano / | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <Require valid-user> | ||
+ | |||
+ | Now, to make sure that your WordPress index.php file resolves properly to display your home page, make sure to move index.php to the top priority as follows: | ||
| | ||
+ | sudo nano / | ||
+ | < | ||
+ | |||
Close and save the file. Let's set up a database now for the WordPress instance: | Close and save the file. Let's set up a database now for the WordPress instance: | ||
Line 201: | Line 222: | ||
</ | </ | ||
- | --- // | + | --- // |