Cleyton Silva

Active Member
Aug 9, 2016
26
2
3
Suzano, Brazil
cPanel Access Level
Website Owner
Error 500 Internal Server Error

I have a very big problem, deleted the contents of my public_html folder to make some changes, and when put back the files on the server, comelou to show the error 500, use a Wordpress site.

Code:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
The public_html folder with this permission 755

I did a test erasing all wordpress and putting a index.php file with the message "Test" and the problem still remains.

html files work normally.

erro_log
Code:
SoftException in Application.cpp:357: UID of script "/home/spartanas/public_html/index.php" is smaller than min_uid
.htaccess file
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Can anyone help me in this problem?
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

What are the ownership values on the public_html directory? You can check with a command such as:

Code:
stat /home/$user/public_html
Also, is Mod_Ruid2 enabled on the system? You can verify this by running the following commands to see if it's installed and enabled with a supported PHP handler such as DSO:

Code:
rpm -qa|grep ea-apache24-mod_ruid2
/usr/local/cpanel/bin/rebuild_phpconf --current
Thank you.
 

Cleyton Silva

Active Member
Aug 9, 2016
26
2
3
Suzano, Brazil
cPanel Access Level
Website Owner
Hello,

What are the ownership values on the public_html directory? You can check with a command such as:

Code:
stat /home/$user/public_html
Also, is Mod_Ruid2 enabled on the system? You can verify this by running the following commands to see if it's installed and enabled with a supported PHP handler such as DSO:

Code:
rpm -qa|grep ea-apache24-mod_ruid2
/usr/local/cpanel/bin/rebuild_phpconf --current
Thank you.
Hi, Thanks for you response.


Code:
[email protected] [~]# stat /home/spartanas/public_html
  File: `/home/spartanas/public_html'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 800h/2048d      Inode: 53904       Links: 6
Access: (0775/drwxrwxr-x)  Uid: (  501/spartanas)   Gid: (  512/spartanas)
Access: 2014-09-02 08:37:02.000000000 -0300
Modify: 2016-10-24 16:57:04.220479542 -0200
Change: 2016-10-24 19:56:47.758270640 -0200
And

Code:
[email protected] [~]# rpm -qa|grep ea-apache24-mod_ruid2
[email protected] [~]# /usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: suphp
SUEXEC: enabled
RUID2: not installed
 

SysSachin

Well-Known Member
Aug 23, 2015
604
48
28
India
cPanel Access Level
Root Administrator
Twitter
[email protected] [~]# stat /home/spartanas/public_html
File: `/home/spartanas/public_html'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 800h/2048d Inode: 53904 Links: 6
Access: (0775/drwxrwxr-x) Uid: ( 501/spartanas) Gid: ( 512/spartanas)
Change your public_html permission and ownership with below command and check your site again.

Code:
chmod 750 /home/spartanas/public_html
chwon spartanas:nobody /home/spartanas/public_html
 
Last edited:

Cleyton Silva

Active Member
Aug 9, 2016
26
2
3
Suzano, Brazil
cPanel Access Level
Website Owner
Change your public_html permission and ownership with below command and check your site again.

Code:
chmod 750 /home/spartanas/public_html
chwon spartanas:nobody /home/spartanas/public_html
I did the following command:
Code:
chmod 750 /home/spartanas/public_html
Now the page that displays is:

Code:
Forbidden

You do not have permission to access / on this server.
Server Unable to read .htaccess file, denying access to be safe

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I tried this command also:
Code:
chwon spartanas:nobody /home/spartanas/public_html
the server gave me the following error:
Code:
-bash: chwon: command not found
 
Last edited by a moderator:

Patrick Heinz

Active Member
Mar 14, 2015
34
1
8
Brasil
cPanel Access Level
Root Administrator
Twitter
Olá Patrick, como posso verificar a permissão do arquivo? já tentei criar novos arquivos, nomes diferentes, pastas diferentes e mesmo assim o problema continua.
Olá,
Pode ser com o comando
Code:
ls -l /home/spartanas/public_html/index.php
O resultado deve ser algo como:
Code:
-rw-r--r-- 1 spartanas spartanas 213123 Sep  5 15:23 index.php
Como vc está criando estes arquivos? Via ssh? Se vc está fazendo isso como root, as permissões vão ficar erradas =/

