'Using Apache XAMPP on Windows 10 to create 1 Django website and one normal website
I have created a Django protect that works perfectly fine on windows Apache with Xampp. However, if I try to create a virtual host for a non-Django website, it doesn't work.
If I then put my Django website into a virtual host it doesn't work, but then my non-Django website does work.
By doesn't work I mean it takes me to this https://i.stack.imgur.com/DS0a5.png
Here is all my code for my Django website inside a virtual host and my other non-project in a virtual host.
#Django Website
<VirtualHost *:443 _default_:443 neostorm.us.to:443>
ServerName neostorm.us.to
ServerAlias neostorm.us.to
Alias /static "C:/xampp/htdocs/neostorm/static"
<Directory "C:/xampp/htdocs/neostorm/static">
Require all granted
</Directory>
WSGIScriptAlias / "C:/xampp/htdocs/neostorm/neostorm/wsgi_windows.py" application-group=neostorm
<Directory "C:/xampp/htdocs/neostorm/neostorm">
<Files wsgi_windows.py>
Require all granted
</Files>
</Directory>
ErrorLog "C:\xampp\apache\logs\neostorm_error.log"
CustomLog "C:\xampp\apache\logs\neostorm_custom.log" common
</VirtualHost>
#Non Django Website
<VirtualHost *:443 mail.neostorm.us.to:443>
ServerName mail.neostorm.us.to
DocumentRoot "C:/xampp/htdocs/webmail"
<Directory "C:/xampp/htdocs/webmail">
Require all granted
</Directory>
</VirtualHost>
Any help would be appreciated.
Solution 1:[1]
The problem was there was a virtual host inside the httpd-ssl.conf file. Simply delete the virtual host inside that file and create your virtual hosts inside your virtual host file or where ever you want it.
The reason you may see your index of files is because there is no index.html to open.
This is an example of a virtual host
<VirtualHost *:443>
ServerName example.com
DocumentRoot "C:/xampp/htdocs/example"
<Directory "C:/xampp/htdocs/neostorm/webmail">
AllowOverride All
Require all granted
Options +Indexes
</Directory>
SSLEngine on
SSLCertificateFile "conf/example/example.com-chain.pem"
SSLCertificateKeyFile "conf/example/example.com-key.pem"
</VirtualHost>
If there is no index file inside that document root, you will see the index/ page.
Just a footnote, Options +Indexes tells your web server to show an index page like seen in the photo. Use Options -Indexes to prevent showing the index/ page, this is beneficial if you have a static folder.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | KyTDK |
