Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: January 21, 2020 04:54AM

Dear Experts,

I had setup a WAMP server in my PC with Win 8 and Virtual Host was setup as below -

# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/angliadesign/clients2/jhm/site/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride None
# Require local
Require all granted
</Directory>
</VirtualHost>

Our required website is under a sub-folder "Web_Application" as below -

C:\wamp64\www\angliadesign\clients2\jhm\site\Web_Application

When accessing the website by accessing the above sub-folder in Google Chrome, i.e.

[test.jkbrothers.net]

I could NOT access the website and found msg as below -

Not Found
The requested URL /angliadesign/clients2/jhm/site/Web_Application/en/ was not found on this server.

Apache/2.4.39 (Win64) PHP/7.2.18 Server at test.jkbrothers.net Port 80

Don't know why the above msg was found as there is no the above path (....../en/) setup in my PC.

Could you advise how to solve the above problem so that I can access the above website / sub-folder "Web_ Application" ?

Below is the content of "index.php" under the above sub-folder "Web_Application" -

Many Thanks,
KH Fong



Edited 1 time(s). Last edit at 01/21/2020 09:35AM by Otomatic.

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 21, 2020 09:43AM

Hi,

This forum is not intended to debug PHP scripts or SQL queries from users.

Start already by creating a correct VirtualHost, especially since the tool to do so is integrated into Wampserver. And, before doing it, put the httpd-vhosts.conf file back in its initial state.
For information, a copy of the initial files are in :
wamp64\bin\apache\apache2.4.41\conf\original\wampserver\

See The need for Virtual Host and Wampserver 3 - Create or add a VirtualHost

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: January 21, 2020 10:03AM

Dear Otomatic (Moderator),

Thanks for your response.

Could you just advise whether the above problem is due to PHP scripts' bug or SQL queries' bug or other WAMP settings or else ?


Many Thanks,
KH Fong

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 21, 2020 10:27AM

Hi,

> DocumentRoot "${INSTALL_DIR}/www"
> <Directory "${INSTALL_DIR}/www/angliadesign/clients2/jhm/site/">

First of all the VirtualHost localhost must never be modified.

Second, how would you want a site that is physically located in the "${INSTALL_DIR}/www/angliadesign/clients2/jhm/site/" folder but for which you declare the DocumentRoot to be "${INSTALL_DIR}/www" to work?

See [httpd.apache.org]

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 21, 2020 10:59AM

Hi,

Your VirtualHost should be something like this:
<VirtualHost *:80>
   ServerName angliadesign
   DocumentRoot "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application"
  <Directory "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    Require local
  </Directory>
</VirtualHost>

Of course with in the hosts file
127.0.0.1 angliadesign
::1 angliadesign

And, you will connect to your local site via 'http://angliadesign/' using the ServerName.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: January 21, 2020 12:30PM

Dear Otomatic (Moderator),

Thanks for your advice.

For your above settings such as DocumentRoot & Directory are "C:/........", does it mean that the domain is also not required to register from some domain registration vendor(s) and we can still access the website as below ?

'http://angliadesign/.........'

Actually, we are using our registered domain name "test.jkbrothers.net" so the DocumentRoot was setup as below (and above) -

DocumentRoot "${INSTALL_DIR}/www"


It is also worked when accessing other sub-folders under the "C:\wamp64\www\angliadesign\clients2\jhm\site", e.g.

[test.jkbrothers.net]

[test.jkbrothers.net]

Could you also advise whether the above problem (cannot access the following folder) is due to PHP scripts' bug or SQL queries' bug or other WAMP settings or still Virtual Host settings, or else ?

[test.jkbrothers.net]


Many Thanks,
KH Fong

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 21, 2020 03:43PM

Hi,

Wampserver is intended for local web development and has absolutely no need for a registered domain name.

> DocumentRoot "${INSTALL_DIR}/www"

NO, NO, NO, NO, and NO again. This is localhost's DocumentRoot; it is reserved for localhost and cannot and should not be used for anything else.

You don't want to understand or apply what I've been explaining to you from the beginning. This is the end.

You want to do it all at once: create a VirtualHost, put a site on it and make it accessible from outside from a registered domain name.
It can't be done "just like that" by doing anything and hoping it works.
The steps must be broken down, done one by one, making sure that the current step works perfectly before moving on to the next one.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 01/21/2020 04:10PM by Otomatic.

Re: Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: January 22, 2020 08:33AM

Dear Otomatic (Moderator),

Even if following your above advice to change the Virtual Host as below -

# Virtual Hosts
#
<VirtualHost *:80>
ServerName jkbrothers
# ServerAlias localhost
# DocumentRoot "${INSTALL_DIR}/www"
DocumentRoot "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application"
# <Directory "${INSTALL_DIR}/www/angliadesign/clients2/jhm/site/">
<Directory "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
# Require all granted
</Directory>
</VirtualHost>

