Reference to this question I am running a tika service on my server:
-bash-3.2$ netstat -tulpn | egrep 'Proto|LISTEN'
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 72.167.2.1:50336 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:1248 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:4118 0.0.0.0:* LISTEN -
tcp 0 0 72.167.2.1:50328 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:12345 0.0.0.0:* LISTEN 4767/java
and I can connect normally to it with python through the command line:
-bash-3.2$ python
Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> port=12345
>>> host='127.0.0.1'
>>> s.connect((host,port))
but when I run it through the following cgi script, it is unable to connect:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
port=12345
host='127.0.0.1'
try:
s.connect((host,port))
except:
print sys.exc_info()
It gives me the following:
(, error(111, 'Connection refused'), )
I checked the cgi file permissions, and they are 755 (rwxr-xr-x).
Do I need to specify something in the service to make it accessible for cgi scripts to connect to it? Or is there soething that I can do from the cgi script itself or any other suggestion?
EDIT: I found this piece of info that the hosting company godaddy doesn't support socket creation from cgi:
So, is there another way to send a file to tika from CGI?