Nginx Problem

Discussion in 'ISPConfig 3 Priority Support' started by gpetrom, Oct 15, 2018.

  1. gpetrom

    gpetrom Member HowtoForge Supporter

    Hi

    I have successfully migrated a web server with the tool from debian 8 apache to debian 9 nginx. All is working but i have a strange problem.
    One of my sites has joomla installed with rsform and vtiger plugin. In this site i have a form and when a client submits the form, the vtiger plugin connects to another site in the same server (vtiger) and with webservice it adds a lead. This was working before migration. Now the plugin cannot connect and shows the following error:
    [Vtiger CRM Integration] Failed to connect to crm.mysite.com port 80: Connection refused

    In the logs of the crm i found this
    2018/10/15 12:00:34 [error] 5886#5886: *350 directory index of "/var/www/crm.mysite.com/web/" is forbidden, client: x.x.x.x, server: crm.mysite.com, request: "GET / HTTP/1.1", host: "crm.mysite.com"

    Strange thing is when i installed a fresh joomla on my local pc and did the same, everything worked well. It did connect.
    When i installed a fresh joomla on the server same problem. I cannot figure out where is the issue that prevents the vtiger plugin to connect to the site.

    Any ideas why this happens
     
    Last edited: Oct 15, 2018
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Does the path /var/www/crm.mysite.com/web/ contain an index.php file or similar index file? Or do you get a forbidden error also when you enter crm.mysite.com as url in a browser?
     
  3. gpetrom

    gpetrom Member HowtoForge Supporter

    Hi till
    yes it has an index.php file and as url the site works just fine.
    Something to mention when i installed a fresh joomla on my local server it successfully connected to crm.mysite.com.

    The problem is with joomla on the same server with crm.mysite.com
     
  4. gpetrom

    gpetrom Member HowtoForge Supporter

    Hi till
    I found out what th problem is. From localhost i can not connect to websites for example if i run from cli.
    curl -I "http://crm.mysite.com" i am getting
    curl: (7) Failed to connect to crm.mysite.com port 80: Connection refused

    I have installed local a new debian 9 with ispconfig and nginx and this is not happening.
    I think that is happening after the migration.

    output from netstat -pln

    Code:
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 127.0.0.1:10023         0.0.0.0:*               LISTEN      635/postgrey --pidf
    tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      1024/amavisd-new (m
    tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      999/master     
    tcp        0      0 127.0.0.1:10026         0.0.0.0:*               LISTEN      1024/amavisd-new (m
    tcp        0      0 127.0.0.1:10027         0.0.0.0:*               LISTEN      999/master     
    tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      999/master     
    tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      479/memcached   
    tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      549/dovecot     
    tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      549/dovecot     
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6346/nginx: master
    tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      6346/nginx: master
    tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      999/master     
    tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      1023/pure-ftpd (SER
    tcp        0      0 192.168.100.91:53       0.0.0.0:*               LISTEN      474/named       
    tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      474/named       
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1614/sshd       
    tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      999/master     
    tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      474/named       
    tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      6346/nginx: master
    tcp        0      0 0.0.0.0:9595            0.0.0.0:*               LISTEN      6346/nginx: master
    tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      549/dovecot     
    tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      549/dovecot     
    tcp        0      0 127.0.0.1:8996          0.0.0.0:*               LISTEN      481/php-fpm: master
    tcp6       0      0 ::1:10023               :::*                    LISTEN      635/postgrey --pidf
    tcp6       0      0 ::1:10024               :::*                    LISTEN      1024/amavisd-new (m
    tcp6       0      0 ::1:10026               :::*                    LISTEN      1024/amavisd-new (m
    tcp6       0      0 :::3306                 :::*                    LISTEN      869/mysqld     
    tcp6       0      0 :::587                  :::*                    LISTEN      999/master     
    tcp6       0      0 :::110                  :::*                    LISTEN      549/dovecot     
    tcp6       0      0 :::143                  :::*                    LISTEN      549/dovecot     
    tcp6       0      0 :::80                   :::*                    LISTEN      6346/nginx: master
    tcp6       0      0 :::465                  :::*                    LISTEN      999/master     
    tcp6       0      0 :::21                   :::*                    LISTEN      1023/pure-ftpd (SER
    tcp6       0      0 :::53                   :::*                    LISTEN      474/named       
    tcp6       0      0 :::22                   :::*                    LISTEN      1614/sshd       
    tcp6       0      0 :::25                   :::*                    LISTEN      999/master
    service is working fine

    Any ideas
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What is in /etc/hosts ?
     
  6. gpetrom

    gpetrom Member HowtoForge Supporter

    Hi Taleman

    My hosts file
    127.0.0.1 localhost
    public ip websrv.myserver.com websrv
    I have also tried with the private ip address and again it did not work

    I managed to solve the problem but i don t know if it is the correct solution.
    I have added as second ip the public ip address of my server in the interfaces.
     
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That is the correct solution. If the public IP was not there previously, did you have router forward the traffic or how did it work previously?
     
  8. gpetrom

    gpetrom Member HowtoForge Supporter

    Hi Taleman
    I had a vps on hetzner and i did not had my public ipv4 on interfaces. But hetzner when installs the image adds the ip version 6 ip and i did not noticed that. I think that is the reason that it worked from my old server, localhost used ipv6 ip.
     

Share This Page