Found nothing thr the following links -

[jkbrothers]
Msg as below -
無法連上這個網站 找不到 jkbrothers 的伺服器 IP 位址。
你要找的是 [jkbrothers.net] 嗎?
請透過 Google 搜尋「jk brothers」
ERR_NAME_NOT_RESOLVED


[jkbrothers]
Msg as below -
無法連上這個網站 找不到 jkbrothers 的伺服器 IP 位址。
嘗試執行 Windows 網路診斷。
DNS_PROBE_FINISHED_NXDOMAIN


Could you also advise ?


Tks,
KH Fong

Re: Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: January 23, 2020 03:50AM

Dear Otomatic (Moderator) / Experts,

Our Virtual Host has been restored to original as below (& above) -

# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/angliadesign/clients2/jhm/site/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride None
# Require local
Require all granted
</Directory>
</VirtualHost>

At least the following sub-folders can be accessed -

[test.jkbrothers.net]

[test.jkbrothers.net]

Just CANOT access the following sub-folder -

[test.jkbrothers.net]

Msg is as below -
Not Found
The requested URL /angliadesign/clients2/jhm/site/Web_Application/en/ was not found on this server.
Apache/2.4.39 (Win64) PHP/7.2.18 Server at test.jkbrothers.net Port 80

Don't know why the above "en/" was defaulted after the "........Web_Application/" !!

Could you also advise whether the above problem is due to PHP scripts' bug or SQL queries' bug or other WAMP settings or still Virtual Host settings, or else ?

Below is the content of "index.php" under the above sub-folder "Web_Application" -
<?php
include('core/framework.php');
$framework = new framework();
$framework->call('common', 'func');
$framework->init();
?>


Tks,
KH Fong

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 23, 2020 10:44AM

Hi,

> Our Virtual Host has been restored to original as below (& above) -
NO !
Original is :
# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

And I repeat once again - this will be the last one - that you need to add a VirtualHost for "angliadesign" with the ServerName you want but with a DocumentRoot that points to the root folder of this site; that you also need this site to work perfectly locally BEFORE you want to access it from the outside.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: January 23, 2020 10:55AM

Dear Otomatic (Moderator),

Refer my above post on January 22, 2020 08:33AM, by following your instructions but NOT worked -

[jkbrothers]
Error msg as below -
無法連上這個網站 找不到 jkbrothers 的伺服器 IP 位址。
你要找的是 [jkbrothers.net] 嗎?
請透過 Google 搜尋「jk brothers」
ERR_NAME_NOT_RESOLVED


[jkbrothers]
Error msg as below -
無法連上這個網站 找不到 jkbrothers 的伺服器 IP 位址。
嘗試執行 Windows 網路診斷。
DNS_PROBE_FINISHED_NXDOMAIN

Could you also advise ?


Tks,
KH Fong

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 23, 2020 11:37AM

LOCAL

you also need this site to work perfectly locally BEFORE you want to access it from the outside.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: January 23, 2020 12:17PM

How to do as below ?


LOCAL

you also need this site to work perfectly locally BEFORE you want to access it from the outside.


Tks,

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 23, 2020 12:42PM


Re: Cannot access website folder
Posted by: khofong3 (203.145.95.---)
Date: January 23, 2020 09:57PM

Dear Otomatic (Moderator),

Do you mean to follow your advice on January 21, 2020 10:59AM ?

<VirtualHost *:80> 
    ServerName angliadesign 
    DocumentRoot "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application" 
    <Directory "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application/"> 
        Options +Indexes +Includes +FollowSymLinks +MultiViews 
        AllowOverride all 
        Require local 
    </Directory> 
</VirtualHost>
Do you mean the localhost name must be "angliadesign" ?

Why setup as below ?
AllowOverride all
Require local


Tks,
KH Fong



Edited 1 time(s). Last edit at 01/23/2020 11:20PM by RiggsFolly.

Re: Cannot access website folder
Posted by: Otomatic (Moderator)
Date: January 24, 2020 10:12AM

Hi,

> Do you mean the localhost name must be "angliadesign" ?
- 1 - It is NOT localhost name but ServerName
- 2 - It's the name you want and that corresponds to the criteria

> Why setup as below ?
> AllowOverride all
> Require local
RTFM - Apache documentation -> [httpd.apache.org]
And you can even see it in Simplified Chinese.

Note:
With Wampserver, you have installed a web server, a database server, PHP language and SQL queries.
Congratulations, this means that you are now supposed to be:

- Network Administrator
- Web Server Administrator
- Database Administrator
- Developer
- Analyst
- Programmer.
- Hosting
- and the like

All of these roles normally occupy at least one person per area. These people are expected to know what they are doing before they start.

WAMPServer is primarily a LEARNING TOOL, so that people can learn and try to take control of one or more of these jobs.

Out of the box, WAMPServer works the first time 99.9% of the time. The remaining 0.1% are mainly due to the non-respect of the prerequisites.

