Configuring Nginx+Apache for ISPConfig 3 on Debian 11 server

Discussion in 'Installation/Configuration' started by Oazis, Jul 17, 2022.

  1. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I think you keep misspelling the name, it is Till
    I have not done configurations for PHPMyAdmin, it has just worked after ISPConfig installation.
    My understanding is Nginx does not use htaccess files, it has some other way to configure this.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    No. phpmyadmin is on port 8081. e.g. https://yourserver.tld:8081/phpmyadmin

    .htaccess is an apache specific file and file format that is not used by other http servers like Nginx. Nginx has its own rewrite rule syntax. see Nginx documentation: https://nginx.org/en/docs/

    You can put website-specific rewrite rules into the Nginx directives field of the website in ISPConfig, this field is on the options tab of the site. As an example, here are the rules for a WordPress website:

    Code:
    location / {
                    try_files $uri $uri/ /index.php?$args;
           }
    
           # Add trailing slash to */wp-admin requests.
           rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    
           location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                    expires max;
                    log_not_found off;
    }
    Websites send emails via PHP, the web server apache or nginx is not involved in that at all. The web server can send email on its own if you installed ISPConfig will mailserver option, but you can also specify a proxy in ISPConfig. But as mentioned already, that's not webserver specific.
     
  3. Oazis

    Oazis Member

    PHPMyAdmin works, can I change the port to 8081 in ISPConfig?

    Do I understand correctly that it is necessary to make changes to the '/etc/nginx/sites-available' file saite?
     
    Last edited: Jul 20, 2022
  4. Oazis

    Oazis Member

    Thanks, fixed the bug!)
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Do not change any files in that folder manually, any manual change will get removed automatically on the next update unless you make it in an update-safe way by using custom template files. Instead of changing the port, set the URL for the button to access phpmyadmin to that URL. You can find the setting under system > interface > main config. Enter the full URL there, starting with https://
     
  6. Oazis

    Oazis Member

    Where to add changes to make WordPress sites work for any client? Edit Nginx config or file '/etc/nginx/sites-available/default'?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    From post #22: "You can put website-specific rewrite rules into the Nginx directives field of the website in ISPConfig, this field is on the options tab of the site." So to make WordPress work for any client, you add this in any client's nginx directives field. And for easo of use, use System > directive snippets to define a WordPress specific snippet there.

    Has been answered already as well, from post #25 "Do not change any files in that folder manually". And the file /etc/nginx/sites-available/default is not related to any hosted website, same as with apache btw.

    If you host WordPress sites only and you want that no other CMS will work on your system, then you can alter the main nginx vhost config file template by copying the file /usr/local/ispconfig/server/conf/nginx_vhost.conf.master to /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master and then alter the file /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master
    This file gets applied to any new or updated website.
     
  8. Oazis

    Oazis Member

    Yes, that's exactly what I wanted to understand. Thank you very much for your help!
     
  9. Oazis

    Oazis Member

    Can you please tell me what version of PHPMyAdmin you have installed? Because I have v4.9.0.1. in which errors are observed in the work. When automatically installing IPSConfig with Apache, it worked PHPMyAdmin v5.0.4deb2+deb11u1. By the way, how to update PHPMyAdmin to the latest version?
     
    Last edited: Jul 21, 2022
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    By manually running apt-get install to install phpmyadmin, a post which you have hidden in this thread now, you overwrote the phpmyadmin installed by ISPconfig from source and therefore you downgraded phpmyadmin on your system to the version that ships with the OS. So your phpmyadmin setup was fine until you overwrote the version installed by ISPConfig.
     
  11. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I have used the version of PHPMyAdmin that comes with the OS. I try to not change versions of applications, I use the supported version.
    Code:
    root@mail:~# cat /etc/debian_version
    10.12
    root@mail:~# apt policy phpmyadmin
    phpmyadmin:
      Asennettu: 4:5.0.4+dfsg2-2~bpo10+1
      Ehdokas:   4:5.0.4+dfsg2-2~bpo10+1
      Versiotaulukko:
     *** 4:5.0.4+dfsg2-2~bpo10+1 100
            100 http://deb.debian.org/debian buster-backports/main amd64 Packages
            100 /var/lib/dpkg/status
    root@mail:~# 
    I would not update. If you have a real business case for the upgrade, and can spend the time to verify the updated version does work in your environment, removing the version installed from OS repo, then installing the desired version from maybe compiling from source? Check if backports has the needed version available.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    A newer phpmyadmin as deb package might be available from backports repo too.
     
  13. Oazis

    Oazis Member

    Right after a clean install an error is displayed: "$Cfg['TempDir'] (/var/lib/phpmyadmin/tmp) is not available. Because of this, phpMyAdmin cannot cache templates and will be slow"
    1. Set permissions for folder 0777 'var/lib/phpmyadmin/tmp' to remove the error, it is strange that the rights are not assigned during installation ISPConfig.
    2. Using the instructions in step 18, updated phpMyAdmin: https://www.howtoforge.com/perfect-server-debian-10-buster-apache-bind-dovecot-ispconfig-3-1/
     
    Last edited: Jul 22, 2022
  14. MaKa

    MaKa Member

    Hello,

    could you please get me some information, how to migrate from Debian 11, ISPConfig, Apache2 to Nginx - all websites will use nginx?

    I could't find any guide to do it..
    Thank you
     
  15. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Changing from apache2 to nginx is quite an easy process. Read this old thread:
    https://forum.howtoforge.com/threads/after-change-apache2-to-nginx.89455/. In there you will find link to Schaal Blog that can guide the change. Use ISPConfig update to fix or do manual fix as suggested in its comment when you finished following the steps in that blog. Please do proper backups before you proceed.
     

Share This Page