Jump to content

Recommended Posts

Posted

I uploaded my cgi script to scgi-bin in public_html folder, but when i want to access it via url it return error like this

 

scgiwrap: Caller must be the nobody user

 

I also tried to upload in cgi-bin folder, but instead error above i got 500 internal server error

 

is there any solution?

 

Thank you

Posted

I'm assuming you're on Johnny...the scgiwrapper has been broken Johnny's Apache was upgraded. The 500 error in cgi-bin is likely due to your script (permissions like Byron said, or possibly an incorrect shebang line).

 

@Byron: Krydos looked at the scgiwrap error for someone else...conclusion was that Apache needs to be rebuilt.

Posted
@Byron: Krydos looked at the scgiwrap error for someone else...conclusion was that Apache needs to be rebuilt.

 

Ok, thanks!

Posted
I'm assuming you're on Johnny...the scgiwrapper has been broken Johnny's Apache was upgraded. The 500 error in cgi-bin is likely due to your script (permissions like Byron said, or possibly an incorrect shebang line). @Byron: Krydos looked at the scgiwrap error for someone else...conclusion was that Apache needs to be rebuilt.

 

aw that is unfortunate to hear that there is a problem, when it will be fixed?

 

@Byron, yes i set it to 755 even the folder itself show at 755 and still it show the error above. maybe i just need it to be fixed

 

Thank you for the answer

Posted

Paste this code into a new file in your cgi-bin and give it permissions 755 and see if it works. If it doesn't, post back the file name:

 

#!/usr/bin/perl -w
# File: time.pl
use CGI ':standard';
$current_time = localtime;
# 
print header,
start_html('A Virtual Clock'),
h1('A Virtual Clock'),
"The current time is $current_time - EST.",
hr,
end_html;

Posted (edited)
Paste this code into a new file in your cgi-bin and give it permissions 755 and see if it works. If it doesn't, post back the file name:
#!/usr/bin/perl -w # File: time.pl use CGI ':standard'; $current_time = localtime; # print header, start_html('A Virtual Clock'), h1('A Virtual Clock'), "The current time is $current_time - EST.", hr, end_html; 

 

no, still error 500.

 

i've paste your code and name it time.pl set permission to 755 and still get same error

 

edit: its worked, there is .htaccess and i remove it but the problem still with my script. my script is .py actually

Edited by valkyrion123
Posted (edited)
I can't help you with python. You could post your code and see if somebody else could help you.

 

i dont think my code is not working, cause it working in my xampp on my pc

 

btw here is the code maybe i make a mistake on declare shebang or something

 

#!/usr/bin/python
import sys
import time
import cgi, cgitb
sys.path.append('/selenium')
from selenium import webdriver
print "Content-type: text/html"
print ""
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
nisn = form.getvalue('nisn')
driver = webdriver.PhantomJS("./phantomjs-linux/bin/phantomjs")
url = "http://nisn.data.kemdikbud.go.id/page/data"
driver.get(url)
#filling form
sbox = driver.find_element_by_name("ctl00$contentCenter$edNISN")
sbox.send_keys(nisn)
driver.find_element_by_id("ctl00_contentCenter_RadButton1_input").click()
time.sleep(2)
nama = str(driver.find_element_by_id("contentCenter_lRes1Nama").text)
sex = str(driver.find_element_by_id("contentCenter_lRes1Kelamin").text)
lahir = str(driver.find_element_by_id("contentCenter_lRes1Tmptlahir").text)
tanggal = str(driver.find_element_by_id("contentCenter_lRes1TglLahir").text)

#print json_dumps(res,separators=(',', ': '))
print nama + "," + sex + "," + lahir + "," + tanggal
driver.quit()

 

edit: btw, did johnny support python 2.7.1? because in that 500 error it says Python/2.4.3

Edited by valkyrion123
Posted

There's multiple Pythons on Johnny:

 

python: /usr/bin/python2.4 /usr/bin/python /usr/lib/python2.4 /usr/local/bin/python2.7 /usr/local/bin/python3.4m /usr/local/bin/python3.4

 

You probably want to use:

#!/usr/local/bin/python2.7

in the first line of your script.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...