arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Host Your Own WP Blog (Debian 10, Nginx, PHP 8 & MariaDB)
#7
(05-20-2021, 05:10 AM)Mashiro Wrote: In that case you can skip the addition of the 3rd party repository for PHP 8.0.

At the step where we install PHP 8.0 in this guide you would install PHP 7.3 (ships with Debian 10 by default). Just replace "php8.0" in the packages with "php7.3". You might want to see with all packages are available that you need. In some cases they might have different names.

You can find all available PHP 7.3 packages via apt-get cache search function:
apt-get update
apt-get cache search php7.3

It will most likely output a big list with everything that contains the string "php7.3". You of course want to look for packages just starting with php7.3 and packages with php7.3- (that would be the PHP extensions like php7.3-fpm for example or php7.3-xml).

Here is a small rundown from the Debian "Buster" 10 PHP package database:
php7.3
php7.3-bcmath
php7.3-bz2
php7.3-cgi
php7.3-cli
php7.3-common
php7.3-curl
php7.3-dba
php7.3-dev
php7.3-enchant
php7.3-fpm
php7.3-gd
php7.3-gmp
php7.3-imap
php7.3-interbase
php7.3-intl
php7.3-json
php7.3-ldap
php7.3-mbstring
php7.3-mysql
php7.3-odbc
php7.3-opcache
php7.3-pgsql
php7.3-phpdbg
php7.3-pspell
php7.3-readline
php7.3-recode
php7.3-snmp
php7.3-soap
php7.3-sqlite3
php7.3-sybase
php7.3-tidy
php7.3-xml
php7.3-xmlrpc
php7.3-xsl
php7.3-zip
(from https://packages.debian.org/buster/php/)

At parts of the tutorial where we fixed something in PHP or PHP-FPM the path to the files would be /etc/php/7.3/xxx (xxx standing for the subfolders like fpm).

So you would need to adjust commands where the path is /etc/php/8.0:

This
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/8.0/fpm/php.ini
To
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.3/fpm/php.ini

I guess you get what I mean.


And the vHost for the main site would need a small change, too.

Replace:
fastcgi_pass unix:/run/php/php8.0-fpm.sock;

With:
fastcgi_pass unix:/run/php/php7.3-fpm.sock;

I think so at least. To verify that it is really so you have to look at /etc/php/7.3/fpm/pool.d/www.conf and see what it says at the listen socket path and file name. I think it is /run/php/php7.3-fpm.sock.

That's about it. The basic rundown. You leave PHP 8.0 away and install PHP 7.3. You fix things that we fixed in PHP 8.0 in PHP 7.3. And you change a bit of code for PHP processing in the Nginx vHost file.

This is brilliant many thanks @Mashiro.  I didn't know that php 7.3 came with Debian.  Thank you for the detailed suggestions of how to make a change to 7.3 from 8.0 in the tutorial.  I won't try it immediately, but am filing it away for a future install.

I'm totally driven at the moment.  So while I was trying to sleep (unsuccessfully), I wondered what it would be like to add another blog.  First I went to freenom to create a new domain.  That took some patience but by fourth try I managed to get one.  The DNS from Freenom worked instantly.

Next I followed your steps again, from the point where you create a dot.conf file for the domain.  It went effortless.  Including MariaDB and next thing I've got a second blog up and running.  So I really do not need a panel now!  Also once one has set up the servers, second blogs or websites are very fast to create.  The more one does it too, the easier it gets.

In summary the steps I followed for the second blog from your tutorial are:

1. Create an empty vHost file for the new site:

nano /etc/nginx/conf.d/newsite.tk.conf

2. Paste the following code in the file:

server {
       listen 80;
       server_name newsite.tk www.newsite.tk;

       root /var/www/newsite.tk;

       index index.html index.htm index.php home.html home.htm home.php;

       location / {
               try_files $uri $uri/ /index.php?$args;
       }

       location ~ \.php$ {
       fastcgi_pass unix:/run/php/php8.0-fpm.sock;
       include         fastcgi_params;
       fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
       fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
 }
}

Ctrl X  

3. Create a new folder tree:

mkdir -p /var/www/newsite.tk

4. Set correct ownership of folder:

chown -R nginx:nginx /var/www

5. Restart Nginx:

systemctl restart nginx

6. Create a new Database in MariaDB

mysql -u root -p

Password:  password

CREATE DATABASE newsite;

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

GRANT ALL ON newsite.* TO 'newuser'@'localhost';

FLUSH PRIVILEGES;

quit

7. Restart mariadb and nginx

systemctl restart mariadb

systemctl restart nginx

8. Create WordPress Installation

cd /var/www/newsite.tk

wget https://wordpress.org/latest.tar.gz

tar -xvf latest.tar.gz

mv /var/www/newsite.tk/wordpress/* /var/www/newsite.tk

rm -rf /var/www/newsite.tk/wordpress

rm -rf /var/www/newsite.tk/latest.tar.gz

chown -R nginx:nginx /var/www/

9. Restart Nginx

systemctl restart nginx

10. Get URL up and follow WordPress Installation Prompts
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  


Messages In This Thread


person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting