Random Apache 403 Errors - apache

I am getting random 403 errors on my local machine. I will be viewing my local site, everything working just fine, then I will refresh the page and it will throw a 403 error. If I restart apache everything works for a period of time and then all of a sudden when loading the same page I will get the 403 error and must restart Apache.
I'm not sure where to being looking into this. I have set Required all granted on the directory and the permissions are set to drwxr-xr-x

Found the issue: https://superuser.com/questions/787888/too-many-files-open-on-mac-osx-after-running-apache-in-php-with-xdebug-for-som The accepted answer shows there is a bug with Xdebug on OSX: http://bugs.xdebug.org/view.php?id=1070
I also had in php.ini xdebug.remote_autostart = 1, I have disabled this as recommended

Related

cPanel throwing 503 error after editing a file in the www directory

I am struggling with this particular issue and cPanel's documentation really has not been any help.
This is a fresh setup of centOS7 (clean install) and cPanel for provisioning.
I am my own host - with a static IP.
I can login to cPanel on both common ports (2087 root and 2083 )
Ports 80,443,21,22 and 3306 are open
Here is my issue in a nutshell:
When I create an account in cPanel and then login as that account I can create a placeholder index.php file that simply just says "hi".
The problem is. After I edit the file once; if I try to create any other file or even edit the index.php file a second time? the domain will throw a 503 error. If I try to chmod the public_html folder in any way? cPanel throws a 503 error. If I try to extract my gitHub repo into the www folder? cPanel throws a 503 error.
The only way to fix it is to Terminate/Delete the account and then re-create it. So this is an endless loop of working/busted/working/busted.
The cPanel documentation has really been of zero help. Their support staff doesn't seem to have a clue either.
Is there a security setting I am missing? I have checked the log files. It is not giving me any info about why it is throwing an 503.
I have been going in circles for a day on this so any help is appreciated.
<?php
// Sample Placeholder Page
?>
<h1>This is a sample placeholder for cPanel</h1>
I expect that when editing a file such as index.php it should load properly.
The output is a 503 error after editing the file more than once or adding any other file.
The issue was caused by a corrupted PHP install by Easy Apache. Running a manual rebuild and switching from PHP 7.2 to 7.3 fixed the issue.

mod_jk produces incorrect redirect query string with Lucee and Apache

I am getting too many redirects after implementing a solution to THIS problem
"mod_jk to shows/append index.cfm?&_modcfmlredirected on page load"
I am trying to run Lucee CF with Apache 2.4 on a windows EC2 instance.
Install of both Apache 2.4 and Lucee went fine - both services come up fine and restart fine... Apache conf is pointed to a webroot - and test page comes up fine.
I have followed instructions on implementing mod_jk - but when I tested a simple index.cfm - I got this:
index.cfm?&_modcfmlredirected
I found multiple answers - that all recommended updating your 'mod_cfml-valve_v1.1.09.jar' to 'mod_cfml-valve_v1.1.10.jar'.
So I did...
And now I get this:
http://127.0.0.1/index.cfm?&__&__&__&__&__&__&__&__&__&__&__&__&__&__&__&__&__&__&__
This page isn’t working 127.0.0.1 redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
reverting to the 1.1.09 file brings back the ?&_modcfmlredirected as expected.
The code of index.cfm is simply
CF Index :
<cfoutput>#now()#</cfoutput>
This is not a 'code' issue....
Any help is greatly appreciated.
**** ADDITIONAL INFORMATION ****
this redirect happens when viewing file from localhost (127.0.0.1)
however, when I view the page from outside the server - I get a 403 - Forbidden error.
don't know id this helps - I hope so.

Laravel Ubuntu 16.04 returning status code 500

I just deployed a Laravel project I developed at localhost (using XAMPP) to a server.
I uploaded all files, created a new .env file (also got an app-key), ran composer install, created the db, ran artisan migrate.
Also, in
/etc/apache2/sites-enabled/000-default.conf I set the DocumentRoot to the public directory of laravel. Also I tried to edit the apache2.conf to include the directory, with Allowoverride All.
But entering the ip of my server, I get redirect to the login page (of course, I'm using the Auth of Laravel).
But I'm getting the error:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I tried to follow those steps, but it's all the same. Except the one point, that in my apache2.conf I don't wrote the DocumentRoot anymore, as I already set it in the 000-default.conf. I also tried to set it a second time in the apache2.conf, but this changed nothing.
So what couuld the problem be?
I'm using Ubuntu 16.04.
PS: Something seems to happen inside of laravel. When I go an existing route, I always get this error code 500. When I go to a route, that doesn't exist, I get an error (NotFoundHttpException), so the Routing itself kinda seems to work, but where does this error come from? It are exactly the local files I'm using with XAMPP, and locally it works fine... Any ideas?
EDIT: After editing my logs directory to have permissions like 777, I'm getting 2 errors as well.
Both point to storage/framework/views/ and storage/framework/sessions, saying "Permission denied". Do I just have to run chmod for those directories as well?
Check the error in storage/logs/laravel.log if there is no log there then make sure your directory permissions for storage allows it to be writeable 775 is what I normally use.
Okay, I got it, basically it was the permissions.
I now changed the owner of the storage folder to www-data. Now it's working (for anyone that might experience this problem, too).
if you use vps ubuntu, you have to set write/read permission with root folder (and all file, folder of it) by using this command on putty:
chown -R www-data:www-data /var/www/html
i tried this command, and my website doest not show 500 error

Forcing localhost to use https results in a 403 error

I am working on a php website. I am working on it using Aptana with XAMPP. I recently changed my htaccess file to force my site to use https on the localhost. I haven't yet implemented a ssl certificate. When I try to access a webpage now, I am directed to a page that says:
Object not found!
The requested URL was not found on this server. If you entered the URL
manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.10 (Unix) OpenSSL/1.0.1j PHP/5.6.3 mod_perl/2.0.8-dev Perl/v5.16.3
I found some solutions to this but I really want to know why this is occurring. I know that I can change the httpd.conf file to fix it but I still don't understand what is happening.

Apache - Domain not resolving : 404 errors

My Centos 5.1 VPS (WHM) had to be hard rebooted earlier and all the sites apart from one have come back online. The non working domain pings with 0% packet loss so it looks as though Apache is serving, however, I get the error:
Not Found
The requested URL / was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I checked the DNS settings and as expected, they point to the host. I checked the permissions and CHMOD values for the public_html folder and they are all correct. I restarted Apache and BIND but I still can't get the domain to work. Incidentally, adding erroneous characters to .htaccess (in an attempt to produce an error), does not make any difference. The host did a system file check which showed no errors.
What have I missed?