Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: eManX01 on December 10, 2004, 05:08:25 AM

Title: website
Post by: eManX01 on December 10, 2004, 05:08:25 AM
I'd really like to set up a website on my SME server. How do I upload my php, html files, pictures, etc. to the SME server. I'd also like to know how to set up email accaounts as well as setting SME server up to allow other people to use the server and for them to have their own site using their own domain name.
Thanks
Title: website
Post by: Black on December 10, 2004, 06:28:15 AM
wow that's alot to swallow on a first post :) Have you tried reading the manual for some of that? It's pretty easy.

Take it one step at a time and ask questions as you go along if you cant find the answer in the manual or if it's not clear enough..
Title: website
Post by: eManX01 on December 10, 2004, 02:04:53 PM
Thanx i'm starting to get the hang of it.
Title: website
Post by: alext on December 12, 2004, 02:38:41 PM
Quote from: "eManX01"
Thanx i'm starting to get the hang of it.


If you ever get to learn how to get the SME server to run PHP, PERL and CGI scripts from the cgi-bin directory, (even when the flag in the I-Bay config has been set to allow programme execution), then PLEASE share the secret with us.

I am desperate to get it going.

Cheers,
Alex.
Title: PHP I know about
Post by: MSmith on December 12, 2004, 05:35:34 PM
That runs from the HTML folder in an enabled ibay.  Works a treat, especially if you delete index.html so index.php is automagically referenced when you access the ibay.
Title: Re: PHP I know about
Post by: alext on December 12, 2004, 09:48:11 PM
Quote from: "MSmith"
That runs from the HTML folder in an enabled ibay.  Works a treat, especially if you delete index.html so index.php is automagically referenced when you access the ibay.


I placed a know working CGI script in the HTML folder in an enabled ibay and id doesn't work; Internal server error 500.
Title: website
Post by: Olsen on December 14, 2004, 04:58:46 PM
You must enable execution of cgi and php scripts on that ibay.  You can do this on the server-manager > ibays > modify
Title: website
Post by: dmac on December 14, 2004, 08:18:03 PM
Have you change the attributes on the file you wish to run?

Login to a terminal as root or use some remote access software (putty works great).  Go the the folder where your script is located.  run the CHMOD a+x <file.cgi> and then try and run the script.

I have had this problem on a few Linux Distro's where the file attributes are not set correctly to allow the script to be run.

THT,

Darin
Title: website
Post by: alext on December 16, 2004, 07:42:29 AM
Quote from: "dmac"
Have you change the attributes on the file you wish to run?

Login to a terminal as root or use some remote access software (putty works great).  Go the the folder where your script is located.  run the CHMOD a+x <file.cgi> and then try and run the script.

I have had this problem on a few Linux Distro's where the file attributes are not set correctly to allow the script to be run.

THT,

Darin


Yes, I have set up the files for execution (chmod a+x), I have also checked that the cgi-bin directory has the correct attributes.

I have also made sure that the ibay has CGI/PHP enabled using the SME server manager (ibay) setup screen.

Still the same "Internal Server error 500"

Alex.
Title: website
Post by: dmac on December 16, 2004, 03:18:58 PM
The error you are getting implies an issue with the ability to access or run the script properly.
http://www.thesitewizard.com/archive/servererror.shtml

Have you tried a simple script and have that run (ie < ?php phpinfo(); ?>)

Also, have you looked at your log files, especially the httpd error log.  This may point you to the file or files that are causing the error.

Are you running the scripts in the cgi/bin folder or are they located in the HTML folder?  AS MSmith has pointed out, the scripts should be in the HTML Folder, other wise in your starting HTML page you will need to reference the folder for the scripts.

Darin
Title: Some progress...
Post by: alext on December 21, 2004, 01:03:38 PM
Thanks for the help Darin, (and the intro to PHP).
I created a simple PHP script using
<HTML><HEAD>
<TITLE>PHP Test</TITLE>
</HEAD><BODY>
<?php phpinfo(); ?>
</BODY></HTML>

and placed it in my IBAY/TEST/HTML directory.

Executing via IE6 from a W98 workstation ran fine (lots of good info displayed).

As my basic problem is trying to execute CGI scripts I took your suggestion and copied the PHP script to the IBAYS/TEST/CGI-BIN directory and attempted to run using the address http://192.168.100.200/cgi-bin/test.php and this failed with the Internal Server Error 500 again.
The same happens if I attempt to call the script from an HTML script using <a href=/cgi-bin/test.php>test PHP</a>

