virtual hosts only show root/localhost index, not the subdirectory
Posted by: ciprianmp (---.210.53.43.getinternet.no)
Date: November 07, 2014 10:00PM

Hi,

After following the Virtual Hosts tutorial, I succeeded to add my vhosts, including the vhost left menu.
Previously, I have followed how to NOT suppress_localhost, it worked fine, but I reverted to have localhost/ hidden. It seems it works fine.

The problem is, when I click on any of the vhost labels in the left menu, it opens the url (i.e. mychat/) but it displays the default localhost/root index. It is the same when I click on any of my "Your projects".

My hosts file:
# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

127.0.0.1       localhost
127.0.0.1       calendar
127.0.0.1       plus


::1             localhost
::1			    calendar
::1			    plus
refresh.php
			$myreplacesubmenuProjects .= 'Type: item; Caption: "'.$projectContents[$i].'"; Action: run; FileName: "'.$c_navigator.'"; Parameters: "['.$projectContents][$i].'/"; Glyph: 5
index.php
$suppress_localhost = true;
wampmanager.conf
suppressLocalhost = "yes"
httpd-vhosts.conf
<VirtualHost *:80>
    DocumentRoot "C:/wamp25/www"
    ServerName  localhost
    ServerAlias localhost
    <Directory  "C:/wamp25/www">
        AllowOverride All

        <IfDefine APACHE24>
            Require local
        </IfDefine>

        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </IfDefine>
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/wamp25/www/calendar"
    ServerName  CalendarLocClass
    ServerAlias CalendarLocClass
    <Directory  "C:/wamp25/www/calendar">
        AllowOverride All

        <IfDefine APACHE24>
            Require local
        </IfDefine>

        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </IfDefine>
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/wamp25/www/plus"
    ServerName  phpMyChat-Plus
    ServerAlias phpMyChat-Plus
    <Directory  "C:/wamp25/www/plus">
        AllowOverride All

        <IfDefine APACHE24>
            Require local
        </IfDefine>

        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </IfDefine>
    </Directory>
</VirtualHost>

What could be wrong? (what other file should I look into?

Ciprian M.

Options: ReplyQuote
Re: virtual hosts only show root/localhost index, not the subdirectory
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: November 07, 2014 10:48PM

The name you use in the hosts file should match the name you use as the Virtual Hosts ServerName

So HOSTS

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

127.0.0.1       localhost calendar plus
::1             localhost calendar plus

and the VH

<VirtualHost *:80>
    DocumentRoot "C:/wamp25/www"
    ServerName  localhost
    ServerAlias localhost
    <Directory  "C:/wamp25/www">
        AllowOverride All

        <IfDefine APACHE24>
            Require local
        </IfDefine>

        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </IfDefine>
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/wamp25/www/calendar"
    ServerName  calendar 
    ServerAlias www.calendar 
    <Directory  "C:/wamp25/www/calendar">
        AllowOverride All

        <IfDefine APACHE24>
            Require local
        </IfDefine>

        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </IfDefine>
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/wamp25/www/plus"
    ServerName plus
    ServerAlias www.plus
    <Directory  "C:/wamp25/www/plus">
        AllowOverride All

        <IfDefine APACHE24>
            Require local
        </IfDefine>

        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </IfDefine>
    </Directory>
</VirtualHost>

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: virtual hosts only show root/localhost index, not the subdirectory
Posted by: ciprianmp (---.210.53.43.getinternet.no)
Date: November 07, 2014 10:59PM

Thank you, it worked. I suggest you add this mention in the vhosts tutorial winking smiley

Ciprian M.

Options: ReplyQuote


Sorry, only registered users may post in this forum.