how to create virtual host on XAMPP
I see two errors:
<VirtualHost *:80> -> Fix to :8081, your POrt the server runs on
ServerName comm-app.local
DocumentRoot "C:/xampp/htdocs/CommunicationApp/public"
SetEnv APPLICATION_ENV "development"
<Directory "C:/xampp/htdocs/CommunicationApp/public" -> This is probably why it crashes, missing >
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
-> MIssing close container: </VirtualHost>
Fixed version:
<VirtualHost *:8081>
ServerName comm-app.local
DocumentRoot "C:/xampp/htdocs/CommunicationApp/public"
SetEnv APPLICATION_ENV "development"
<Directory "C:/xampp/htdocs/CommunicationApp/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
One thing to mention:
You can always try and run command:
service apache2 configtest
This will tell you when you got a malformed configuration and maybe even can tell you where the problem is.
Furthermore it helps avoid unavailability in a LIVE system:
service apache2 restart
will shutdown and then fail to start, this configtest you know beforehand "oops I did something wrong, I should fix this first" but the apache itself is still running with old configuration. :)
How to create virtual host in Xampp windows 10
You need to correct your settings like below :- need to define {projectName}
<VirtualHost *:80>
DocumentRoot "c:/xampp/htdocs/bab/{projectName}"
ServerName bab.local
<Directory "c:/xampp/htdocs/bab/">
</Directory>
</VirtualHost>
How to setup Virtual Host on XAMPP?
You made a typo error on your host file.
Since you used
local.demoapp.com
as your server name, your host file should be
127.0.0.1 local.demoapp.com
Set up virtual hosts on Apache (XAMPP, Windows 10)
You should change: <VirtualHost *:8081>
to <VirtualHost *:80>
on both counts, fw.local.com attempts to connect to port 80, not 8081.
Edit: You could also keep it the way you have it and connect to: http://fw.local.com:8081/
Create a Virtual Host in Xamp Windows 10
Thank you @ShamSUP AND @maytham-ɯɐɥıλɐɯ I was able to solve my problem by uninstalling the xampp.
Then following the instructions here
I will just list the steps I have done here.
- Windows+R and type
appwiz.cpl
and use Turn Windows features on or off and install the IIS Manager Console by expandingInternet Information Services
->Web Management Tools
->then checkingIIS Management Console
- Windows+R and type
InetMgr.exe
and enter, then expandSite
Right Click it then clickEdit Bindings
- Change the http port from 80 to 8080
After that I then install the XAMPP and configure the Virtual host
host(C:\Windows\System32\drivers\etc\hosts) file
127.0.0.1 sample.local
127.0.0.1 anothersample.local
vhost (D:\xampp\apache\conf\extra\httpd-vhosts.conf) file
<VirtualHost *:80>
DocumentRoot "D:\xampp\htdocs\sample"
ServerName sample.local
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/anothersample"
ServerName anothersample.local
</VirtualHost>
And by default in windows virtual host is uncommented
After restarting apache and mysql.The Virtual host is running now.I hope this may help someone in the future.
Related Topics
Append Data to a .Json File With PHP
File_Get_Contents(): PHP_Network_Getaddresses: Getaddrinfo Failed: Name or Service Not Known
How to Remove Extension from String (Only Real Extension!)
How to Get the Real Url After File_Get_Contents If Redirection Happens
How to Split a String by Multiple Delimiters in PHP
Composer Warning: Openssl Extension Is Missing. How to Enable in Wamp
Why Use a Psr-0 or Psr-4 Autoload in Composer If Classmap Is Actually Faster
PHP How to Round Down to Two Decimal Places
Strtotime With Different Languages
Show a Pdf Files in Users Browser Via PHP/Perl
Fatal Error: Cannot Use Object of Type MySQLi_Result
How to Programmatically Login/Authenticate a User
How to Do Left Join in Doctrine
How to Get Enum Possible Values in a MySQL Database
Cannot Modify Header Information - Headers Already Sent By... Wordpress Issue
PHP Password_Hash(), Password_Verify()
PHP Substring Extraction. Get the String Before the First '/' or the Whole String