Dear Dat, Sorry for the late reply.
The path of the python should be #!/usr/bin/python (or) #!/usr/bin/env python. Forward Slash(/) is missing in your CGI script. Enable the ExecCGI for your DocumentRoot Ref: http://httpd.apache.org/docs/current/howto/cgi.html <Directory /Library/WebServer/Documents> Options +ExecCGI </Directory> Kindly try and let us know the details. Kind Regards :: S. Seshadri Raja :: On Sun, Jun 23, 2013 at 6:12 PM, Dat Huynh <htdat...@gmail.com> wrote: > Dear all, > > I have a very simple question about running a simple web application with > apache on MacOS. > > Step 1: Copy the file mod_wsgi.so from the link > > http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-macosx106-ap22py26-3.3.so > into the folder "/usr/libexec/apache2" > > > Step 2: Add the following line: > > LoadModule wsgi_module libexec/apache2/mod_wsgi.so > into the file "/etc/apache2/httpd.conf" > > > Step 3: Edit a file "test.py" as below and copy the file to the folder > "/Library/WebServer/Documents". > > #!usr/bin/python > print "Content-type: text/html" > print > print "<html><head>" > print "" > print "</head><body>" > print "Test Page" > print "</body></html>" > > When I type the following url "http://localhost/test.py" on my browser, I > see exactly the content of the file, NOT the text "Test Page" only. > > I think I miss something in the procedure. > What should I do to make my browser process the received HTML data? > > Thank you very much. > > Sincerely, > Dat. > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor