Using D drive to keep website outside htdocs

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Using D drive to keep website outside htdocs

Postby fuzmic » 09. May 2020 11:28

Hi members

As we know, if we place in httpd-vhosts.conf the following virtual host, it will pick up the website in c:\xampp\htdocs\cye and expose it ok.
<VirtualHost *:80>
ServerName cyeOne
DocumentRoot "c:/xampp/htdocs/cye"
</VirtualHost>

However if place the website in eg D:/www/cye and use the following conf
<VirtualHost *:80>
ServerName cyeTwo
DocumentRoot "D:/www/cye"
</VirtualHost>

When we browse for cyeTwo it will report following error
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403

Hosts file correctly set. How to fix this? :D
fuzmic
 
Posts: 19
Joined: 03. May 2020 12:17
XAMPP version: 7.2.30
Operating System: win 10

Re: Using D drive to keep website outside htdocs

Postby Altrea » 09. May 2020 13:34

Missing access rule.

XAMPP comes with a access rule for the htdocs folder already (and some others). If you don't use htdocs or a subfolders of it, you need to define your own access rule, for example inside your vhost defination.

I have already shown you one example in your other thread.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10248
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Using D drive to keep website outside htdocs

Postby fuzmic » 09. May 2020 15:07

Altrea you mean following

httpd.conf [C:\__Server\apache\conf] . though some says there are security risks with this but couldn't find a way without this

<Directory />
AllowOverride none
Require all granted
</Directory>
fuzmic
 
Posts: 19
Joined: 03. May 2020 12:17
XAMPP version: 7.2.30
Operating System: win 10

Re: Using D drive to keep website outside htdocs

Postby Altrea » 09. May 2020 15:31

No!

I mean this
Code: Select all
<VirtualHost *:80>
   ServerName local.cye
   DocumentRoot "D:/xampp7230/vhost/local.cye"
   <Directory "D:/xampp7230/vhost/local.cye">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
   </Directory>
</VirtualHost>
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10248
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Using D drive to keep website outside htdocs

Postby fuzmic » 09. May 2020 16:04

Yes sir
fuzmic
 
Posts: 19
Joined: 03. May 2020 12:17
XAMPP version: 7.2.30
Operating System: win 10

Re: Using D drive to keep website outside htdocs

Postby fuzmic » 10. May 2020 06:15

Altrea friend: Just closing messages

Of course your advice work linking to D: drive without the error response. For for my understanding which of the following 3 lines did the trick.
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted

In my earlier thread i made some mistakes in the post. I now realise that browsing localhost must end up in the dashboard to be able to use the menu option "phpAdmin"

Thanks again.
fuzmic
 
Posts: 19
Joined: 03. May 2020 12:17
XAMPP version: 7.2.30
Operating System: win 10

Re: Using D drive to keep website outside htdocs

Postby Altrea » 10. May 2020 11:38

Require all granted is the access rule.
You can read more about it here: https://httpd.apache.org/docs/2.4/mod/m ... ml#require

fuzmic wrote:Options Indexes FollowSymLinks Includes ExecCGI

Read more about it here: https://httpd.apache.org/docs/2.4/mod/core.html#options

fuzmic wrote:AllowOverride All

Read more about it here: https://httpd.apache.org/docs/2.4/mod/c ... owoverride
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10248
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Using D drive to keep website outside htdocs

Postby fuzmic » 11. May 2020 06:51

Thanks for the leading light. Closed this post, this project is done. Good!
fuzmic
 
Posts: 19
Joined: 03. May 2020 12:17
XAMPP version: 7.2.30
Operating System: win 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 78 guests