Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I'm new to python programming.

I have written python script and calling it in shell script. I want to run my script on my server that is hosted through somedomian.com

I have tried by following way (not working)

python script path

when i run this python script on command line on same server , it is working fine.

But it is not getting called when i'm calling through my server that is hosted through somedomian.com.

Can someone help me .. how to run my python script here?

share|improve this question
1  
Check out wsgi. And I'm not sure if this is on topic here. This is a Unix site. Your question is a web programming one. And it sounds like you should be reading a good tutorial. – Faheem Mitha Nov 9 '15 at 6:28
    
yes need paste error, and I think you have multiple python version on your server? – Fred Nov 9 '15 at 6:39

first you need to install and configure python to run under apache:

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-apache-mysql-and-python-lamp-server-without-frameworks-on-ubuntu-14-04

then move your script to the apache root directory (usually /var/www/something)

And finally you call your script on your browser using the URL

somedomian.com/yourscript.py

somedomian.com/directory/yourscript.py

share|improve this answer
    
Python is already installed on this server and i'm not directly executing python script,calling it from shell script. i have moved my python script to cgi location..now it is working fine. – Sai Nov 9 '15 at 8:56

After moving my python script to cgi-bin location ,it is working fine.

share|improve this answer
    
What cgi location? Could you please edit your answer and add more details so that others can also benefit from it? – terdon Nov 9 '15 at 10:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.