I am sure this question is being asked many times but I am not encounter with a problem. I am using XAMPP where I configure Zend framework.
XAMPP is running on port 8081 as 80 is being occupied by some Windows process I need to use virtual host for that I configure with following code in C:/xampp/apache/config/extra/httpd-vhosts.config
(or C:/xampp/apache/conf/extra/httpd-vhosts.conf
in newer releases).
<VirtualHost *:80>
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>
and also update the hosts file with 127.0.0.1 comm-app.local
and try to re-start apache but it is showing error.
15:03:01 [Apache] Error: Apache shutdown unexpectedly.
15:03:01 [Apache] This may be due to a blocked port, missing dependencies,
15:03:01 [Apache] improper privileges, a crash, or a shutdown by another method.
15:03:01 [Apache] Press the Logs button to view error logs and check
15:03:01 [Apache] the Windows Event Viewer for more clues
15:03:01 [Apache] If you need more help, copy and post this
15:03:01 [Apache] entire log window on the forums
Add this Code in C:\xampp\apache\conf\extra\httpd-vhosts.conf
Now Add your virtual host name in bellow file.
127.0.0.1 qa-staging.com
If you are not able to save this code in host file then right click on notpad select Run as administrator and then you can able to save your custom code now restart your XAMP
Save the Apache configuration file.
for detailed info refer to this
In Your disk drive:\xampp\apache\conf\extra\httpd-vhosts.conf exists an example and you could edit it with your configuration:
then as mentioned above you must add in: System32/Drivers/etc/hosts to the bottom of the file
and
to have possibility run your code with WWW or without WWW, restart Apache and try in the browser:
or
maybe at the first time you must to add like this:
Write these codes end of the C:\xampp\apache\conf\extra\httpd-vhosts.conf file,
between the virtual host tag.
and edit the file System32/Drivers/etc/hosts use notepad as administrator
add bottom of the file
I see two errors:
Fixed version:
One thing to mention:
You can always try and run command:
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:
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. :)
Apache Virtual Host documentation Setting up a virtual host (vhost) provides several benefits:
Example changes over configuration file -
D:\xampp\apache\conf\extra\httpd-vhosts.conf
Update Your Windows Hosts File « Open your Windows hosts file located in
C:\Windows\System32\drivers\etc\hosts.
D:\xampp\apache\conf\httpd.conf, [httpd-ssl.conf](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html)
@see