Koozali.org: home of the SME Server

website

eManX01

website
« 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

Black

website
« Reply #1 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..

eManX01

website
« Reply #2 on: December 10, 2004, 02:04:53 PM »
Thanx i'm starting to get the hang of it.

Offline alext

  • ****
  • 91
  • +0/-0
website
« Reply #3 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.
...

Offline MSmith

  • *
  • 675
  • +0/-0
PHP I know about
« Reply #4 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.
...

Offline alext

  • ****
  • 91
  • +0/-0
Re: PHP I know about
« Reply #5 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.
...

Olsen

website
« Reply #6 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

Offline dmac

  • ****
  • 143
  • +0/-0
    • http://www.rylar.ca
website
« Reply #7 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
"In a world without Fences, why do we need Gates and Windows"

Offline alext

  • ****
  • 91
  • +0/-0
website
« Reply #8 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.
...

Offline dmac

  • ****
  • 143
  • +0/-0
    • http://www.rylar.ca
website
« Reply #9 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
"In a world without Fences, why do we need Gates and Windows"

Offline alext

  • ****
  • 91
  • +0/-0
Some progress...
« Reply #10 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
...

cydonia

Re: Some progress...
« Reply #11 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

Offline dmac

  • ****
  • 143
  • +0/-0
    • http://www.rylar.ca
website
« Reply #12 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
"In a world without Fences, why do we need Gates and Windows"

Offline alext

  • ****
  • 91
  • +0/-0
cgi bug?
« Reply #13 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
...

Offline teranic

  • **
  • 21
  • +0/-0
website
« Reply #14 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
.........