home       inleiding       sysadmin       services       links       bash       werk       nothing      

apache2, php, mySQL on RedHat8 compatible linux

(nota's bvdb 11 maart 2022)

  1. RH8 is bridged en bereikbaar via ssh vanaf mint20
  2. installatie software httpd mysql php
  3. testen van apache2 -- geen lynx / via firefox bridged mint lukt niet
  4. config file -- /etc/httpd/conf/httpd.conf (is ok)
    site -- /var/www/html (is ok)
  5. enable/start httpd
    $ sudo systemctl status httpd
    $ sudo systemctl enable httpd
    $ sudo systemctl start httpd
  6. created index.html in /var/www/html
  7. created index.php in /var/www/html
  8. installing lynx
    update yum:
    $ sudo dnf makecache --refresh
    $ sudo yum makecache --refresh
    $ sudo dnf install dnf-plugins-core
    $ sudo dnf upgrade
    $ sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    $ sudo dnf config-manager --set-enabled powertools
    $ sudo dnf repolist
    appstream                  Rocky Linux 8 - AppStream
    baseos                     Rocky Linux 8 - BaseOS
    epel                       Extra Packages for Enterprise Linux 8 - x86_64
    epel-modular               Extra Packages for Enterprise Linux Modular 8 - x86_64
    extras                     Rocky Linux 8 - Extras
    powertools                 Rocky Linux 8 - PowerTools

      $ sudo yum install lynx
     

  9. we have a default site // index.php doesnt work
    [user@rocky85-001 html] $ rpm -qa | grep php
     php-7.2.24-1.module+el8.4.0+413+c9202dda.x86_64
     php-common-7.2.24-1.module+el8.4.0+413+c9202dda.x86_64
     php-fpm-7.2.24-1.module+el8.4.0+413+c9202dda.x86_64
     php-cli-7.2.24-1.module+el8.4.0+413+c9202dda.x86_64

    but php is installed
     

  10. RH8-firewall zit httpd in de weg
    $ sudo firewall-cmd --list-all-zones
    $ sudo firewall-cmd --zone=public --add-service=http --permanent
    $ sudo firewall-cmd --reload
    en nu werkt het met de index.html en de index.php

  11. ... en nu nog wordpress erop ...
     
  12. installeer mysql-server
    $ sudo yum install mysql-server
    $ sudo systemctl status mysql
    ● mysqld.service - MySQL 8.0 database server
    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
    Active: inactive (dead)

    $ sudo systemctl enable mysqld
    $ sudo systemctl start mysqld 
    $ sudo systemctl status mysqld

    ● mysqld.service - MySQL 8.0 database server
    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
    Active: active (running) since Fri 2022-03-11 14:24:04 CET; 46s ago

     

  13. database en user in mysql voor wordpress
    *``$  ``* ``sudo mysql -u root``
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 8
    Server version: 8.0.26 Source distribution
     
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    +--------------------+
    4 rows in set (0.01 sec)
     
    mysql> create database wpress;
    Query OK, 1 row affected (0.01 sec)
     
    mysql> use wpress;
    Database changed
     
    mysql> create user 'wpuser'@'localhost' identified by 'sdf12345';
    Query OK, 0 rows affected (0.01 sec)
     
    mysql> grant all privileges on *.* to 'wpuser'@'localhost';
    Query OK, 0 rows affected (0.01 sec)
     
    exit;
  14. download en extract wordpress
    $ sudo wget https://wordpress.org/latest.tar.gz
    $ sudo tar -xvf latest.tar.gz
    $ ls -l
    total 18348
    -rw-r--r--. 1 root   root      53792 Mar 11 13:37 index.html
    -rw-r--r--. 1 root   root        306 Mar 11 13:41 index.php
    -rw-r--r--. 1 root   root   18722604 Mar 11 01:40 latest.tar.gz
    drwxr-xr-x. 5 nobody nobody     4096 Mar 11 01:39 wordpress

    in firefox op linuxmint: http://192.168.5.101/wordpress
    Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
    de in RH8 toegevoegde default versie php 7.2 wordt niet meer ondersteund door wordpress. bijgevolg moeten we een update van de php installeren (volgend punt).
     

  15. update van php
    $ sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
    $ sudo dnf module reset php
    $ sudo dnf module enable php:remi-7.4
    $ sudo dnf install php php-mysqlnd
    $ sudo dnf install php-gd php-zip php-mcrypt php-json php-xml php-gettext php-curl php-intl
    $ sudo systemctl restart httpd
    $ sudo systemctl restart mysqld