1

Topic: Other virtualhost or sites

Before my installation of iRedMail on Debian trixie, I installed and configured MariaDB and PhpMyAdmin with use under Nginx.
All worked fine and I could get to the PhpMyAdmin portal throught the web browser and access the different databases as I wanted.

After installation of iRedMail, the configuration as been copied in a backup folder of nginx for old configurations.
I could see that the 'fastcgi_pass' was wrong and was no more a unix file to access but a service to listen on port 9999 on localhost.

I changed this but did not get the configuration working even with this changed.

So I checked the templates folder for nginx with the SOGo, Roundcube, iRedAdmin, etc. configurations and I could see there a template file for Adminer.

I opened it and followed the steps written inside this file to download the latest version and stored it in the /opt/www/adminer folder and did the 'chmod' as written.

I had a 404 error showing that the /var/www/html/adminer file or folder was not found.

So I created a adminer folder in the /var/www/html folder as requested and created also a link file to the /opt/www/adminer/latest.php file and then I got a 403 error that the file was not accessible.

How can I get adminer work ?

Why I cannot create other sites in the sites-available folder of nginx with just the change of the fastcgi_pass configuration to access the service instead of the unix file ?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Other virtualhost or sites

I found the issue.
In the /etc/nginx/sites_available/00-default-ssl.conf it was missing a line to with 'include /etc/nginx/templates/adminer.tmpl;'.

I added this line and I could get the http://<myservername>.<mydomain>.<ext>/adminer work with the latest.php file downloaded from adminer web site as described in the adminer.tmpl file.

3

Re: Other virtualhost or sites

But it does not explain why I cannot access PhpMyAdmin site.

I followed the tutorial found HERE

My config file in /etc/nginx/sites-available is as following:

server {
    listen 80;
    listen [::]:80;
    server_name pma.<mydomain>.<ext>;
    root /var/www/phpmyadmin/;
    index index.php index.html index.htm index.nginx-debian.html;

    access_log /var/log/nginx/phpmyadmin_access.log;
    error_log /var/log/nginx/phpmyadmin_error.log;

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

    location ~ ^/(doc|sql|setup)/ {
    deny all;
    }

    location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9999;
    include snippets/fastcgi-php.conf;
    }

    location ~ /\.ht {
    deny all;
    }

}

The only thing I changed in the provided config file is the 'fastcgi_pass unix:/run/php/php8.2-fpm.sock;' which is now 'fastcgi_pass 127.0.0.1:9999;' as the '.sock' does not exist anymore after the iRedMail installation.

Do somebody have a clue?

4

Re: Other virtualhost or sites

In Firefox web browser, if I press CTRL+U, I get some php code, but the page displayed is blank.
I am missing something with the fastcgi parameters to get the PHP code display correctly.

5

Re: Other virtualhost or sites

As mentioned in iRedMail installation tutorials, iRedMail requires a fresh OS.
You can install iRedMail on a fresh OS first, then install other applications you need.

6

Re: Other virtualhost or sites

I have found the issue why the new virtualhost was not working showing the page generated with the php scripts, it was because of missing the line with the 'include /etc/nginx/templates/hsts.tmpl;'.

Here is my virtualhost file I use to display the PhpMyAdmin login page following the tutorial I followed linked in one of my previous posts :

server {
    listen 80;
    listen [::]:80;
    server_name pma.<mydomain>.<ext>;
    root /var/www/phpmyadmin/;
    index index.php;

    access_log /var/log/nginx/phpmyadmin_access.log;
    error_log /var/log/nginx/phpmyadmin_error.log;

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

    location ~ ^/(doc|sql|setup)/ {
        deny all;
    }

    location ~ \.php$ {
        include fastcgi_params;
        include /etc/nginx/templates/hsts.tmpl;
        fastcgi_pass 127.0.0.1:9999;
        include snippets/fastcgi-php.conf;
    }

    location ~ /\.ht {
        deny all;
    }

    allow 127.0.0.1;
    deny all;
}

After adding this 'include' the page display shows the login page correctly instead of a blank page.