logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Wampserver - Apache 2.4.62 - access from local network
Author
obreheret



Joined: 23 Aug 2024
Posts: 2
Location: France

PostPosted: Fri 23 Aug '24 11:22    Post subject: Wampserver - Apache 2.4.62 - access from local network Reply with quote

Hi,
I have installed Wampserver 3.3.6 on a Windows server 2022 with apache 2.4.62.
On this server, I have created a virtualhost intranetgo.
Here is the content of the httpd-vhosts.conf file

# Virtual Hosts
#
<VirtualHost _default_:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName intranetgo
DocumentRoot "d:/wamp64/www/intranetgo"
<Directory "d:/wamp64/www/intranetgo/">
Options Indexes FollowSymLinks
Require all granted
</Directory>
<IfModule fcgid_module>
Define FCGIPHPVERSION "8.3.10"
FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
<Files ~ "\.php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>
</VirtualHost>
#

On the server everything works but from a PC on the local network I get the message:
Forbidden
You don't have permission to access this resource.
Apache/2.4.62 (Win64) PHP/8.2.18 mod_fcgid/2.3.10-dev Server at 10.133.16.60 Port 80

In the file acces.log :
10.133.125.165 - - [23/Aug/2024:11:20:33 +0200] "GET /intranetgo/ HTTP/1.1" 403 308
10.133.125.165 - - [23/Aug/2024:11:20:33 +0200] "GET /favicon.ico HTTP/1.1" 403 308

and in apache_error.log :
[Fri Aug 23 11:17:49.658852 2024] [authz_core:error] [pid 2500:tid 1340] [client 10.133.125.165:57639] AH01630: client denied by server configuration: D:/wamp64/www/intranetgo/
[Fri Aug 23 11:17:49.674456 2024] [authz_core:error] [pid 2500:tid 1340] [client 10.133.125.165:57639] AH01630: client denied by server configuration: D:/wamp64/www/favicon.ico, referer: http://10.133.16.60/intranetgo/


I don't use DNS, I use http://10.133.16.60/intranetgo from my PC (local IP 10.133.125.165).
I specify that the firewall is deactivated on the server.


Could you tell me where is the problem ?

Thanks
Olivier
Back to top
obreheret



Joined: 23 Aug 2024
Posts: 2
Location: France

PostPosted: Mon 26 Aug '24 10:01    Post subject: Reply with quote

Hi,
I have found a solution.
In the httpd-vhosts.conf file I modify the default virtual host : <VirtualHost _default_:80>
Require local
by
Require all granted

And it's ok.

But I thought the following virtual host definitions took precedence ?

I have made a test.
Still in the httpd-vhosts.conf file, after the <VirtualHost _default_:80> block I added 2 <VirtualHost *:80> blocks in order to have 2 virtualhosts.
In the 1st block I put: "Require all granted" and in the 2nd "Require local".
This way I thought that the 1st virtualhost would be accessible from the network but not the second.
But the 2nd virtualhost is also accessible from the network.

Can you tell me how to configure the httpd-vhosts.conf file, so that the 1st site (intranetgo1) is accessible from the network but not the 2nd intranetgo2 which must only be accessible from the server itself?

Here is my config :
# Virtual Hosts
#
<VirtualHost _default_:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName intranetgo1
DocumentRoot "d:/wamp64/www/intranetgo1"
<Directory "d:/wamp64/www/intranetgo1/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
>/Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName intranetgo2
DocumentRoot "d:/wamp64/www/intranetgo2"
<Directory "d:/wamp64/www/intranetgo2/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#

Thanks
Back to top


Reply to topic   Topic: Wampserver - Apache 2.4.62 - access from local network View previous topic :: View next topic
Post new topic   Forum Index -> Apache