suPHP - 500 Internal Server Error

Started by Administrator, June 13, 2014, 03:26:53 PM

Previous topic - Next topic

thiago

#15
Hi,

I Add New Account with name test;
i put files in /home/test/public_html and shows me a error:

Internal Server Error

"SoftException in Application.cpp:221: File "/home/test/public_html/index.php" is not in document root of Vhost "/usr/local/apache/htdocs"
[Thu Nov 13 11:43:32 2014] [error] [client SHAREDIP] Premature end of script headers: index.php"
"

I fix permissions, the all files are correct and still shows a error.

I access http://SHAREDIP/~test/

I need help.

Administrator

is this a new installation or the older server ?

Alnatih

Same problem here
New installation CentOS release 6.6 (Final)

I Add New Account with name admin;
i put files in /home/admin/public_html and shows me a error:

Internal Server Error

[Wed Dec 17 14:15:48 2014] [error] [client SHAREDIP] Premature end of script headers: index.php
[Wed Dec 17 14:16:24 2014] [error] [client SHAREDIP] SoftException in Application.cpp:221: File "/home/admin/public_html/index.php" is not in document root of Vhost "/usr/local/apache/htdocs"
[Wed Dec 17 14:16:24 2014] [error] [client SHAREDIP] Premature end of script headers: index.php

I fix permissions, the all files are correct and still shows a error.

I access http://SHAREDIP/~admin/

admin.com
rwxr-x---  17 admin nobody 4096 Dec 17 13:57 public_html

admin/public_html:
total 20
drwxr-x--- 17 admin nobody 4096 Dec 17 13:57 .
drwx--x--x 5 admin admin   4096 Dec 17 13:57 ..
-rw-r--r-- 1 admin admin   4670 Dec 17 13:57 index.php



I access http://SHAREDIP/~test/
test.com  (no error)
drwxr-x---  3 test nobody 4096 Dec 17 13:57 public_html

test/public_html:
total 20
drwxr-x--- 3 test nobody 4096 Dec 17 13:57 .
drwx--x--x 5 test test   4096 Dec 17 13:57 ..
drwxr-xr-x 2 test test   4096 Dec 17 13:57 img
-rw-r--r-- 1 test test   4670 Dec 17 13:57 index.html









Glenn

Do you have any .htaccess or php.ini in the folder with the web files also ?

Martin Lai

Help I am newbie using CWP and Got a Problem.

I am create a username and want to access via my ip public server http://128.199.73.171/~bjj/ -> bjj-> username
problem went i testing running the php script its show error Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

:'( :'(

and log error_log shows like this

[Mon Jan 19 22:50:57 2015] [error] [client 127.0.0.1] SoftException in Application.cpp:221: File "/home/bjj/public_html/bahasa.php" is not in document root of Vhost "/usr/local/apache/htdocs", referer: http://128.199.73.171/~bjj/
[Mon Jan 19 22:50:57 2015] [error] [client 127.0.0.1] Premature end of script headers: bahasa.php, referer: http://128.199.73.171/~bjj/


Please help how to solve it? any solution?
Noted already following instruction post 1 but no results



erm3nda

I woul recommend for all people getting this problem to try rebuild vhost from the admin cwp panel.
8==D it's a function that try to compare 8 (int) against D (string) which returns True or False depending on the asker.

sergejdds

I have exactly the same error, i tried to setup varnish, by switching the ports, and now all my php files are not loading anymore with the exact same error message described numerous times above...

qheart

Quote from: sergejdds on January 21, 2015, 08:46:14 AM
I have exactly the same error, i tried to setup varnish, by switching the ports, and now all my php files are not loading anymore with the exact same error message described numerous times above...

try using menu : user account > fix permission >  user

sorry for my bad english :(

Igor S.

Quoteis not in document root of Vhost "/usr/local/apache/htdocs"

This one too easy fix. Open /usr/local/etc/suphp.conf and change check_vhost_docroot=true to check_vhost_docroot=false
I have another error. When I try open http://sharedip/~test/ I see
Mismatch between target UID (99) and UID (502) of file "/home/test/public_html/index.php" (UID must bi different)
When I open http://test.com/~test/  it works. How to fix it?



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

Igor S.

#24
Oh, Sorry. this is easy too...
Somebody TOUCH THIS ONE /usr/local/apache/conf.d/suphp.conf and write there suPHP_UserGroup nobody nobody !!!!!!
Question is closed. Thank you.



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

erm3nda

Quote from: russianadmin on January 22, 2015, 06:20:01 PM
Quoteis not in document root of Vhost "/usr/local/apache/htdocs"

This one too easy fix. Open /usr/local/etc/suphp.conf and change check_vhost_docroot=true to check_vhost_docroot=false
I have another error. When I try open http://sharedip/~test/ I see
Mismatch between target UID (99) and UID (502) of file "/home/test/public_html/index.php" (UID must bi different)
When I open http://test.com/~test/  it works. How to fix it?

I cant believe... are u serious?
8==D it's a function that try to compare 8 (int) against D (string) which returns True or False depending on the asker.

Igor S.

Quote from: erm3nda on January 23, 2015, 07:58:08 AM
I cant believe... are u serious?

It works for me. I tested few configs and OS version.



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

erm3nda

Yes, you literally fuckup the security on your server.
This is why i ask you if you are serious.

Obviosly it works. Uninstall suPHP to make it work better...
8==D it's a function that try to compare 8 (int) against D (string) which returns True or False depending on the asker.

oguz657


oguz657

chmod test:test (all files and folders)
test 711
public_html 755
all files 644
all folders 755

Why why why dont work :(((((

[Wed Jun 17 00:12:17 2015] [error] [client 88.235.xxx.xxx] SoftException in Application.cpp:404: Mismatch between target UID (99) and UID (500) of file "/home/test/public_html/index.php"
[Wed Jun 17 00:12:17 2015] [error] [client 88.235.xxx.xxx] Premature end of script headers: index.php

other config
-----------------------------------------------------
vhost.conf Template
# vhost_start %domain_name%
<VirtualHost *:%domain_port%>
ServerName %domain_name%
ServerAlias www.%domain_name%
ServerAdmin %admin_email%
DocumentRoot "%homedir%/%username%/public_html"
ScriptAlias /cgi-bin/ "%homedir%/%username%/public_html/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/%username%/%domain_name%/*.conf

<IfModule mod_suexec.c>
        SuexecUserGroup %username% %username%
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup %username% %username%
        suPHP_ConfigPath /home/%username%
</IfModule>

<Directory "/">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end %domain_name%
--------------------------------------------------------



httpd.conf
--------------------------------------------------------
# Virtual hosts
Include conf.d/vhosts.conf

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include /usr/local/apache/conf/sharedip.conf
Include /usr/local/apache/conf.d/*.conf
ExtendedStatus On
<Directory "/usr/local/apache/htdocs">
        suPHP_UserGroup nobody nobody
        suPHP_AddHandler x-httpd-suphp
</Directory>

--------------------------------------------------------