kevinoconnor7 / osTicket-auth-cas

JASIG CAS Authentication plugin for osTicket
GNU General Public License v2.0
13 stars 8 forks source link

HTTP 500 error #22

Closed rcf96 closed 4 years ago

rcf96 commented 4 years ago

I am currently running osTicket version 1.14.1 on php 7.3 and apache2. I have tried building the plugin as well as downloading and installing the lastest release but whenever I enable the plugin I get a 500 error and it takes the entire site down. I will attach the apache2 error messages that come up when I enable the plugin. It seems like there is a weird file path where it cannot find cas.php and it is leading to this issue. Please let me know if you need any more information as well as if you can help.

[Tue May 26 15:44:07.222926 2020] [php7:warn] [pid 32707] [client 10.35.36.81:56276] PHP Warning: require_once(phar:///var/www/html/osticket/include/plugins/cas.phar/lib/jasig/phpcas/CAS.php): failed to open stream: phar error: "lib/jasig/phpcas/CAS.php" is not a file in phar "/var/www/html/osticket/include/plugins/cas.phar" in phar:///var/www/html/osticket/include/plugins/cas.phar/cas.php on line 3, referer: https://lsosticket.byu.edu/scp/plugins.php

[Tue May 26 15:44:07.222957 2020] [php7:error] [pid 32707] [client 10.35.36.81:56276] PHP Fatal error: require_once(): Failed opening required 'phar:///var/www/html/osticket/include/plugins/cas.phar/lib/jasig/phpcas/CAS.php' (include_path='./:/var/www/html/osticket/include/:/var/www/html/osticket/include/pear/:phar:///var/www/html/osticket/include/plugins/auth-ldap.phar/include') in phar:///var/www/html/osticket/include/plugins/cas.phar/cas.php on line 3, referer: https://lsosticket.byu.edu/scp/plugins.php

[Tue May 26 15:44:10.209769 2020] [php7:warn] [pid 32710] [client 10.35.36.81:56284] PHP Warning: require_once(phar:///var/www/html/osticket/include/plugins/cas.phar/lib/jasig/phpcas/CAS.php): failed to open stream: phar error: "lib/jasig/phpcas/CAS.php" is not a file in phar "/var/www/html/osticket/include/plugins/cas.phar" in phar:///var/www/html/osticket/include/plugins/cas.phar/cas.php on line 3, referer: https://lsosticket.byu.edu/scp/plugins.php

[Tue May 26 15:44:10.209805 2020] [php7:error] [pid 32710] [client 10.35.36.81:56284] PHP Fatal error: require_once(): Failed opening required 'phar:///var/www/html/osticket/include/plugins/cas.phar/lib/jasig/phpcas/CAS.php' (include_path='./:/var/www/html/osticket/include/:/var/www/html/osticket/include/pear/:phar:///var/www/html/osticket/include/plugins/auth-ldap.phar/include') in phar:///var/www/html/osticket/include/plugins/cas.phar/cas.php on line 3, referer: https://lsosticket.byu.edu/scp/plugins.php

[Tue May 26 15:44:11.644189 2020] [php7:warn] [pid 3399] [client 10.35.36.81:56288] PHP Warning: require_once(phar:///var/www/html/osticket/include/plugins/cas.phar/lib/jasig/phpcas/CAS.php): failed to open stream: phar error: "lib/jasig/phpcas/CAS.php" is not a file in phar "/var/www/html/osticket/include/plugins/cas.phar" in phar:///var/www/html/osticket/include/plugins/cas.phar/cas.php on line 3, referer: https://lsosticket.byu.edu/scp/plugins.php

[Tue May 26 15:44:11.644246 2020] [php7:error] [pid 3399] [client 10.35.36.81:56288] PHP Fatal error: require_once(): Failed opening required 'phar:///var/www/html/osticket/include/plugins/cas.phar/lib/jasig/phpcas/CAS.php' (include_path='./:/var/www/html/osticket/include/:/var/www/html/osticket/include/pear/:phar:///var/www/html/osticket/include/plugins/auth-ldap.phar/include') in phar:///var/www/html/osticket/include/plugins/cas.phar/cas.php on line 3, referer: https://lsosticket.byu.edu/scp/plugins.php

kevinoconnor7 commented 4 years ago

Can you confirm that /var/www/html/osticket/include/plugins/cas.phar exists and is readable by your webserver?

rcf96 commented 4 years ago

I have confirmed that the cas.phar exists and that it is the correct file but I am now getting a different error. After trying to sign in with CAS I get an apache NOT FOUND page. For some reason https://lsosticket.byu.edu/api/auth/ext does not exist and each user that tries to sign in gets a random variable after the address not found. Please let me know if there is a way to fix this.

Screenshot from 2020-05-28 16-21-19

kevinoconnor7 commented 4 years ago

There's a .htaccess file in the api directory that applies mod_rewrite rules. Please ensure that this file is taking effect, or manually copy rules into the appropriate section of your apache config.

rcf96 commented 4 years ago

I have tried manually copying the rules into my apache config file and restarting the apache service but I am still getting the error. Is there a specific spot in the config file that I need to put the rules?

rcf96 commented 4 years ago

It turns out I just needed to set the AllowOverride to All instead of None. The CAS plugin is now working and both agents and clients can sign in with cas. Thank you for developing this and replying to these issues in a timely manner!