View Full Version : Test Files
falko
1st August 2005, 23:00
Included in this zip are three files for testing Perl, PHP and SSI for a virtual host (please note: the file hello_world.pl must be uploaded to the cgi-bin directory, and you have to make it executable, e.g. chmod 755 hello_world.pl).
dranieri
26th September 2005, 15:15
Thank you falko
edge
19th March 2006, 02:21
falko,
As soon as I enable 'Suexec' in ISPconfig, I get a '500 error - Internal Server Error!' when I try to access the 'hello_world.pl' perl script.
When 'Suexec' if off, there is no problem (I guess Suexec is working :p )
Anyway.. This is how the dir looks like.
drwxr-xr-x 2 web22_support web22 4096 Mar 18 02:07 backup
drwxrwxr-x 2 web22_support web22 4096 Mar 19 01:07 cgi-bin
drwxr-xr-x 3 web22_support web22 4096 Mar 11 00:30 log
drwxrwxrwx 2 web22_support web22 4096 Mar 10 23:28 phptmp
drwxr-xr-x 2 web22_support web22 4096 Mar 10 23:28 ssl
drwx------ 2 web22_support web22 4096 Mar 17 11:53 tmp
drwxr-xr-x 3 web22_support web22 4096 Mar 11 09:41 user
drwxrwxr-x 16 web22_support web22 4096 Mar 16 16:23 web
In the cgi-bin (hello_world.pl is chmod to 755)
-rwxrwxrwx 1 web22_support web22 379 Mar 19 01:07 hello_world.pl
The other two files (info.php and ssi.shtml) work fine... That is... the ssi.shtml file is only showing
Dynamic HTML with Server Side Includes
Date/Time on the server:
Name of this HTML file:
Installed server software:
Your web browser:
I have no clue why the perl script is not working in 'Suexec' mode.. (map and file is set to the correct user!)
falko
19th March 2006, 14:30
What's the full path to hello_world.pl?
Which distribution do you use?
edge
19th March 2006, 16:21
What's the full path to hello_world.pl?
Which distribution do you use?
full path to 'hello_world.pl' is: /home/www/web22/cgi-bin
The distribution I'm using is: Fedora RC4
Again.. With 'Suexec' off (in ISPconfig) the hello_world.pl runs fine.
falko
20th March 2006, 13:38
suExec's document root on FC4 is /var/www. Your script is outside this document root, therefore it doesn't work. Please switch off suExec in ISPConfig.
This is explained in more detail here: http://www.howtoforge.com/perfect_setup_fedora_core_4_p5
edge
20th March 2006, 15:28
Grrrr and guess what.. I knew that allready!! I have NO CLUE why I did not think about this!
I guess there is no easy way of changin the home directory for websites in ISPconfig. (I allready have a lot of sites setup in the /home/www/ dir)
Once againa.. Thank you falko
falko
21st March 2006, 00:36
I guess there is no easy way of changin the home directory for websites in ISPconfig. (I allready have a lot of sites setup in the /home/www/ dir)
This would involve a lot of manual work (moving sites, changing paths in a lot of files, etc.), and it's likely that you break something...
Blackknight
30th December 2006, 03:26
You should be able to symlink /var/www to /home/www.
alexillsley
30th December 2006, 13:51
:confused: It wont let me open the zip file, it says "The Compressed (zipped) Folder is invalid or coruppted." :confused:
falko
30th December 2006, 22:52
Download and try again.
alexillsley
30th December 2006, 23:52
i still get the error, i attached a screen shot of it.
till
31st December 2006, 13:12
Please try to save it on disk before you unpack it. The .zip file is downloading and unpacking fine for me.
alexillsley
31st December 2006, 17:44
It still would not let me unpack it on my windows pc, so i downloaded it on my linux pc and unpacked it there:) thanks for making this:)
falko
31st December 2006, 21:09
It still would not let me unpack it on my windows pc
Maybe a problem with your zip software on Windows...
vogelor
3rd January 2007, 22:19
all files are working except of the .pl file.
1) the path is: /var/www/web14/cgi-bin/hello_world.pl
2) suexec if on
3) rights: 777 (to test)
i got the error 404 not found.
when i disable suexec and copy the file to /var/www/web14/web then it works?
any idea????
falko
4th January 2007, 17:03
all files are working except of the .pl file.
1) the path is: /var/www/web14/cgi-bin/hello_world.pl
2) suexec if on
3) rights: 777 (to test)
i got the error 404 not found.
What's the URL you used?
mphayesuk
4th January 2007, 18:18
What I found is that you need to change the permissions to 777 and accept changes. Then change the permissions back to 655 and then it should work.
Thanks
vogelor
4th January 2007, 19:20
What's the URL you used?
www.muv.local/hello_word.pl (that means, YOU can't access the file from your pc)
isn't that ok?
vogelor
4th January 2007, 19:20
What I found is that you need to change the permissions to 777 and accept changes. Then change the permissions back to 655 and then it should work.
OK - i try (tomorrow)
mlz
4th January 2007, 19:33
www.muv.local/hello_word.pl (that means, YOU can't access the file from your pc)
isn't that ok?
Er, for the Pl, I believe it MUST be in cgi-bin so the URL should be: www.muv.local/cgi-bin/hello_world.pl in your example.
vogelor
5th January 2007, 00:55
Er, for the Pl, I believe it MUST be in cgi-bin so the URL should be: www.muv.local/cgi-bin/hello_world.pl in your example.
YES YOU'R right!
i didn't know that the /cgi-bin dir was an alias and so "linked" direct into the web. when i now point to www.muv.local/cgi-bin/hello_world.pl i am a little bit better. til now i got a 404 file not found. from now on i get a 500 internal server error. i think this is a little bit better. the next thing to do is to check the log-files. i'l do this tomorrow!
falko
5th January 2007, 17:14
from now on i get a 500 internal server error. i think this is a little bit better.
Make sure hello_world.pl is executable. Also switch off SuExec for now (until you get it working).
vogelor
5th January 2007, 20:15
What I found is that you need to change the permissions to 777 and accept changes. Then change the permissions back to 655 and then it should work.
THAT'S IT i looked into the error log and found, that suexec stops execution if the file is writeable by others than the owner!!!!
chmod to 777 is TO MUCH RIGHTS! All can write the script an suexec generates a error 500!!!
chmod 755 is exactly what suexec needs an the script runs!!!
@til
maybe we should add a cronjob which runs every 30 minutes and changes the rights, because if a user uploads a script and didn't know this he sets the wrong parameter and a 500 error is generated (and the user thinks the provider makes something wrong).
falko
6th January 2007, 16:45
maybe we should add a cronjob which runs every 30 minutes and changes the rights, because if a user uploads a script and didn't know this he sets the wrong parameter and a 500 error is generated (and the user thinks the provider makes something wrong).
I don't think it's a good idea to incapacitate users with a cron job. If we did this, we will have dozens of posts asking why ISPConfig changes the permissions of scripts without asking... :(
vogelor
6th January 2007, 16:53
I don't think it's a good idea to incapacitate users with a cron job. If we did this, we will have dozens of posts asking why ISPConfig changes the permissions of scripts without asking... :(
you are right. This is in deep a problem. but the other side is: how many users didn't know anything about rights. they upload a file and wonder why the script returns a 500 error.
maybe a hint at the 500-page itself is a good idea?
by the way: suphp has the same "problem". ISPConfig by default sets the document-root of the web to "group writeable" and your howto for suphp at this site sets the config of suphp to "create error if the dir is group writeable". This means, suphp will not work if u install suphp like your howto says. only after changing allow_directory_group_writeable=true instead of false, suphp works fine. If you don't change the line you get a 500
falko
7th January 2007, 20:04
This means, suphp will not work if u install suphp like your howto says.
But I didn't write the tutorial for use with ISPConfig. Not all tutorials on this web site are related to ISPConfig.
vogelor
7th January 2007, 20:34
But I didn't write the tutorial for use with ISPConfig. Not all tutorials on this web site are related to ISPConfig.
i know. what i exact mean was "the howto at your site".
And this was not meant as a critic, this was meant as a "good to know" or "maybe one should change the howto and add a comment for ISPConfig" ;)
falko
9th January 2007, 00:13
And this was not meant as a critic
I know. :)
Daisy
22nd January 2007, 22:40
yep. Yucky zip. File is corrupted.
falko
23rd January 2007, 19:39
As I said before it's working for me, so the file cannot be corrupted. Have you tried to download it again?
Daisy
23rd January 2007, 20:22
yeah. Using latest version of winrar.
till
23rd January 2007, 21:11
I've downloaded it and extracted it with winrar without problems.
martinfst
23rd January 2007, 21:22
Just a hunch: did you dwld it to you windowze box and then upload it to your server with FTP? If so, did you select binary transfer?
astewart
22nd May 2007, 01:01
I'm also getting the Internal Server (500) Error when running the hello_world.pl when Suexec is Enabled. No errors when Suexec is Disabled.
I've checked the Log file and it shows this output:
"Premature end of script headers: hello_world.pl"
Does anyone know what might be causing the problem or how to fix this?
Thanks!
I'm also getting the Internal Server (500) Error when running the hello_world.pl when Suexec is Enabled. No errors when Suexec is Disabled.
I've checked the Log file and it shows this output:
"Premature end of script headers: hello_world.pl"
Does anyone know what might be causing the problem or how to fix this?
Thanks!
Is the file owned by the web administrator user and group and which permissions has the file?
astewart
22nd May 2007, 19:36
File ownership:
User - web6_astewart
Group - web6
(Which is correct)
The CHMOD is 755, tried with 777 but same results.
Works fine with Suexec disabled.
Anyone else experiencing the same thing??
:(
falko
23rd May 2007, 14:04
Can you post the output of ls -la /path/to/hello_world.pl and the web6 vhost configuration from Vhosts_ispconfig.conf?
astewart
25th May 2007, 03:15
Here is the output :
-rwxr-xr-x 1 web6_astewart web6 379 2007-05-22 13:25 /var/www/web6/cgi-bin/hello_world.pl
Ahhh, Stupid Question, where do I locate that file (Vhosts_ispconfig.conf)? :confused:
falko
25th May 2007, 17:07
Depends on your distribution. Somewhere in /etc/pache2/vhosts, /etc/httpd/vhosts, /etc/httpd/conf/vhosts, ...
astewart
26th May 2007, 00:56
Here is the vhost configuration for web6 :
######################################
# Vhost: www.adamsimac.com:80
######################################
#
#
<VirtualHost 192.168.2.9:80>
SuexecUserGroup web6_astewart web6
ServerName www.adamsimac.com:80
ServerAdmin webmaster@adamsimac.com
DocumentRoot /var/www/web6/web
ServerAlias adamsimac.com webmail.adamsimac.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ScriptAlias /cgi-bin/ /var/www/web6/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web6/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
php_admin_flag safe_mode Off
Alias /error/ "/var/www/web6/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web6/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web6/user/$1/web/$3
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail\.adamsimac\.com [NC]
RewriteRule ^/(.*) http://www.adamsimac.com:81/webmail/$1 [L,R]
</VirtualHost>
falko
26th May 2007, 21:04
Looks ok. Which distribution do you use?
astewart
27th May 2007, 00:26
Looks ok. Which distribution do you use?
Ubuntu 6.10 (PPC), Perfect Setup.
falko
27th May 2007, 17:50
What's the output of /usr/lib/apache2/suexec2 -V?
astewart
28th May 2007, 05:44
What's the output of /usr/lib/apache2/suexec2 -V?
Results from /usr/lib/apache2/suexec2 -V :
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="www-data"
-D AP_LOG_EXEC="/var/log/apache2/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=100
-D AP_USERDIR_SUFFIX="public_html"
falko
29th May 2007, 14:28
That's ok as well. :confused:
jordan
15th September 2007, 02:31
Then change the permissions back to 655 and then it should work.
atrias
29th January 2009, 15:07
The other two files (info.php and ssi.shtml) work fine... That is... the ssi.shtml file is only showing
Dynamic HTML with Server Side Includes
Date/Time on the server:
Name of this HTML file:
Installed server software:
Your web browser:
i think that ssi.shtml is not working in this example!!
it should have printed the date/time , server software name , browser type , etc!!
see the source of the page displayed. the code like this:
<!--#echo var="SERVER_SOFTWARE" -->
should have been translated
unfortunately i get the same result as above in 3.0.0.8 RC1 either with or without SSI enabled for the domain.
mizanci1
20th June 2009, 22:21
falko,
As soon as I enable 'Suexec' in ISPconfig, I get a '500 error - Internal Server
http://www.guvenlikdanismanlik.com
Error!' when I try to access the 'hello_world.pl' perl script.
till
21st June 2009, 14:02
take a look at the error log of the website.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.