My HTTPD/ERROR_LOG error log entry for attempt was:

[Tue Dec 21 11:42:16 2004] [error] (8)Exec format error: exec of /home/e-smith/files/ibays/test/cgi-bin/test.php failed
[Tue Dec 21 11:42:16 2004] [error] [client 192.168.100.150] Premature end of script headers: /home/e-smith/files/ibays/test/cgi-bin/test.php

I get the same errors if I try to use a simple CGI script. All CGI files have rights set to 0775.

Any ideas? How can I find out where my cgi-bin directory is REALLY mapped to?

Thanks,
Alex
Title: Re: Some progress...
Post by: cydonia on December 21, 2004, 01:39:06 PM
Quote from: "alext"


My HTTPD/ERROR_LOG error log entry for attempt was:

[Tue Dec 21 11:42:16 2004] [error] (8)Exec format error: exec of /home/e-smith/files/ibays/test/cgi-bin/test.php failed
[Tue Dec 21 11:42:16 2004] [error] [client 192.168.100.150] Premature end of script headers: /home/e-smith/files/ibays/test/cgi-bin/test.php

I get the same errors if I try to use a simple CGI script. All CGI files have rights set to 0775.



I have exactly the same problem, same error log message and all.  Its really annoying since it has worked in the past, now i installed on a new server and i can't remember how i fixed the problem.


Tristan
Title: website
Post by: dmac on December 21, 2004, 08:24:39 PM
Great, the fact the simple script works eliminates an issue with the PHP interpreter.  Have you copied your script files into the HTML directory, and run the scripts from there.  I don't place my PHP scripts in the CGI-BIN directory, i usually create a new directory under the HTML directory and place the scripts in there, or in the root HTML directory.

Have you checked your php.ini file in /etc/ to see where it is looking for content.  

I am at work at the moment, but will check my php.ini file when i get home.  Also, have a look at the http://www.php.net/manual/en/ini.php site.  It covers the php.ini file.

Darin
Title: cgi bug?
Post by: alext on December 25, 2004, 03:36:26 PM
Quote from: "dmac"
Great, the fact the simple script works eliminates an issue with the PHP interpreter.  Have you copied your script files into the HTML directory, and run the scripts from there.  I don't place my PHP scripts in the CGI-BIN directory, i usually create a new directory under the HTML directory and place the scripts in there, or in the root HTML directory.

Have you checked your php.ini file in /etc/ to see where it is looking for content.  

I am at work at the moment, but will check my php.ini file when i get home.  Also, have a look at the http://www.php.net/manual/en/ini.php site.  It covers the php.ini file.

 
Darin



I have checked my php.ini file and the user_dir=null, doc_root=null, include_dir=./usr/share/php

My php scritpts and html scripts work fine in the html directory of my test ibay but not in the cgi-bin directory. As I am trying to run .cgi scripts I need to put them (executable rights set) in a directory which permits server execution. As far as I know this is the cgi-bin directory; as long as script execution is enabled which is an option in anything other than the PRIMARY ibay, (I assume that it is enabled by default in the PRIMARY ibay).

It seems to me that NOTHING can be executed in the cgi-bin directory; even a simple HTML script. What is the point of having a cgi-bin directory on SME servers?

Is this, perhaps, a bug or have I missed some configuration item?

Cheers,
Alex
Title: website
Post by: teranic on December 25, 2004, 07:44:12 PM
Try putting this at the top of your cgi script:

print "Content-type: text/html\n\n";

http://httpd.apache.org/docs/howto/cgi.html

and

http://www.httprevealer.com/usage_perl.htm
Title: website
Post by: GoVeGeTa on January 04, 2005, 04:26:24 AM
i had a similar problem once.

All's i did was create an i-bay (couldnt get cgi scripts to execute from the primary i-bay), and allow php,cgi,perl script execution.

Then all i did was the obvious, placed my perl and cgi scripts in the cgi folder (under the newly created i-bay), and tested them by going to the following address, http://example-domain.com/i-bay-name/cgi-bin/name-of-script.cgi (or perl)
It is important to check the permissions required for your specific script and change them accordingly.

I usually just transfer all files to sme-server via my local network, as i have set my server to be the domain controller for my network in the server-manager panel!

Try that out!
I know it seems to be the most obvious thing to do but it worked for me!