Execute Python commands on the server

Status
Not open for further replies.

thaliagoo

New Member
Messages
14
Reaction score
0
Points
0
I am trying to make a Google SiteMap generator. Here are some requirements for that:
  • [SIZE=-1]You must be able to connect to and run scripts on your web server. [/SIZE]
  • [SIZE=-1]Your web server must have Python 2.2 or later installed. [/SIZE]
  • [SIZE=-1]You must know the command that launches Python. (Generally, this is python, but may vary by installation. For instance, if the web server has two versions of Python installed, the earlier version may be invoked by the command python and the later version may be invoked by the command python2.) [/SIZE]
  • [SIZE=-1]You must know the directory path to your site. If your web server hosts one site, this may be a path such as var/www/html. If you have a virtual server that hosts multiple sites, this may be a path such as home/virtual/site1/fst/var/www/html.

    This is what I need to do:

    In order to run the Sitemap Generator, you’ll need to connect to your web server. Once you have copied the files to your web server, you'll need to run the Sitemap Generator script. Connect to your web server and run the following command (replace <path/config.xml> with the path to and filename of your configuration file; if you have uploaded this file to the same location as the Python script, you can exclude the path):

    python sitemap_gen.py --config=<path/config.xml>


    [/SIZE]
I know that you cannot run SSH on the free sites but I read that everything that can be done in SSH can be done in the control panel. So my questions are:

1) Can I execute commands on the server?
2) How do I execute a .py file without SSH?
3) What is the directory path to my site?
 
Last edited:

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
The only place I've seen .py files being executed is in CGI-BIN.

/home/user/public_html/cgi-bin/ replace user with your user name.
 

Dannz

New Member
Messages
43
Reaction score
0
Points
0
Python scripts will run in any directory if the Apache handler is set up - it doesn't have to only be in the cgi-bin.

See earlier post on Google Sitemap generator and Python - the GSMG script is one which runs in a Python IDE (i.e. a console). I don't know how you do this, or if it can be done without being Admin. My suggestion would be to tweak the GSMG Python script so the settings and options are as you want them to be, and then just run it as a simple cgi script.
 
Status
Not open for further replies.
Top