Ou vc acessa via ssh com o usuário spartanas, ou crie estes arquivos via FTP, ou via File Manager. Assim as permissões vão ficar corretas.
Por SSH, vc vai ter que executar o comando chown spartanas:spartanas $nomedoarquivo sempre que criar um arquivo novo.

--
You can use ls command:
Code:
ls -l /home/spartanas/public_html/index.php
As server response, you should get something like:
Code:
-rw-r--r-- 1 spartanas spartanas 213123 Sep  5 15:23 index.php
How are you creating these files? If through SSH you will need to execute chown command every time you create a new file.
To prevent this 'job' you should create new files locally and send it through FTP connection, or directly via cPanel File Manager.
 

Patrick Heinz

Active Member
Mar 14, 2015
34
1
8
Brasil
cPanel Access Level
Root Administrator
Twitter
Now the page that displays is:

Forbidden

You do not have permission to access / on this server.
Server Unable to read .htaccess file, denying access to be safe
Verifique as permissões do arquivo .htaccess. Elas devem ser spartanas:spartanas e 644.

--
You should also check .htaccess file permission. It should be chowned to spartanas:spartanas and chmoded as 644.
 

Cleyton Silva

Active Member
Aug 9, 2016
26
2
3
Suzano, Brazil
cPanel Access Level
Website Owner
Olá,
Pode ser com o comando
Code:
ls -l /home/spartanas/public_html/index.php
O resultado deve ser algo como:
Code:
-rw-r--r-- 1 spartanas spartanas 213123 Sep  5 15:23 index.php
Como vc está criando estes arquivos? Via ssh? Se vc está fazendo isso como root, as permissões vão ficar erradas =/

Ou vc acessa via ssh com o usuário spartanas, ou crie estes arquivos via FTP, ou via File Manager. Assim as permissões vão ficar corretas.
Por SSH, vc vai ter que executar o comando chown spartanas:spartanas $nomedoarquivo sempre que criar um arquivo novo.

--
You can use ls command:
Code:
ls -l /home/spartanas/public_html/index.php
As server response, you should get something like:
Code:
-rw-r--r-- 1 spartanas spartanas 213123 Sep  5 15:23 index.php
How are you creating these files? If through SSH you will need to execute chown command every time you create a new file.
To prevent this 'job' you should create new files locally and send it through FTP connection, or directly via cPanel File Manager.
Puts Velho, hoje de manhã eu estava no trem pensando justamente isso. Será que o problema não esta sendo porque estou fazendo tudo via ssh pelo usuário root, tanto no Filezilla, quanto no SmarTTY. Vou apagar todos os arquivos e fazer o procedimento logado com o usuário spartanas. Assim vejo o que vai dar. Obrigado pelo toque velho, te aviso sobre o que deu quando eu fizer isso.
 

Patrick Heinz

Active Member
Mar 14, 2015
34
1
8
Brasil
cPanel Access Level
Root Administrator
Twitter
Estranho.

Acesse o site e acompanhe os logs do arquivo erro_log, com o seguinte comando
Code:
tail -f /usr/local/apache/logs/error_log
Poste o resultado.
Outra coisa, o erro ainda é "Server Unable to read .htaccess file, denying access to be safe"?

Tem como me mandar o site por PM?

--
You can check the apache's error_log using the following command:

Code:
tail -f /usr/local/apache/logs/error_log
 

Cleyton Silva

Active Member
Aug 9, 2016
26
2
3
Suzano, Brazil
cPanel Access Level
Website Owner
Estranho.

Acesse o site e acompanhe os logs do arquivo erro_log, com o seguinte comando
Code:
tail -f /usr/local/apache/logs/error_log
Poste o resultado.
Outra coisa, o erro ainda é "Server Unable to read .htaccess file, denying access to be safe"?

