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

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.

Related

This could be caused by IIS not being setup to handle extensionless static files

The ACME server was probably unable to reach http://mydomain/.well-known/acme-challenge/LLtRq6EdfBLmxyhzlFEqL
kDXBUFLsQbaea6A5kiJxIo
Check in a browser to see if the answer file is being served correctly.
This could be caused by IIS not being setup to handle extensionless static
files. Here's how to fix that:
1. In IIS manager goto Site/Server->Handler Mappings->View Ordered List
2. Move the StaticFile mapping above the ExtensionlessUrlHandler mappings.
(like this http://i.stack.imgur.com/nkvrL.png)
3. If you need to make changes to your web.config file, update the one
at C:\applications\letsencrypt\web_config.xml
Getting this error
While creatng ssl certifcate using letsencrypt
tried
1) If you can't browse to this configcheck file in your web browser (http://{your site}/.well-known/acme-challenge/configcheck then the Lets Encrypt service can't access the files it needs either.
=> configcheck is not getting created
You can edit the web.config file in this folder to get extensionless files working, then you can re-request your certificate. A mimeMap entry for either "." or ".*" usually works depending on your operating system version.
=> Edited web.config tried both "." or ".*"
No success
Can anyone please suggest steps to follow
i am using aws sever windows 2008 R2
If you have redirected your domain name from http to https
in virtual host of apache http.conf file
This will cause this issue
please comment that redirect and try it
Got solved

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

Random Apache 403 Errors

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

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?

php.ini does not exist in my apache/bin folder, but I'm getting an error?

I've been trying to figure out how to resolve this error with all the new pages I create:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
2011/11/28 13:36:56
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
Well, it all started when I increased the security on MySQL by setting some more passwords, I think. I figured I'd get a better error report if I turned error reporting on in php.ini, but it's not in my /apache/bin folder.
Alright, so I have no idea what to do. I've also got this line in xampp: MySQL database DEACTIVATED.
Any idea what might be happening? Also, please let me know if this should go to superuser.
If you're on Linux, try a "find", like this:
find / -name php.ini print
Another approach is to create a "phpinfo.php" in your Apache DocumentRoot folder, and let PHP tell you where you should put your php.ini:
<?php
// Create this file in your Apache root,
// then browse to http://localhost/phpinfo.php
// Look for "Configuration File (php.ini) Path" in the resulting output
phpinfo ();
?>
Use the find feature in Linux, as specified by paulsm4 to find php.ini.
Use ctrl+f in Windows and search for files and folders -> php.ini to find it in Windows. I recommend you do this from your web server's root directory rather than from some other location; otherwise, it may fail.
If you're experiencing a 500 error, you should check your Apache log files. They can be found in the /apache/logs folder in the file error.log, I believe. I emptied the file and then caused the error to isolate it. The information lead me to the answer.
In my case, the reason I was getting a 500 error was because my .htaccess file was referencing a .htpasswrd file that did not exist. I changed the line of code in the .htaccess file that was targeting the .htpasswrd file to target an existing .htpasswrd file that I wanted to use. I could have just as soon copied a properly formatted .htpasswrd file or made one from scratch, though.
I've read at multiple sources that 500 errors have many causes. So, none of these steps are guaranteed to work for you. If they do not, I wish you luck, and I hope that you will post a reply telling me how you fixed your 500 error, too--or, a link to a resolved question about a 500 error.