OpenVPN-Admin icon indicating copy to clipboard operation
OpenVPN-Admin copied to clipboard

Client Configuration download issue on nginx

Open leeliwei930 opened this issue 8 years ago • 9 comments

  • PHP version: PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

  • MySQL version: mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper

  • Webserver (Nginx, Apache...): Nginx

  • What is the expected behaviour? Can't download client config files it returns 500 HTTP Error

  • What do you see instead?

  • PHP logs on pastebin:

leeliwei930 avatar Aug 29 '17 10:08 leeliwei930

Miss PHP logs...

Chocobozzz avatar Aug 29 '17 11:08 Chocobozzz

Fatal error: Uncaught RuntimeException: Directory name must not be empty. in /var/www/openvpn/index.php:41 Stack trace: #0 /var/www/openvpn/index.php(41): RecursiveDirectoryIterator->__construct('') #1 {main} thrown in /var/www/openvpn/index.php on line 41

Warning: Unknown: Cannot destroy the zip context: Can't remove file: No such file or directory in Unknown on line 0

leeliwei930 avatar Aug 29 '17 12:08 leeliwei930

What is the content of the openvpn-admin/client-conf in your install directory?

Chocobozzz avatar Aug 29 '17 12:08 Chocobozzz

gnu-linux osx-viscosity windows

leeliwei930 avatar Aug 29 '17 12:08 leeliwei930

is it any methods to fix this issue? I guess it maybe it needs some line of nginx configuration to make it works.

leeliwei930 avatar Aug 29 '17 13:08 leeliwei930

is it any methods to fix this issue? I guess it maybe it needs some line of nginx configuration to make it works.

Not sure: you mean you didn't configure your vhost as mentioned here?

SansPseudoFix avatar Aug 29 '17 19:08 SansPseudoFix

Here is my nginx configuration for openvpn admin
server { listen 80; listen [::]:80; listen 8080 ssl ; listen [::]:8080 ssl ; server_name secure-vpn.techrino.net;

   root /var/www/openvpn;
   index index.php index.html;

   location / {
           try_files $uri $uri/ =404;
   }
location ~ \.php$ {
            include snippets/fastcgi-php.conf;

    #       # With php7.0-cgi alone:
    #       fastcgi_pass 127.0.0.1:9000;
    #       # With php7.0-fpm:
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

}

leeliwei930 avatar Aug 30 '17 02:08 leeliwei930

And what is the content of /var/www/openvpn-admin/client-conf/?

Chocobozzz avatar Aug 30 '17 06:08 Chocobozzz

techrino@ubuntu-512mb-sgp1-01:/var/www/openvpn/openvpn-admin/client-conf$ ls -la total 20 drwxr-xr-x 5 www-data www-data 4096 Aug 29 10:00 . drwxr-xr-x 8 www-data www-data 4096 Aug 29 10:00 .. drwxr-xr-x 2 www-data www-data 4096 Aug 29 10:31 gnu-linux drwxr-xr-x 2 www-data www-data 4096 Aug 29 13:54 osx-viscosity drwxr-xr-x 2 www-data www-data 4096 Aug 29 10:31 windows

leeliwei930 avatar Aug 30 '17 13:08 leeliwei930