Web Hosting Forum | Lunarpages
News: April 3, 2008 - New Contest! - Win 5 Years of Hosting and $1,000!
June 30, 2008 - Submit Your Site for the July 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 09, 2008, 02:45:32 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Python script problems  (Read 376 times)
sdweyhrich
Newbie
*
Offline Offline

Posts: 1


« on: April 16, 2008, 08:39:12 AM »

I've added Google AdSense to my web site, but the AdSense page says it would like a sitemap. Google offers a free site-map generation Python script, but doesn't give much information as to how it should be used.

I've run Perl and PHP scripts before, but not Python. Elsewhere on Lunarforums it was stated that these should be run in the cgi-bin directory, and have a ".cgi" extension. However, when I run the script, I get a "500 Internal Server Error". I checked the error log, and changed the permissions for this file to "755". I no longer get any feedback in the Error Log that explains WHY I'm getting a 500 error.

I suspect it has to do with the header in the Python file. I used a cron job to determine where Python is on my server, and got a number of replies:

python: /usr/bin/python
/usr/bin/python2.3
/usr/lib/python2.3
/usr/local/bin/python2.4
/usr/local/bin/python
/usr/local/lib/python2.4
/usr/include/python2.3
/usr/share/man/man1/python.1.gz


After reading more about this (finally found the documentation at Google's site), I tried to run the script as a cron job (to make use of the Unix command line). I set this command:

python /public_html/cgi-bin/sitemap_gen.py --config=/public_html/cgi-bin/config.xml --testing

And the e-mail reply from the cron job said

python: can't open file '/public_html/cgi-bin/sitemap_gen.py'

I have his error also if I change the extension to .cgi.

Any suggestions on how to make this run?
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3041



« Reply #1 on: April 16, 2008, 04:58:50 PM »

/home/YOUR_ACCOUNT_NAME/public_html/...

You're not in a Web environment (Apache server). You're in the Linux command line environment here (probably in /home/ACCOUNT/), and you told it look for public_html under the system root "/" (which is not where it is).
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM