Oct-03-2019, 08:06 PM
I have wrote a parcer and want to try it from a webserver.
I am paywing for a hosting at goneo.de. The hosting has a webserwer with Python and MySQL.
[Image: goneo.png]
In the manual the service provider wtites the folowing:
Python - Basics and Information
Prerequisites:
Scripts must be in the directory /cgi-bin and have the file rights 750.
Scripts must output a standard header as first line, e.g. Content-type: text/html
Scripts must be in Unix file format and uploaded in ASCII mode.
If these settings are not met, only "Internal Server Error" will appear and the scripts will not be executed.
You can change the file and directory permissions with your FTP program using the "chmod" command.
For information on how this works with your FTP program, please refer to the corresponding
documentation of your software. Please understand that we cannot offer support for this.
Interpreter path for Python:
#!/usr/local/bin/python
Example script "Hello World!" in Python:
(filename e.g. hallowelt.py)
#!/usr/local/bin/python
print "Content-type: text/html\n\n";
print "Hello World!";
If you copy the sample code from the goneo help to try it out, the quotation marks may be displayed incorrectly and interpreted incorrectly. This would also cause an HTTP error of 500. Therefore, please make sure that you use correct quotation marks in your script.
In addition, we recommend that you use an editor that can change the character encoding of your script to Unix file format. The free editor "notepad++", which you can download from the following website: http://notepad-plus.sourceforge.net, would be suitable for this.
Tip: On this page you can also download a German language file for the editor.
Then click in the editor "notepad++" on "Edit" → "End of line" and select "Convert to Unix (LF)".
I understood that my script must be located in CGI-BIN directory and I have copied it there
[Image: goneo01.png]
Please help, how can I start it and where can I see results of its execution.
Thank you
I am paywing for a hosting at goneo.de. The hosting has a webserwer with Python and MySQL.
[Image: goneo.png]
In the manual the service provider wtites the folowing:
Python - Basics and Information
Prerequisites:
Scripts must be in the directory /cgi-bin and have the file rights 750.
Scripts must output a standard header as first line, e.g. Content-type: text/html
Scripts must be in Unix file format and uploaded in ASCII mode.
If these settings are not met, only "Internal Server Error" will appear and the scripts will not be executed.
You can change the file and directory permissions with your FTP program using the "chmod" command.
For information on how this works with your FTP program, please refer to the corresponding
documentation of your software. Please understand that we cannot offer support for this.
Interpreter path for Python:
#!/usr/local/bin/python
Example script "Hello World!" in Python:
(filename e.g. hallowelt.py)
#!/usr/local/bin/python
print "Content-type: text/html\n\n";
print "Hello World!";
If you copy the sample code from the goneo help to try it out, the quotation marks may be displayed incorrectly and interpreted incorrectly. This would also cause an HTTP error of 500. Therefore, please make sure that you use correct quotation marks in your script.
In addition, we recommend that you use an editor that can change the character encoding of your script to Unix file format. The free editor "notepad++", which you can download from the following website: http://notepad-plus.sourceforge.net, would be suitable for this.
Tip: On this page you can also download a German language file for the editor.
Then click in the editor "notepad++" on "Edit" → "End of line" and select "Convert to Unix (LF)".
I understood that my script must be located in CGI-BIN directory and I have copied it there
[Image: goneo01.png]
Please help, how can I start it and where can I see results of its execution.
Thank you