Score:0

Apache24 on windows returns 'It works' only instead of the virtual hosts

cn flag

I have configured Apache 24 with mod_wsgi on windows 2016 server for my Django applications and deployed three websites with different IP addresses. I have also configured ssl certificates for each domain and everything is working fine until somehow the system shuts-down due to power and when the system is back Apache returns only "It works" for all domains unless I restart the Apache service manually. why is this happening please help. I have to restart Apache server every time I lose power.

I have also placed ssl files for one domain inside conf folder named server.crt,server.ca-bundle and server.key

below is my virtual host configuration

LoadFile "C:/<virtual environment directory>/Scripts/python38.dll"
LoadModule wsgi_module "c:/<virtual environment directory>/lib/site-packages/mod_wsgi/server/mod_wsgi.cp38-win_amd64.pyd"
WSGIPythonHome "C:/<python installation directory>/python38"
WSGIPythonPath "C:/<virtual environment directory>/Lib/site-packages"

NameVirtualHost domain1.com:80
<VirtualHost domain1.com:80>
  ServerAlias www.domain1.com       
  ServerName domain1.com
  Redirect permanent / https://domain1.com
</VirtualHost>

 

<VirtualHost domain1.com:443>
ServerAlias www.domain1.com      
ServerName domain1.com
ServerAdmin [email protected]
 
SSLEngine On
SSLCertificateFile "C:/<SSL certificate direcory>/<cirtificate-name>.crt"
SSLCertificateChainFile "C:/<SSL certificate direcory>/<cirtificate-name>.ca-bundle"
SSLCertificateKeyFile "C:/<SSL certificate direcory>/<cirtificate-name>.key"

Alias /static/ "C:/<project root directory>/static/"
  <Directory "C:/<project root directory>/static">
    Require all granted
  </Directory>

Alias /media/ "C:/<project root directory>/media/"
  <Directory "C:/<project root directory>/media">
    Require all granted
  </Directory>

WSGIScriptAlias / "C:/<project root directory>/fbpidi_portal/<wsgi file name>.py"
  <Directory "C:/<project root directory>/fbpidi_portal">
    <Files <wsgi file name>.py>
      Require all granted
    </Files>
  </Directory>



ErrorLog "C:/<project root directory>/logs/apache.error.log"
CustomLog "C:/<project root directory>/logs/apache.custom.log" common
</VirtualHost>


NameVirtualHost domain2.com:80
<VirtualHost domain2.com:80>
  ServerAlias www.domain2.com       
  ServerName domain2.com
  Redirect permanent / https://domain2.com
</VirtualHost>

 

<VirtualHost domain2.com:443>

ServerAlias www.domain2.com       
ServerName domain2.com
ServerAdmin [email protected]
 
SSLEngine On
SSLCertificateFile "C:/<SSL certificate directory>/<certificate-name>.crt"
SSLCertificateChainFile "C:/<SSL certificate directory>/<certificate-name>.ca-bundle"
SSLCertificateKeyFile "C:/<SSL certificate directory>/<certificate-name>.key"

Alias /static/ "C:/<project root directory>/static/"
  <Directory "C:/<project root directory>/static">
    Require all granted
  </Directory>

Alias /media/ "C:/<project root directory>/media/"
  <Directory "C:/<project root directory>/media">
    Require all granted
  </Directory>

WSGIScriptAlias / "C:/<project root directory>/<project name>/wsgi.py"
  <Directory "C:/<project root directory>/<project name>">
    <Files wsgi.py>
      Require all granted
    </Files>
  </Directory>



ErrorLog "C:/<project root directory>/logs/apache.error.log"
CustomLog "C:/<project root directory>/logs/apache.custom.log" common
</VirtualHost>



Listen 8080

<VirtualHost 0.0.0.0:8080>

ServerAlias 0.0.0.0      
ServerName 0.0.0.0
ServerAdmin [email protected]


Alias /static/ "C:/<project root path>/static/"
  <Directory "C:/<project root path>/static">
    Require all granted
  </Directory>

Alias /media/ "C:/<project root path>/media/"
  <Directory "C:/<project root path>/media">
    Require all granted
  </Directory>

WSGIScriptAlias / "C:/<project root path>/<app name>/wsgi.py"
  <Directory "C:/<project root path>/<app name>">
    <Files wsgi.py>
      Require all granted
    </Files>
  </Directory>



ErrorLog "C:/<project root path>/logs/apache.error.log"
CustomLog "C:/<project root path>/logs/apache.custom.log" common
</VirtualHost>
in flag
Without seeing the actual configuration we can't even guess. Also, there is no such thing as a "Windows 10 server". Please state the actual versions your are using.
djdomi avatar
za flag
it looks for me like that you try to hide that you using windows 10 as a server. that's off topic and against the ToS. which paths has been used for the vhosts?
Wogayehu avatar
cn flag
No I'm using windows server 2016 I wrote 10 by mistake
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.