Quantcast
Viewing all articles
Browse latest Browse all 17

Answer by Undry for how to create virtual host on XAMPP

I have been looking for the solution for quite a bit. And finally I have the answer. If your virtual host is not working on your Windows 10, or 7 etc, it's because of this new https hype, where all the sites are routed to https.

XAMPP follows the same trend, so fixing virtual hosts, hosts file etc is not enough, due to strict https redirection. Here is the full solution.

My desired site is located at D:\xampp\htdocs\ikeen.

1) Add this to your httpd-vhosts.conf:

<VirtualHost *:80>     ServerName localhost     DocumentRoot "D:\xampp\htdocs"<Directory "D:\xampp\htdocs">         DirectoryIndex index.php</Directory></VirtualHost><VirtualHost *:80>     ServerName ikeen.localhost     DocumentRoot "D:\xampp\htdocs\ikeen"     SetEnv APPLICATION_ENV "development"<Directory "D:\xampp\htdocs\ikeen">         DirectoryIndex index.php         AllowOverride All         Order allow,deny         Allow from all        </Directory></VirtualHost>

2) Add this to the end of httpd.conf:

<Directory />    AllowOverride none    Require all granted</Directory>

3) Add this line to your hosts file in Windows directory

127.0.0.1      ikeen.localhost

4) The final step is to change the VirtualHost section of your httpd-ssl.conf file to the following

<VirtualHost _default_:443>#   General setup for the virtual hostDocumentRoot "D:/xampp/htdocs"#ServerName www.example.com:443ServerName localhostServerAdmin admin@example.comErrorLog "D:/xampp/apache/logs/error.log"TransferLog "D:/xampp/apache/logs/access.log"#   General setup for the ikeen hostDocumentRoot "D:/xampp/htdocs/ikeen"#ServerName www.example.com:443ServerName ikeen.localhostServerAdmin admin@example.comErrorLog "D:/xampp/apache/logs/error.log"TransferLog "D:/xampp/apache/logs/access.log"

Restart and be happy:)


Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>