However, the skills needed to use it correctly do not acquire themselves, and are not part of the Wampserver box.

The role of this forum is to allow you the basic operation of Wampserver, i.e. :
- Icon of the notification area of the taskbar colored green.
- Access to the Wampserver home page "localhost".
- No error message at the bottom of the "localhost" page.
- Local access to PhpMyAdmin

At this point, Wampserver is functional; the rest: installation of CMS or WEB application, access from outside, site hosting, resolution of PHP errors, etc. is not within the scope of this forum.

I've already spent far too much time solving your problem that is not directly related to Wampserver and I'll stop there. Either you hire a professional or you have your site hosted by a web host.

Try, try, modify, erase, start again and, as Nicolas Boileau wrote, around 1670:

Hâtez-vous lentement, et sans perdre courage,
Vingt fois sur le métier remettez votre ouvrage,
Polissez-le sans cesse, et le repolissez,
Ajoutez quelquefois, et souvent effacez.

Make haste slowly, and without losing heart,
Twenty times on the job put your work back,
Polish it over and over and over again,
Sometimes add, and often delete.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Cannot access website folder
Posted by: khofong3 (203.145.95.---)
Date: January 25, 2020 09:22PM

Dear Otomatic (Moderator),

The above two Questions was not answered as below -

Refer the above post on January 23, 2020 03:50AM,

Could you also advise whether our above problem is due to PHP scripts' bug or SQL queries' bug or other WAMP settings or still Virtual Host settings, or else ?

To solve our above problem,

Do you mean to follow your advice on January 21, 2020 10:59AM, as below ?

<VirtualHost *:80> ServerName angliadesign
DocumentRoot "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application"
<Directory "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require local
</Directory> </VirtualHost>


On the other hand, will check whether your following advised info. can respect the prerequisites and solve our above problem -


LOCAL

you also need this site to work perfectly locally BEFORE you want to access it from the outside -

[forum.wampserver.com]

AND

RTFM - Apache documentation -> [httpd.apache.org]
And you can even see it in Simplified Chinese.



Tks,
KH Fong

Re: Cannot access website folder
Posted by: khofong3 (---.netvigator.com)
Date: January 29, 2020 09:04PM

Dear Otomatic (Moderator),

Could you advise the following Questions which were not answered before -

Q1) Refer the above post on January 23, 2020 03:50AM,

Could you also advise whether our above problem is due to PHP scripts' bug or SQL queries' bug or other WAMP settings or still Virtual Host settings, or else ?

Q2) To solve our above problem,

Do you mean to follow your advice on January 21, 2020 10:59AM, as below ?

<VirtualHost *:80> 
ServerName angliadesign
DocumentRoot "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application"
    <Directory "C:/wamp64/www/angliadesign/clients2/jhm/site/Web_Application/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride all
        Require local
    </Directory> 
</VirtualHost>

Q3) Also, for your advised info. as below-

Wampserver 3 - Create or add a VirtualHost

Why it is required to add a new VirtualHost instead of modifying the above existing VirtualHost with ServerName localhost ?


Tks,
KH Fong



Edited 1 time(s). Last edit at 01/29/2020 10:52PM by RiggsFolly.

Re: Cannot access website folder
Posted by: RiggsFolly (Moderator)
Date: January 29, 2020 10:55PM

Q3) Why it is required to add a new VirtualHost instead of modifying the above existing VirtualHost with ServerName localhost

BECAUSE there should be a Virtual Host for each and EVERY one of your sites.

The one that exsts is for localhost.

The one you need to create is for angliadesign


If you spent just a littel time looking at WHAT a Virtual Host was (in the Apache Documentation and any where else) you would not need to ask these questions AND IGNORE THE ANSWERS

---------------------------------------------------------------------------------------------
(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-

Re: Cannot access website folder
Posted by: khofong3 (---.static.hk.net)
Date: February 03, 2020 04:30AM

Dear Otomatic (Moderator),

After following your above instructions to add a new Vitual Host "wampjhmjkb" -

Wampserver 3 - Create or add a VirtualHost

The following codes were automatically added under the "Apache - httpd-vhosts.conf" -

<VirtualHost *:80>
ServerName wampjhmjkb
DocumentRoot "c:/wampjhmjkb"
<Directory "c:/wampjhmjkb/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

However, our above problem still cannot be solved, the following sub-folder "web_application" still cannot be accessed -

C:\wampJHMJKB\Web_Application
[wampjhmjkb]

Still with similar error as below -
"
Not Found
The requested URL /web_application/en/ was not found on this server.
Apache/2.4.39 (Win64) PHP/7.2.18 Server at wampjhmjkb Port 80
"

The sub-folder "......../en/" which was not created under the parent folder "......../web_application" was still automatically defaulted ! Could you also advise ?


Tks,
KH Fong

Sorry, you can't reply to this topic. It has been closed.