Control Web Panel
WebPanel => Installation => Topic started by: jeffshead on March 01, 2018, 03:34:45 PM
-
I followed this (http://wiki.centos-webpanel.com/how-to-run-cgi-scripts-with-apache) and this (http://wiki.centos-webpanel.com/how-to-enable-mod_suexec-with-apache) but I still cannot get CGI working.
When I go to: https://mysite.com/cgi-bin/test.cgi, I get a 500 Internal Server Error.
I get this in the error log:
End of script output before headers: test.cgi
I get the following in the suexec log:
[2018-03-01 10:25:18]: uid: (1001/jeff) gid: (1001/jeff) cmd: test.cgi
[2018-03-01 10:25:18]: file has no execute permission: (/home/jeff/public_html/cgi-bin/test.cgi)
I used WinSCP to upload 'test.cgi' from a Windows PC to the server and I also used WinSCP to chmod 'test.cgi' to 0755. I also used CWP to fix permissions for the user account.
As per the wiki, I get "cgid_module (shared)" and "suexec_module (shared)" when testing to see if the modules are loaded.
Not sure what to do at this point.
I get the following when I check permissions via command line:
[root@cwp ~]# ls -la /home/jeff/public_html/cgi-bin/test.cgi
-rw-r--r-- 1 jeff jeff 98 Feb 28 17:49 /home/jeff/public_html/cgi-bin/test.cgi
-
check
namei -om /home/jeff/public_html/cgi-bin/test.cgi
-
check
namei -om /home/jeff/public_html/cgi-bin/test.cgi
dr-xr-xr-x root root /
drwx--x--x root root home
drwx--x--x jeff jeff jeff
drwxr-xr-x jeff nobody public_html
drwxr-xr-x jeff jeff cgi-bin
-rw-r--r-- jeff jeff test.cgi
-
I see in my previous post that executable was missing but WinSCP showed the file with 0755.
I used 'chmod 755 test.cgi' via SSH and now have the following but I'm still getting the 500 Internal Server Error:
[root@cwp ~]# namei -om /home/jeff/public_html/cgi-bin/test.cgi
f: /home/jeff/public_html/cgi-bin/test.cgi
dr-xr-xr-x root root /
drwx--x--x root root home
drwx--x--x jeff jeff jeff
drwxr-xr-x jeff nobody public_html
drwxr-xr-x jeff jeff cgi-bin
-rwxr-xr-x jeff jeff test.cgi
-
Found the cause.
As I stated in my original post, I used WinSCP to transfer 'test.cgi' from a Windows PC to the CWP server. The issue is described here:
https://stackoverflow.com/a/8629849
I simply used WinSCP to upload the file, once again, but this time I selected "text" as the transfer method.