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:16] – oemb1905 | computing:selfhostedwp [2023/06/29 04:36] – oemb1905 | ||
---|---|---|---|
Line 11: | Line 11: | ||
------------------------------------------- | ------------------------------------------- | ||
- | This tutorial is for setting up a self-hosted WordPress instance on Debian GNU/ | + | This tutorial is for setting up a self-hosted WordPress instance on Debian GNU/Linux. This tutorial assumes you have some familiarity setting up a LAMP stack. If you need help with that, check out [[https:// |
- | sudo apt install php-common php-cgi php-cli php-zip php-mysql php-mbstring php-intl php-fpm php-curl php-gd php-imagick php-xml php-xmlrpc php-soap php-opcache php-apcu php-bcmath memcached wget unzip | + | sudo apt install |
| | ||
- | Alternately, you can specify the php version as follows: | + | Sometimes dpkg can choose which version of php you want and it's not always the version you want. In those cases, you can explicitly |
| | ||
sudo apt-get install php8.2-{common, | sudo apt-get install php8.2-{common, | ||
| | ||
- | Okay, let' | + | Apache2 will set up a 000-default.conf automatically and your host should now resolve. Be sure to set up TLS with certbot. Here' |
+ | |||
+ | *** | ||
+ | |||
+ | In this particular configuration, | ||
| | ||
+ | sudo apt remove libapache2-mod-php --purge | ||
+ | sudo a2enmod ssl | ||
+ | sudo a2enmod headers | ||
+ | sudo a2enmod cache | ||
sudo a2enmod rewrite | sudo a2enmod rewrite | ||
+ | sudo a2enmod setenvif | ||
+ | sudo a2dismod php8.2 | ||
+ | sudo a2dismod mpm_prefork | ||
+ | sudo a2enmod mpm_event | ||
+ | sudo a2enmod proxy | ||
sudo a2enmod proxy_fcgi | sudo a2enmod proxy_fcgi | ||
- | sudo a2enconf | + | sudo a2enconf |
+ | sudo a2enconf php8.2-cgi | ||
sudo apache2ctl configtest | sudo apache2ctl configtest | ||
- | + | | |
- | Move index.php to the top priority as follows: | + | sudo systemctl restart php8.2-fpm |
+ | |||
+ | 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. 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 / | sudo nano / | ||
< | < | ||
- | | + | |
+ | *** | ||
Optionally, we can install phpmyadmin, and if you do, you should secure as follows: | Optionally, we can install phpmyadmin, and if you do, you should secure as follows: | ||
Line 189: | Line 213: | ||
</ | </ | ||
- | --- // | + | --- // |