Avatar of Bruce Gust
Bruce Gust
Flag for United States of America asked on

Why am I getting a 403 error?

I moved the Laravel site I was working on from one box to another. I can access the site just fine if I do http://localhost/new_nomas/public/index.php. However, if I try to configure my httpd-vhosts.config file to accommodate a "new_nomas.site" url, as I did on the other computer, I'm getting a "403 Forbidden" error.

I'm running Apache 2.4.41. Here's my httpd-vhosts.config file:

<VirtualHost *:80>
	ServerName nomas.site
	DocumentRoot c:/wamp/www/new_nomas/public
	<Directory "c:/wamp/www/new_nomas/public">
	AllowOverride All
    Require all granted
	</Directory>
</VirtualHost>

Open in new window


...and here's my "hosts" file from the Windows/System32/drivers/etc directory:


127.0.0.1 nomas.site

Everything is pretty much identical to what I had before, but when I attempt "nomas.site" in my URL, I get a "403 Forbidden" message.

I've adjusted the security permissions in all of the files...

What am I missing?
LaravelSecurityPHP

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon
Chris Stanyon

It could be down to your .htaccess file  - specifically the rewrite section. Have your tried to call your index.php page file directly:

http://nomas.site/index.php
Bruce Gust

ASKER
Hey, Chris!

When I try http://nomas.site/index.php, I get the same error.
arnold

Double check your httpd.conf file's include directive whether the vhost file has to gave vhost-file.conf versus vhost-file.config

I think the vhost that includes your definition is not being included.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
arnold

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Bruce Gust

ASKER
Alright, guys...

First of all, Laravel seemingly keeps it error logs in storage/logs and the last error was 12/15/2019, so there's either no error being generated or something's wrong with the permissions. If there's a problem with the permissions, I can't tell.

I've changed the .htaccess file to no avail.

Whatever it is, it's one obstinate anomaly. I can't make this thing budge.

Any other suggestions?

BTW: I tried initiating a brand new laravel project just to rule out any kind of weirdness with the copying and pasting of an already existing project. Same problem. I can't initiate a virtual server for anything.
Bruce Gust

ASKER
I'm an idiot!

I found the apache_error.log file and it said that the directory that I was referencing didn't exist.

Well...

On my new box the root directory is wamp64 and not wamp.

Mystery solved!

Thanks!

Sorry it wasn't a more "technical" problem!
David Favor

You're welcome!

Glad you got this solved!

Logs are your friends...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.