Tem como me mandar o site por PM?

--
You can check the apache's error_log using the following command:

Code:
tail -f /usr/local/apache/logs/error_log
Error Log
Code:
Last login: Tue Oct 25 15:10:35 2016 from 152.249.252.174
[email protected] [~]# tail -f /usr/local/apache/logs/error_log
[Tue Oct 25 15:54:03.369350 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable, referer: http://hom.example.com.br/
[Tue Oct 25 15:54:03.369448 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable, referer: http://hom.example.com.br/
[Tue Oct 25 15:54:05.234860 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable
[Tue Oct 25 15:54:05.234964 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable
[Tue Oct 25 15:54:06.528345 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable, referer: http://hom.example.com.br/
[Tue Oct 25 15:54:06.528442 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable, referer: http://hom.example.com.br/
[Tue Oct 25 15:54:07.531921 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable
[Tue Oct 25 15:54:07.532057 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable
[Tue Oct 25 15:54:10.906327 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable, referer: http://hom.example.com.br/
[Tue Oct 25 15:54:10.906425 2016] [core:crit] [pid 28440] (13)Permission denied: [client 200.162.xxx.xx:15904] AH00529: /home/spartanas/
public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/spartanas/public_html/' is exe
cutable, referer: http://hom.example.com.br/
O Erro é o mesmo ainda, você pode ver no link hom.spartanas.com.br
 
Last edited by a moderator:

Patrick Heinz

Active Member
Mar 14, 2015
34
1
8
Brasil
cPanel Access Level
Root Administrator
Twitter
Ok, parece que é tudo referente à permissões ainda.

Poste o resultado do comando:
Code:
namei -l /home/spartanas/public_html/.htaccess
Outra coisa, o domínio foi criado com o endereço hom.spartanas.com.br mesmo? Ou ele é um subdomínio criado depois. Se for um subdomínio, as permissões são nesta pasta que vc indicou quando ele foi criado. Mas de qualquer forma o erro é no início.
Resumindo, as permissões devem ser algo parecido com isso:

Code:
[email protected] ~]# namei -l /home/spartanas/public_html/.htaccess
f: /home/spartanas/public_html/.htaccess
drwxr-xr-x root   root   /
drwxr-xr-x root   root   home
drwx--x--x spartanas spartanas spartanas
drwxr-xr-x spartanas spartanas public_html
-rw-r--r-- spartanas spartanas .htaccess
drwxr-xr-x = 755
drwx--x--x = 711
-rw-r--r-- = 644
 

Cleyton Silva

Active Member
Aug 9, 2016
26
2
3
Suzano, Brazil
cPanel Access Level
Website Owner
Ok, parece que é tudo referente à permissões ainda.

Poste o resultado do comando:
Code:
namei -l /home/spartanas/public_html/.htaccess
Outra coisa, o domínio foi criado com o endereço hom.spartanas.com.br mesmo? Ou ele é um subdomínio criado depois. Se for um subdomínio, as permissões são nesta pasta que vc indicou quando ele foi criado. Mas de qualquer forma o erro é no início.
Resumindo, as permissões devem ser algo parecido com isso:

Code:
[email protected] ~]# namei -l /home/spartanas/public_html/.htaccess
f: /home/spartanas/public_html/.htaccess
drwxr-xr-x root   root   /
drwxr-xr-x root   root   home
drwx--x--x spartanas spartanas spartanas
drwxr-xr-x spartanas spartanas public_html
-rw-r--r-- spartanas spartanas .htaccess
drwxr-xr-x = 755
drwx--x--x = 711
-rw-r--r-- = 644
Code:
f: /home/spartanas/public_html/.htaccess
dr-xr-xr-x root      root      /
drwx--x--x root      root      home
drwx--x--x spartanas spartanas spartanas
drwxr-x--- spartanas spartanas public_html
-rw-r--r-- spartanas spartanas .htaccess
Não é um subdomínio não, esse é um servidor de testes e programação, um servidor de homologação.