title: The requested URL / was not found on this server. Flask in apache server
body: <p>Iam following this link "<a href="https://medium.com/@madumalt/flask-app-deployment-in-windows-apache-server-mod-wsgi-82e1cfeeb2ed" rel="nofollow noreferrer">https://medium.com/@madumalt/flask-app-deployment-in-windows-apache-server-mod-wsgi-82e1cfeeb2ed</a>" to deploy flask app in windows........</p>
  
  <p>1)<strong>Usually this was in my http-vhosts.conf file:</strong></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@dummy-host2.example.com
      DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
      ServerName dummy-host2.example.com
      ServerAlias www.dummy-host2.example.com
      ErrorLog "logs/dummy-host2.example.com-error.log"
      CustomLog "logs/dummy-host2.example.com-access.log" common
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p><strong>and now below that I added server name, WSGIScriptAlias, directory to it so that it look like this:</strong></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName localhost
      WSGIScriptAlias / "D:/Tirumalesh/dev/text_basic/web.wsgi"    
      DocumentRoot "D:/Tirumalesh/dev/text_basic"   
      &lt;Directory D:/Tirumalesh/dev/text_basic&gt;                        
          Require all granted
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>2) <strong>and I have added (below 3 lines) in my httpd.conf(in the very end of file) which is the output coming from "mod_wsgi-express module-config" and I have included "Include conf/extra/httpd-vhosts.conf" (virtual hosts) in my httpd.conf file</strong></p>
  
  <pre><code>LoadFile "c:/users/lucid/anaconda3/python37.dll"
  LoadModule wsgi_module "c:/users/lucid/anaconda3/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
  WSGIPythonHome "c:/users/lucid/anaconda3"
  </code></pre>
  
  <p>3)<strong>Next i create a web.wsgi file with the following content</strong> </p>
  
  <p>import sys
  sys.path.insert(0, 'D:\Tirumalesh\dev\text_basic')
  from text_basic import app as application</p>
  
  <p>4)And my python file is "text_basic.py" (whose name must be same as my .wsgi file) </p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  @app.route('/')
  def hello():
      return ("Hello World qwertyuiop!!")
  if __name__ == "__main__":
      app.run()
  </code></pre>
  
  <p>After that i restarted my apache server and tried running "localhost" but im not getting "Hello World qwertyuiop!!" this output in my html page instead im getting <strong>"The requested URL / was not found on this server."</strong></p>
  
  <p>Is there anything i missed in this??</p>
  
  <p><strong>NOTE</strong>: <a href="https://github.com/GrahamDumpleton/mod_wsgi/releases/download/4.4.12/mod_wsgi-windows-4.4.12.tar.gz" rel="nofollow noreferrer">https://github.com/GrahamDumpleton/mod_wsgi/releases/download/4.4.12/mod_wsgi-windows-4.4.12.tar.gz</a></p>
  
  <p>Instead of downloading this "mod_wsgi-windows-4.4.12.tar.gz" this file and looking for the right mod_wsgi.so file and copy it to my  "C:\Users\lucid\VS16\Apache24\modules" and pasting <strong>.so</strong> file,
   I downloaded mod_wsgi using "pip install mod_wsgi"and after i ran "mod_wsgi-express module-config" and copied the below output to httpd.conf at last line of the file.......</p>
  
  <pre><code>LoadFile "c:/users/lucid/anaconda3/python37.dll"
  LoadModule wsgi_module "c:/users/lucid/anaconda3/lib/sitepackages/mod_wsgi/server/mod_wsgi.cp37- 
     win_amd64.pyd"
  WSGIPythonHome "c:/users/lucid/anaconda3"
  </code></pre>