jeudi 26 octobre 2017

deploy to linux servers

I am doing a project for Udacity FullStack Web Developer program, and I am on the last project Linux web application servers. I've followed all the steps and everything worked until i was given the instruction to add this "For now, add the following line at the end of the block, right before the closing line: WSGIScriptAlias / /var/www/html/myapp.wsgi"I added the highlighted line and I restarted apache with the command sudo apache2ctl restart. Next "You just defined the name of the file you need to write within your Apache configuration by using the WSGIScriptAlias directive. Despite having the extension .wsgi, these are just Python applications. Create the /var/www/html/myapp.wsgi file using the command sudo nano /var/www/html/myapp.wsgi. Within this file, write the following application:

def application(environ, start_response): status = '200 OK' output = 'Hello Udacity!'

response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))]
start_response(status, response_headers)

return [output]

I'm suppose to get a webpage that display Hello Udacity instead I get thisthe python file I created This is the result following the steps can anyone tell me what i'm doing wrong or the mistake i made?




Aucun commentaire:

Enregistrer un commentaire