Invalid command 'VirtualDocumentRoot' - php

I tried to configure my virtual PHP Devserver to use a part of the domain to serve different Directory's depending on the domain the request comes from... I guess that apache's missing the Virtual alias Module. I just can't figure out how i can check if it is there and if not how I can Install it... Below you'll find the site config file I was working on when I run a2dissite on it Apache Starts up just fine It's only when i enable vboxsf that it fails on startup/reload or whenever runs "configtest" on it's configuration...
Here is /etc/apache2/sites-available/vboxsf.conf
<VirtualHost *:80 *:8080>
ServerName sandbox
ServerAlias *.dev
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/dev-error.log
CustomLog ${APACHE_LOG_DIR}/dev-access.log combined
RewriteEngine On
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /media/>
Order allow,deny
Allow from all
Require all granted
</Directory>
<Location /server-status>
SetHandler server-status
Order allow,deny
Allow from all
Require all granted
</Location>
UseCanonicalName Off
VirtualDocumentRoot /media/sf_%1
</VirtualHost>
The output from sudo service apache2 reload
* Reloading web server apache2 *
* The apache2 configtest failed. Not doing anything.
Output of config test was:
AH00526: Syntax error on line 30 of /etc/apache2/sites-enabled/vboxsf.conf:
Invalid command 'VirtualDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
And tail /var/log/apache2/error.log
[Wed Mar 04 17:05:43.698449 2015] [mpm_prefork:notice] [pid 1172] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:28:35.880536 2015] [mpm_prefork:notice] [pid 2604] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:28:35.880657 2015] [core:notice] [pid 2604] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:32:39.675812 2015] [mpm_prefork:notice] [pid 2604] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:32:40.788348 2015] [mpm_prefork:notice] [pid 2715] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:32:40.788487 2015] [core:notice] [pid 2715] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:32:58.596151 2015] [mpm_prefork:notice] [pid 2715] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:32:59.706649 2015] [mpm_prefork:notice] [pid 2787] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:32:59.706763 2015] [core:notice] [pid 2787] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:49:48.283025 2015] [mpm_prefork:notice] [pid 2787] AH00169: caught SIGTERM, shutting down

... or defined by a module not included in the server configuration
You are most likely missing the mod_vhost_alias plugin for apache.

Related

PHP websocket on SSL with proxy_wsTunnel - Apache

