The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error 500 Internal Server Error

Discussion in 'General Discussion' started by Cleyton Silva, Oct 24, 2016.

  1. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    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 webmaster@example.com.br 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?
     
    #1 Cleyton Silva, Oct 24, 2016
    Last edited by a moderator: Oct 25, 2016
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    824
    Likes Received:
    22
    Trophy Points:
    168
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Make sure the public_html folder is set to be owned by user:nobody and set to 750 permissions, then make sure all files inside of it are also owned by the user. The error in the Apache log indicates that you probably left the files owned by root.
     
  3. Patrick Heinz

    Patrick Heinz Active Member

    Joined:
    Mar 14, 2015
    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Brasil
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You should also check permissions of 'index.php' file. It should be $user:$user
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    Hi, Thanks for you response.


    Code:
    root@img1 [~]# 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:
    root@img1 [~]# rpm -qa|grep ea-apache24-mod_ruid2
    root@img1 [~]# /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
     
  6. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    Hello, thanks for your reply, how can I check it? @vanessa
     
    #6 Cleyton Silva, Oct 24, 2016
    Last edited: Oct 24, 2016
  7. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    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.
     
  8. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    542
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    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
    
     
    #8 SysSachin, Oct 24, 2016
    Last edited: Oct 24, 2016
  9. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    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
     
    #9 Cleyton Silva, Oct 25, 2016
    Last edited by a moderator: Oct 25, 2016
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,618
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Its not chwon, its chown.
    More Info: linux.die.net/man/1/chown
     
  11. Patrick Heinz

    Patrick Heinz Active Member

    Joined:
    Mar 14, 2015
    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Brasil
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
  12. Patrick Heinz

    Patrick Heinz Active Member

    Joined:
    Mar 14, 2015
    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Brasil
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
  13. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    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.
     
  14. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    Vou apagar o arquivo .htaccess e enviar pelo usuário spartanas direto para corrigir também as permissões.
     
  15. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    @Patrick Heinz Recoloquei todos os arquivos, usando o usuário spartanas, mas o problema continua.
     
  16. Patrick Heinz

    Patrick Heinz Active Member

    Joined:
    Mar 14, 2015
    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    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
     
  17. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    Error Log
    Code:
    Last login: Tue Oct 25 15:10:35 2016 from 152.249.252.174
    root@img1 [~]# 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
     
    #17 Cleyton Silva, Oct 25, 2016
    Last edited by a moderator: Oct 25, 2016
  18. Patrick Heinz

    Patrick Heinz Active Member

    Joined:
    Mar 14, 2015
    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    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:
    root@host ~]# 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
     
  19. Cleyton Silva

    Cleyton Silva Active Member

    Joined:
    Aug 9, 2016
    Messages:
    26
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Suzano, Brazil
    cPanel Access Level:
    Website Owner
    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.
     
  20. Patrick Heinz

    Patrick Heinz Active Member

    Joined:
    Mar 14, 2015
    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Brasil
    cPanel Access Level:
    Root Administrator
    Twitter:
    Cara,
    Por acaso o /home é uma montagem nfs, ou tipo de partição diferente do / ?
    Já aconteceu isso comigo depois de um upgrade do cPanel.

    Executa um
    Code:
    chmod 755 /home 
    Vai funcionar. Tua /home/ está com permissão 711, e não 755 ;)
     
Loading...

Share This Page