0

I'm trying to put a website online from my webserver. To do that, I've created a virtualHost with Wamp, which is correctly reached when I'm on the local app.

But, when i try to access the website from another computer (from another domain), I've got a 503 error :

You dont have permission to access this resource. Apache/2.4.46 Php/7.4.9 Server at XXX.XXX.XX.XX (mypublicip) Port 80

Here is my httpd-vhosts.conf :

<VirtualHost *:80>
ServerName espaceclient
ServerAlias espaceclient
DocumentRoot "C:/wamp64/www/espace_client/public"
<Directory  "C:/wamp64/www/espace_client/public">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
</Directory>
</VirtualHost>

Here is my .htaccess, located in my public folder :

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]

</IfModule>

I've already tried to put a copy of the .htaccess in the root of my project and a lot of configurations, but i don't find...

The port 80 is opened and I've deactived the firewall and the antivirus to test.

If someone has an idea... :p

4dr138
  • 9
  • 2
  • Add a `/` to the end of `` so its like ` – RiggsFolly Oct 14 '21 at 12:50
  • Same issue... I've restarted wamp, clear cache, but it does not changes anything... – 4dr138 Oct 14 '21 at 12:56
  • To reach the WAMPServer PC you have to tell the other PC how to find `espaceclient` otherwise it has no way to find the correct IP from the domain name See https://stackoverflow.com/a/42661433/2310830 – RiggsFolly Oct 14 '21 at 12:56
  • 2
    No, that Vhost definition tell apache to look for a domain name of `espaceclient` and if found server this site. Without the domain name the Vhost wont work – RiggsFolly Oct 14 '21 at 13:07
  • So, I have to modify the servername by "espaceclient.domainname.com", with putting a domain name, linked to a host with a DNS created for this servername ? Sorry, I'm a beginner, I had the habit to push a website with a host, and juste target a folder and then it was ok, but I can't this time... – 4dr138 Oct 14 '21 at 14:24
  • Well like that lnk says, if you have only a few clients, you could add a HOSTS file to all those clients that point `127.168,0.200 espaceclient` or whatever the IP address of the WAMPServer PC is. But if your company has its own DNS Server you could add it to there and everyone woudl be able to use it. – RiggsFolly Oct 14 '21 at 14:28
  • Ok, in my case, I need to open it to everyone, and I could add the IP address to the DNS server. But my https vhosts is correct, so ? – 4dr138 Oct 14 '21 at 14:31
  • Was that a question? If so, this is not a HTTPS Vhost, you have to set another one up for that – RiggsFolly Oct 14 '21 at 14:32
  • See https://stackoverflow.com/questions/26236351/installation-ssl-in-wamp-server-error-in-httpd-ssl-conf/26252312#26252312 – RiggsFolly Oct 14 '21 at 14:33

1 Answers1

0

I followed your advice and configure a new VHost like that :

ServerName espaceclienttest.abiolab.fr
ServerAlias www.espaceclienttest.abiolab.fr
DocumentRoot "C:/wamp64/www/espace_client/public"
<Directory  "C:/wamp64/www/espace_client/public/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
</Directory>

I've also configured the ssl like the second link you put.

In local, when I access to " espaceclienttest.abiolab.fr", it's ok it works, but from the outside, I already have the 403 forbidden error (you can try this link, you will see what I mean : http://espaceclient.abiolab.fr

In my Apache Log, I find this :

[Fri Oct 15 10:28:07.841191 2021] [authz_core:error] [pid 3004:tid 1300] [client 92.184.112.230:50363] AH01630: client denied by server configuration: C:/wamp64/www/favicon.ico, referer: http://XXXX.XXX.XX.XX/espaceclient

I've got the same message while trying with other url adress, like :

[Fri Oct 15 10:23:07.606404 2021] [authz_core:error] [pid 3004:tid 1300] [client 92.184.112.230:60946] AH01630: client denied by server configuration: C:/wamp64/www/favicon.ico, referer: http://XXXX.XXX.XX.XX/espaceclienttest.abiolab.fr

It looks like it can't access to the folder C:\wamp64\www\espaceclient ! And indeed, this folder does not exists ! I've just C:\wamp64\www\espace_client with a '_' !

But why is it renaming it like this ? My .htaccess does not change this...

EDIT : I finally found the problem ! It seems like my public IP was shared with another server in my domain... So, the site was reachable from all PCs not in my domain but for the others, I had a redirection to an other server who does not work anymore... Thanks for help !!

4dr138
  • 9
  • 2