I have a php websocket server running but I want to connect to it via https. This is my JS: var conn = new WebSocket('wss://81.169.228.159:3671/wss2');
And this is my apache config:
ProxyPass /wss2/ ws://domain:3671/
I have proxy and proxy_wstunnel enabled.
So, what am I doing wrong?
ERROR LOG:
[Mon Mar 13 04:38:04.228450 2017] [mpm_prefork:notice] [pid 6683] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 04:38:04.228471 2017] [core:notice] [pid 6683] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 12:42:39.475641 2017] [:error] [pid 12432] [client 195.169.9.201:8546] script '/var/www/html/luukwuijster.io/phpinfo.php' not found or unable to stat
[Mon Mar 13 12:56:25.370986 2017] [mpm_prefork:notice] [pid 6683] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 12:56:26.539948 2017] [mpm_prefork:notice] [pid 26932] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 12:56:26.539972 2017] [core:notice] [pid 26932] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:06:36.280229 2017] [mpm_prefork:notice] [pid 26932] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:06:37.473220 2017] [mpm_prefork:notice] [pid 27256] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:06:37.473248 2017] [core:notice] [pid 27256] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:19:52.144983 2017] [mpm_prefork:notice] [pid 27256] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:19:53.235045 2017] [mpm_prefork:notice] [pid 27775] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:19:53.235083 2017] [core:notice] [pid 27775] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:22:21.467607 2017] [mpm_prefork:notice] [pid 27775] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:22:22.618416 2017] [mpm_prefork:notice] [pid 27911] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:22:22.618455 2017] [core:notice] [pid 27911] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:28:08.356148 2017] [mpm_prefork:notice] [pid 27911] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:28:09.546926 2017] [mpm_prefork:notice] [pid 28540] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:28:09.546964 2017] [core:notice] [pid 28540] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:35:26.856446 2017] [mpm_prefork:notice] [pid 28540] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:35:28.532498 2017] [mpm_prefork:notice] [pid 29153] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:35:28.532541 2017] [core:notice] [pid 29153] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 13:46:19.084561 2017] [ssl:error] [pid 29170] [client 208.93.152.93:54712] AH02042: rejecting client initiated renegotiation
[Mon Mar 13 13:57:14.410892 2017] [mpm_prefork:notice] [pid 29153] AH00169: caught SIGTERM, shutting down
[Mon Mar 13 13:57:16.465381 2017] [mpm_prefork:notice] [pid 29927] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Mar 13 13:57:16.465424 2017] [core:notice] [pid 29927] AH00094: Command line: '/usr/sbin/apache2'
[Mon Mar 13 14:00:03.312882 2017] [:error] [pid 29936] [client 81.169.228.159:33706] PHP Notice: Undefined index: text in /var/www/html/luukwuijster.io/slack/cronofy/huiswerk.php on line 9
I assume that you have a React\Socket\Server listening on port 8080 (aka php push-server.php). The tutorial on the ratchet website should get you up to this point.
I also assume that you have already configured and loaded the proxy and proxy_wstunnel apache modules as mentioned in the question.
Below is the config I personally use to achieve a WebSocket connection.
I use /ws/ instead of the /wss2/ mentioned in the tutorial for a better looking URL. Feel free to adjust the config as necessary.
Apache Config
#SSL (Secure)
<VirtualHost *:443>
DocumentRoot /FILE_PATH_TO_WEBROOT
ServerName local.sitename.com
ServerAlias local.sitename.com
<Directory /FILE_PATH_TO_WEBROOT>
Options FollowSymLinks
AllowOverride all
php_flag display_errors On
Require all granted
</Directory>
SSLCertificateFile /etc/httpd/ssl/.crt
SSLCertificateKeyFile /etc/httpd/ssl/.key
ProxyRequests Off
ProxyPass "/ws/" "ws://local.sitename.com:8080/"
</VirtualHost>
#NON-SSL (Insecure)
<VirtualHost *:80>
DocumentRoot /FILE_PATH_TO_WEBROOT
ServerName local.sitename.com
ServerAlias local.sitename.com
<Directory /FILE_PATH_TO_WEBROOT>
Options FollowSymLinks
AllowOverride all
php_flag display_errors On
Require all granted
</Directory>
ProxyRequests Off
ProxyPass "/ws/" "ws://local.sitename.com:8080/"
</VirtualHost>
Secure JavaScript Socket Connection
var conn = new WebSocket('wss://local.sitename.com/ws/');
Insecure JavaScript Socket Connection
var conn = new WebSocket('ws://local.sitename.com/ws/');

WAMP 403 forbidden from external sources

