Chocobozzz / OpenVPN-Admin

Install and administrate OpenVPN with a web interface (logs visualisations, users managing...)
GNU Affero General Public License v3.0
947 stars 368 forks source link

Could not open login script file #172

Closed vicn1222 closed 3 years ago

vicn1222 commented 3 years ago

I have was able to install openvpn-admin, and I can login with username and password.

However, I need to change the login.sh script to login.php script and move to another location, with ownership being a user, instead of root. The login.php will do authentication with another database library, which has been set up already, that is why I have to move to a new location.

I also try to put login.php under /etc/openvpn/scripts diretory, and include the external library file into login.php using full path. It doesn't work either. The file is definitely there.

Below is my auth-user-pass-verify:

auth-user-pass-verify "/usr/bin/php /home/www/domain/scripts/login.php" via-env

I restart the apache without problem, but when I try to login, the log show errors, as below

Could not open input file: /home/www/domain/scripts/login.php 10.1.10.56:49174 WARNING: Failed running command (--auth-user-pass-verify): external program exited with error status: 1

The login.php script is definitely there.

Please help.

Many thanks

vicn1222 commented 3 years ago

Solved by setting ProtectHome=false on /etc/systemd/system/multi-user.target.wants/openvpn-server@server.service