sentiment-web icon indicating copy to clipboard operation
sentiment-web copied to clipboard

Missing file?

Open pedrumgolriz opened this issue 11 years ago • 9 comments

I'm not sure if you supplied all the files here. I get 404 when I run, there is no /web/text directory and I have no idea what is supposed to go in there. Please shed some light on this issue.

pedrumgolriz avatar Apr 10 '14 20:04 pedrumgolriz

There is no /web/text/ directory, it is a dynamic URL route which is handled by the function evaldata() in server.py. How are you running the server?

vivekn avatar Apr 11 '14 02:04 vivekn

I'm guessing it's the way I set it up. I followed the instructions you provided in the readme. The folder contents are set up like this: domain -->directory ---->python files -------->template

On button press, index just returns the 404 as I said.

When I run "nohup python run.py &"

I get "nohup: ignoring input and appending output to `nohup.out'"

Or it could be my config file:

HOST="http://pedrumgolriz.com" PORT=80 STATS_KEY="sentiment_stats" RHOST='' RPORT=6379 RPASS=None

pedrumgolriz avatar Apr 11 '14 03:04 pedrumgolriz

The nohup part is just to make it run in the background after you quit the terminal or ssh session. Try without nohup ( python run.py ) and you'll get to know about what went wrong. Most likely you might not have privileges to open port 80, you would have to run it as root or with sudo.

vivekn avatar Apr 11 '14 18:04 vivekn

I managed to get it running of sorts. It turned out I had Python 2.6 installed not 2.7 (stupid mistake sorry). RIght now I'm delving in the config file to see what is wrong since I can only get error 500's. The output from the console once I exit the program:

python2.7 run.py 50.246.115.114 - - [2014-04-11 16:00:52] "GET / HTTP/1.1" 500 291 "-" "Mozilla/5.0 (Windo ws NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537. 36" ^CTraceback (most recent call last): File "run.py", line 9, in http_server.serve_forever() File "/usr/local/lib/python2.7/site-packages/gevent/baseserver.py", line 190, in serve_ forever self._stopped_event.wait() File "/usr/local/lib/python2.7/site-packages/gevent/event.py", line 74, in wait result = get_hub().switch() File "/usr/local/lib/python2.7/site-packages/gevent/hub.py", line 166, in switch core.set_exc_info(exc_type, exc_value) File "core.pyx", line 509, in gevent.core.set_exc_info (gevent/core.c:14278) TypeError: set_exc_info() takes exactly 3 positional arguments (2 given) [root@showhaus sentiment-web-master]#

pedrumgolriz avatar Apr 11 '14 20:04 pedrumgolriz

Did you install all the dependencies using pip? Setting app.debug = True in the server.py file might be useful here.

vivekn avatar Apr 13 '14 04:04 vivekn

Okay, I'm now nearly 100% sure it is a problem with my configuration. No matter what I put in the host variable, it always shows as 0.0.0.0:xxxx in the terminal: ConnectionError: Error -2 connecting :. Name or service not known. <WSGIServer fileno=3 address=0.0.0.0:44320>: Failed to handle request: request = <http_request "GET / HTTP/1.1" > application = <Flask 'server'>

pedrumgolriz avatar Apr 14 '14 14:04 pedrumgolriz

The HOST variable in the config file is just for rendering HTML. Just noticed that your user agent says "Windows", are you using Windows to run the server? I'm not sure if gevent plays well with windows, and have never tested this on it.

vivekn avatar Apr 14 '14 14:04 vivekn

The server is running on CentOS, I was just visiting the script from a windows machine. So would the HOST variable be set to the domain? The sentiment script is a few folders deep in the domains file system. Also, this server is hosting multiple domains. The script is not under the main domain. So should the host be set to the IP of the main one? Sorry for all the questions, I really want to see this working.

pedrumgolriz avatar Apr 14 '14 14:04 pedrumgolriz

Oh, in that case edit this line in run.py http_server = WSGIServer(('', config.PORT), app)

and change it to http_server = WSGIServer(('your-host-name', config.PORT), app)

vivekn avatar Apr 14 '14 14:04 vivekn