I have read a ton of threads here and elsewhere but none of the suggestions have worked. I installed the latest version of WAMP 64 bit on a fresh install of Windows Server 2012 R2.
I created a subdirectory within the www directory called andrew. In that is an index.html file.
I added the following to the hosts file:
127.0.0.1 andrew
::1 andrew
I added the following to the httpd-vhosts.conf file:
<VirtualHost *:80>
DocumentRoot "c:/wamp64/www/andrew"
ServerName andrew
<Directory "c:/wamp64/www/andrew">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I uncommented the virtual hosts line in httpd.conf
I stopped and started net dnscache
I restarted the WAMP services
I "Put Online" the WAMP server
Regardless, when I access the server from another machine like [server IP address]*/andrew/index.html I get a 403 Forbidden error.
Here is the apache error log ("[SERVER IP]" is really the server's actual IP):
[Fri Apr 22 17:10:32.628356 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Apr 22 17:10:34.656507 2016] [mpm_winnt:notice] [pid 4444:tid 312] AH00364: Child: All worker threads have exited.
[Fri Apr 22 17:10:34.672087 2016] [mpm_winnt:notice] [pid 4680:tid 424] AH00430: Parent: Child process 4444 exited successfully.
[Fri Apr 22 17:10:34.921723 2016] [auth_digest:notice] [pid 4724:tid 416] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00455: Apache/2.4.17 (Win64) PHP/5.6.16 configured -- resuming normal operations
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00456: Apache Lounge VC14 Server built: Oct 11 2015 11:49:07
[Fri Apr 22 17:10:34.952892 2016] [core:notice] [pid 4724:tid 416] AH00094: Command line: 'C:\\wamp64\\bin\\apache\\apache2.4.17\\bin\\httpd.exe -d C:/wamp64/bin/apache/apache2.4.17'
[Fri Apr 22 17:10:34.952892 2016] [mpm_winnt:notice] [pid 4724:tid 416] AH00418: Parent: Created child process 4388
[Fri Apr 22 17:10:35.140157 2016] [auth_digest:notice] [pid 4388:tid 312] AH01757: generating secret for digest authentication ...
[Fri Apr 22 17:10:35.171357 2016] [mpm_winnt:notice] [pid 4388:tid 312] AH00354: Child: Starting 64 worker threads.
[Fri Apr 22 17:10:49.899265 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/andrew/index.html
[Fri Apr 22 17:10:50.055249 2016] [authz_core:error] [pid 4388:tid 1040] [client 73.82.23.97:57193] AH01630: client denied by server configuration: C:/wamp64/www/favicon.ico, referer: http://[SERVER IP]/andrew/index.html
I am now thinking it has to do with some setting on Windows 2012 Server, but I can't figure it out. Help.
Because Apache doesn't know to associate the IP address with your virtual host, it uses the main server settings. Probably you don't need a virtual host at all, but try this anyway:
<VirtualHost *:80>
DocumentRoot "c:/wamp64/www/andrew"
ServerName andrew
#of course, enter your IP address here
ServerAlias 1.2.3.4
<Directory "c:/wamp64/www/andrew">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
please don't forget to edit phpMyAdmin.conf file. It will save your time to face 403 Error (403 Forbidden). You should set Require all granted into it as follows (indipendently by used phpMyAdmin version):
Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin5.0.2/"
<Directory "c:/wamp64/apps/phpmyadmin5.0.2/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
# To import big file you can increase values
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</Directory>

Laravel connection reset after any file changes

I have laravel 4.2 installed in a local environment (windows 10) for testing, but keep getting a connection reset error after updating any files.
My project will load and the server properly displays my pages. However if I update a file (index for example) and then try access a page that renders the newly updated file, I always get a connection reset error. Even a change as simple as a period.
Even more interesting is when I use php artisan to serve my files, I never get the connection reset problem. If I visit the page through artisan serve it works, and then all the sudden xampp wants to work, but only after I have loaded the page from artisan once before.
If I make changes to the file again I have to repeat this process.
Local Setup
My project is being hosted locally from xampp (v 3.2.2) with the following v-hosts config. The hosts files have also been properly configured.
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/myproject/public"
ServerName myproject.local
ServerAlias myproject.local
ErrorLog "logs/myproject.log"
CustomLog "logs/custom.myproject.log" combined
<Directory "C:/xampp/htdocs/myproject/public">
AllowOverride All
Require all granted
</Directory>
In short: I change a file, I get connection reset on xampp when trying to access that page. I view the page from artisan and then refresh the page on xampp, all the sudden it works.
Update
I have tried alternates such as laragon suggested by Lucas, however the same error persists. After updating any file when trying to access that page I get a connection reset error.
I have found more information looking at the apache log in laragon.
[Tue Mar 01 08:52:22.785519 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00428: Parent: child process 8276 exited with status 3221225725 -- Restarting.
[Tue Mar 01 08:52:22.928687 2016] [ssl:warn] [pid 6748:tid 544] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Mar 01 08:52:22.938712 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00455: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.16 configured -- resuming normal operations
[Tue Mar 01 08:52:22.938712 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00456: Apache Lounge VC11 Server built: Oct 13 2015 10:54:13
[Tue Mar 01 08:52:22.938712 2016] [core:notice] [pid 6748:tid 544] AH00094: Command line: 'C:\\laragon\\bin\\apache\\apache-2.4.17/bin/httpd -d C:/laragon/bin/apache/apache-2.4.17'
[Tue Mar 01 08:52:22.939695 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00418: Parent: Created child process 3672
[Tue Mar 01 08:52:23.214917 2016] [ssl:warn] [pid 3672:tid 532] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Mar 01 08:52:23.296629 2016] [ssl:warn] [pid 3672:tid 532] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Mar 01 08:52:23.306647 2016] [mpm_winnt:notice] [pid 3672:tid 532] AH00354: Child: Starting 64 worker threads.
[Tue Mar 01 08:52:24.159843 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00428: Parent: child process 3672 exited with status 3221225725 -- Restarting.
[Tue Mar 01 08:52:24.305896 2016] [ssl:warn] [pid 6748:tid 544] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Mar 01 08:52:24.315916 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00455: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.16 configured -- resuming normal operations
[Tue Mar 01 08:52:24.315916 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00456: Apache Lounge VC11 Server built: Oct 13 2015 10:54:13
[Tue Mar 01 08:52:24.315916 2016] [core:notice] [pid 6748:tid 544] AH00094: Command line: 'C:\\laragon\\bin\\apache\\apache-2.4.17/bin/httpd -d C:/laragon/bin/apache/apache-2.4.17'
[Tue Mar 01 08:52:24.317905 2016] [mpm_winnt:notice] [pid 6748:tid 544] AH00418: Parent: Created child process 3600
[Tue Mar 01 08:52:24.580068 2016] [ssl:warn] [pid 3600:tid 552] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Mar 01 08:52:24.666114 2016] [ssl:warn] [pid 3600:tid 552] AH01909: www.example.com:8443:0 server certificate does NOT include an ID which matches the server name
[Tue Mar 01 08:52:24.675120 2016] [mpm_winnt:notice] [pid 3600:tid 552] AH00354: Child: Starting 64 worker threads.
This issue was finally resolved with a configuration change with Apache.
Add the following to the httpd.conf file:
<IfModule mpm_winnt_module>
ThreadStackSize 8888888
</IfModule>
Then Restart.
The problem is that windows has a smaller stack size by default than on the Linux/Unix systems. It took me a while to figure this out. Apache was silently crashing and I was getting no errors in my logs making it hard to trace.
The project I am working on has large regular expression calls and apparently this was a known trigger to cause this issue with apache on windows. If you look at apache documentation we can update the ThreadStackSize to a value closer to Unix/Linux systems of 8MB.
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#ThreadStackSize
I hope this helps anyone else developing on a windows system running apache as a local server. This was a major headache for some time.
php artisan serve use the PHP built on server (php -S localhost:80 -t public) to host the application.
Maybe the problem can be your apache configuration, so try this:
# define DOCROOT variable
define DOCROOT "C:/xampp/htdocs"
<Directory "${DOCROOT}">
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/myproject/public/"
ServerName myproject.dev
</VirtualHost>
if the problem persists, try use Laragon and open it always as administrator.
Opening php error log may help you find the real problem. there was an error in my codes( using isset() directly on a function )

Not able to access zend framework 1.12 home page

I am trying to use zend framework 1.12 on WAMP 2.5.
I took following steps to create zend project on WAMP:-
created a project using 'zf' tool from command line.
created an entry in host file.
127.0.0.1 zendy.local
added a virtual host entry in conf\extra\httpd-vhosts.conf.
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/zendy/public"
ServerName zendy.local
<Directory "C:/wamp/www/zendy/public">
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
enabled rewrite module
But when I try to access zendy.local I get HTTP 500 internal server error.
Excerpt from apache error log
[Sat Nov 15 09:19:13.739450 2014] [mpm_winnt:notice] [pid 3424:tid
552] AH00422: Parent: Received shutdown signal -- Shutting down the
server.
[Sat Nov 15 09:19:15.761937 2014] [mpm_winnt:notice] [pid
6832:tid 476] AH00364: Child: All worker threads have exited.
[SatNov 15 09:19:15.777562 2014] [mpm_winnt:notice] [pid 3424:tid 552]
AH00430: Parent: Child process 6832 exited successfully.
[Sat Nov 15 09:19:17.574459 2014] [mpm_winnt:notice] [pid 5700:tid 556] AH00455:
Apache/2.4.9 (Win64) PHP/5.5.12 configured -- resuming normal
operations
[Sat Nov 15 09:19:17.574459 2014] [mpm_winnt:notice] [pid
5700:tid 556] AH00456: Apache Lounge VC11 Server built: Mar 16 2014
12:42:59
[Sat Nov 15 09:19:17.574459 2014] [core:notice] [pid
5700:tid 556] AH00094: Command line:
'c:\wamp\bin\apache\apache2.4.9\bin\httpd.exe -d
C:/wamp/bin/apache/apache2.4.9'
[Sat Nov 15 09:19:17.574459 2014]
[mpm_winnt:notice] [pid 5700:tid 556] AH00418: Parent: Created child
process 6780
[Sat Nov 15 09:19:17.918210 2014] [mpm_winnt:notice]
[pid 6780:tid 484] AH00354: Child: Starting 64 worker threads.
Any help will be appreciated
You are in Production mode so you are not able to see any error just 500 Internal Server Error.
So Just add SetEnv APPLICATION_ENV "development" in your virtual host it will bring you in development mode.
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/zendy/public"
ServerName zendy.local
SetEnv APPLICATION_ENV "development"
<Directory "C:/wamp/www/zendy/public">
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
So now zend framework shows you what is the actual error or exception bothering you.

Apache 2.4.4 WAMP VHosts error

I had created two VirtualHosts earlier namely [localhost] and "phpsite". Yesterday I renamed "phpsite" as "phppages" and added one more virtual host named "techsupport.com". I use port 8088 on my Apache server. But now I am able to use [localhost]:8088 and phpsite:8088 though there's no virtual host named "phpsite" and if I go for techsupport.com:8088 I get nothing.
Here's my vhost content:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost *:80>
# ServerAdmin webmaster#dummy-host.example.com
# DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error.log"
# CustomLog "logs/dummy-host.example.com-access.log" common
#</VirtualHost>
#<VirtualHost *:80>
# ServerAdmin webmaster#dummy-host2.example.com
# DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
# ServerName dummy-host2.example.com
# ErrorLog "logs/dummy-host2.example.com-error.log"
# CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost>
<VirtualHost *:8088>
ServerAdmin admin#example.com
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias www.localhost.com
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "c:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
<VirtualHost *:8088>
DocumentRoot "e:/techsupport"
ServerName techsupport.com
ServerAlias www.techsupport.com
ErrorLog "logs/techsupport-error.log"
CustomLog "logs/techsupport-access.log" common
<Directory "e:/TechSupport">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
<VirtualHost *:8088>
DocumentRoot "e:/phppages"
ServerName phppages
ServerAlias www.phppages.com
ErrorLog "logs/phppages-error.log"
CustomLog "logs/phppages-access.log" common
<Directory "e:/PHPPages">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
Apache's error log shows this:
[Sun Aug 25 12:50:06.646882 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 12:50:06.646882 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 12:50:06.646882 2013] [core:notice] [pid 7936:tid 500] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 12:50:06.647883 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00418: Parent: Created child process 912
[Sun Aug 25 12:50:07.216263 2013] [mpm_winnt:notice] [pid 912:tid 384] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 12:51:15.409867 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 12:51:17.411205 2013] [mpm_winnt:notice] [pid 912:tid 384] AH00364: Child: All worker threads have exited.
[Sun Aug 25 12:51:17.433218 2013] [mpm_winnt:notice] [pid 7936:tid 500] AH00430: Parent: Child process 912 exited successfully.
[Sun Aug 25 12:51:30.206760 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 12:51:30.207763 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 12:51:30.207763 2013] [core:notice] [pid 11396:tid 204] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 12:51:30.208763 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00418: Parent: Created child process 4808
[Sun Aug 25 12:51:30.670070 2013] [mpm_winnt:notice] [pid 4808:tid 384] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:25:30.406049 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:25:32.406924 2013] [mpm_winnt:notice] [pid 4808:tid 384] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:25:32.423935 2013] [mpm_winnt:notice] [pid 11396:tid 204] AH00430: Parent: Child process 4808 exited successfully.
[Sun Aug 25 13:28:38.706114 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:28:38.706114 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:28:38.706114 2013] [core:notice] [pid 10328:tid 516] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:28:38.708114 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00418: Parent: Created child process 4716
[Sun Aug 25 13:28:39.170423 2013] [mpm_winnt:notice] [pid 4716:tid 380] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:33:14.347584 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:33:16.349839 2013] [mpm_winnt:notice] [pid 4716:tid 380] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:33:16.369232 2013] [mpm_winnt:notice] [pid 10328:tid 516] AH00430: Parent: Child process 4716 exited successfully.
[Sun Aug 25 13:33:18.445939 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:33:18.445939 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:33:18.445939 2013] [core:notice] [pid 7048:tid 464] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:33:18.446940 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00418: Parent: Created child process 2556
[Sun Aug 25 13:33:18.801179 2013] [mpm_winnt:notice] [pid 2556:tid 324] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:35:23.175992 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:35:25.178255 2013] [mpm_winnt:notice] [pid 2556:tid 324] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:35:25.197268 2013] [mpm_winnt:notice] [pid 7048:tid 464] AH00430: Parent: Child process 2556 exited successfully.
[Sun Aug 25 13:35:28.224795 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:35:28.224795 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:35:28.224795 2013] [core:notice] [pid 10616:tid 504] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:35:28.225792 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00418: Parent: Created child process 4012
[Sun Aug 25 13:35:28.599042 2013] [mpm_winnt:notice] [pid 4012:tid 324] AH00354: Child: Starting 150 worker threads.
[Sun Aug 25 13:43:03.326392 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 25 13:43:07.389104 2013] [mpm_winnt:notice] [pid 4012:tid 324] AH00364: Child: All worker threads have exited.
[Sun Aug 25 13:43:07.404736 2013] [mpm_winnt:notice] [pid 10616:tid 504] AH00430: Parent: Child process 4012 exited successfully.
[Sun Aug 25 13:45:26.908312 2013] [mpm_winnt:notice] [pid 4788:tid 504] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Sun Aug 25 13:45:26.970818 2013] [mpm_winnt:notice] [pid 4788:tid 504] AH00456: Server built: Feb 22 2013 22:08:37
[Sun Aug 25 13:45:26.970818 2013] [core:notice] [pid 4788:tid 504] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Sun Aug 25 13:45:26.970818 2013] [mpm_winnt:notice] [pid 4788:tid 504] AH00418: Parent: Created child process 5084
[Sun Aug 25 13:45:27.517719 2013] [mpm_winnt:notice] [pid 5084:tid 384] AH00354: Child: Starting 150 worker threads.
In httpd.cnf file:
Listen 0.0.0.0:8088
(Earlier it was just Listen 8088)
And
Include conf/extra/httpd-vhosts.conf
is uncommented as it should be.
I am helpless right now and have already spent 2 days on it. Please help.
Thanks
I had created two VirtualHosts earlier namely [localhost] and "phpsite". Yesterday I renamed "phpsite" as "phppages" and added one more virtual host named "techsupport.com". I use port 8088 on my Apache server. But now I am able to use [localhost]:8088 and phpsite:8088 though there's no virtual host named "phpsite" and if I go for techsupport.com:8088 I get nothing.
The only reason that "phppages" is not working and "phpsite" is working could be because you have a DNS entry or an entry in the host file for "phpsite" and not for "phppages". To debug this I would start by pinging them.
ping phppages
ping phpsite
While we're at the name resolution topic, your techsupport.com:8088 is not going to work because techsupport.com gets resolved to external site. If they don't have port 8088 open to the public, you simply won't be able to navigate to that site on that port. However, if they did then you would have been able to browse their pages not yours.
I'm not sure how WAMP manages host names, but the first thing to check is your DNS Server if you have one, otherwise check C:\Windows\System32\drivers\etc\hosts.
To make phppages work add the following lines to your C:\Windows\System32\drivers\etc\hosts:
127.0.0.1 phppages www.phppages.com
# Similarly for techsupport.com and www.techsupport.com
127.0.0.1 techsupport.com www.techsupport.com
After this your phppages and techsupport urls should work.
Caution: Adding public URLs to your hosts file might cause confusions in future when/if you removed that virtual host from httpd-vhosts.conf and forget to remove corresponding host name from the host file, in which case these public URLs will not be reachable to the correct destination. So, it is not recommended to use public host names for your virtual hosts.
Hope this helps.

Categories