在具有perl后端功能的应用程序中使用NPM
我继承了一个在前端使用jQuery的遗留应用程序,在一次可怕的判断失误中,我运行了它在具有perl后端功能的应用程序中使用NPM,perl,npm,Perl,Npm,我继承了一个在前端使用jQuery的遗留应用程序,在一次可怕的判断失误中,我运行了它 npm install underscore 然后我马上打了自己,因为这个应用程序的后端是用perl编写的!因此,现在,当我尝试访问该站点时,会出现以下错误: Error: No such CGI app - /var/www/html/login.pl may not exist or is not executable by this process. /var/ww/html/login.pl实际上是
npm install underscore
然后我马上打了自己,因为这个应用程序的后端是用perl编写的!因此,现在,当我尝试访问该站点时,会出现以下错误:
Error: No such CGI app - /var/www/html/login.pl may not exist or is not executable by this process.
/var/ww/html/login.pl实际上是存在的。一开始是这样的:
#!/usr/bin/perl -w
use utf8;
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI qw /param/;
use Digest::PBKDF2;
use CGI::Cookie;
use MongoDB;
use Data::Dumper;
use UUID::Generator::PurePerl;
然后继续做一些登录工作。当应用程序实际运行时,这种方法工作得很好。其他答案建议npm覆盖index.html,但这仍然存在,并且仍然重定向到login.pl脚本
我知道从任何合理的标准来看,这都不是一个好问题,但我已经绝望了。显然,NPM改变了权限。我通过运行以下命令来恢复功能:
find /html -type f -exec chmod 755 {} \;
然后:
find /html -type d -exec chmod 755 {} \;
这允许perl解释器执行html目录中的所有文件 错误为“/var/www/html/login.pl可能不存在或此进程不可执行”。你说“/var/ww/html/login.pl确实存在。”那么,它是可执行的吗?权限是+rwx。所以,是的,我已经仔细检查了它是否存在并且是可执行的。
chmoda+rwx
通常是很糟糕的做法,但对于web应用程序来说尤其糟糕<代码>chmod 755更安全。好的,我把它改成了chmod 755。