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:36] – oemb1905 | computing:selfhostedwp [2023/06/29 05:11] – oemb1905 | ||
---|---|---|---|
Line 21: | Line 21: | ||
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: | 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 certbot --authenticator standalone --installer apache -d wordpress.com --pre-hook " | ||
+ | crontab -e | ||
+ | <30 2 * * 1 / | ||
| | ||
- | 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, | + | 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 48: | Line 51: | ||
</ | </ | ||
- | 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. | + | 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. |
- | + | ||
- | sudo nano / | + | |
- | < | + | |
- | *** | + | sudo apachectl -M | grep ' |
+ | sudo apachectl -M | grep ' | ||
+ | sudo apache2ctl configtest | ||
- | Optionally, we can install phpmyadmin, and if you do, you should secure as follows: | + | The output of mpm should show mpm_event and the output of proxy grep should show proxy_module and proxy_fcgi_module in use. If not, trace back over the steps above and see what went wrong. As for configtest, it should either tell you what's wrong or return " |
+ | 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 something as heavy as phpmyadmin, you can optionally create a phpinfo page instead: | ||
+ | |||
+ | sudo nano / | ||
+ | sudo htpasswd -c / | ||
+ | sudo nano / | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <Require valid-user> | ||
+ | |||
+ | Use these tools to make sure your handler and multi-processing module are configured to your preference and functional. After that's all working, let's make sure that your WordPress index.php is set to top priority as follows: | ||
| | ||
- | Close and save the file. Let's set up a database now for the WordPress instance: | + | sudo nano / |
+ | < | ||
+ | |||
+ | Close and save the file. Let' | ||
sudo mysql -u root -p | sudo mysql -u root -p |