0

i'm recently working on 3-tier architecture on ubuntu virtual machines , 1 desktop and 2 servers,

Their network configuration is set to bridged Adapter in order to communicate with the wifi card directly

Machine Role
Ubuntu Desktop 22.04 Apache 2.4.52
Ubuntu Server 1 22.04 PHP-FPM 8.1
Ubuntu Server 2 22.04 MySQL 8.0.36
  • First i've enabled proxy,proxy_fcgi and rewrite modules because apache and phpfpm communicate using fastcgi protcol , configured my apache virtual host and set sethandler ip to phpFPM_serverIP:port(9000) ,reloaded the apache2 service and checked the service and it works fine

My Virtual Host

VH Configuration

  • after that i passed to phpfpm server where i set the listen directive to phpFPM_serverIP:port(9000) ,reloaded the service phpfpm ,checked it and everything works fine also

php_fpm configuration

  • same steps for mysql where i set the bind-address to mysqlserverIp restarted the service and it works fine also

mysql server configuration

Test phase

my project hierarchy

  • while testing without the filesMatch directive ,the access to a php file such as types.php is fine

types.php code

types.php output

  • but when adding the mentionned directive in order to set the connection between phpfpm and apache ,he returns file not found , i tought maybe i should change the file permissions which what i have done as u see in the hierarchy but i get the same output , i've also checked the configuration files in both phpfpm and apache machines (especially the ip addresses) and the values are well-set ,also chekced the firewall permissions on both sides and they allow from any host with port 9000(phpfpm) and 80(apache)

the main error

  • also i've asked chatgpt about the error , he suggested same solutions as mentionned before but nothing works

Any Solutions guys cuz i'm a newbie to handling these type of architectures and i wasted too many time in searching for a solution , and thanks in advance

Note : all the process that i've done is following chatgpt (as i said before i'm a newbie XD)

chat.openai.com/share/cbb85936-245a-47c1-95e3-02f20c759936 , in this link u'll find the error that i've got when accessing to apache error log

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.