Slacko, Hiawatha server and PHP

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

Slacko, Hiawatha server and PHP

#1 Post by WoodLark »

I am running Slacko 5.5.

I have installed Hiawatha (9.2) after removing the default Hiawatha that came with Slacko 5.5. I installed from the .deb on the Debian website. None of the .pet packages I tried would work including Growlers LAMP/LHMP package. Any attempt to Install resulted in an “Installation Failed

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#2 Post by npierce »

Hi WoodLark,

In your "VirtualHost" section, you tell hiawatha to use the FastCGI server named PHP5.

Code: Select all

UseFastCGI = PHP5
But you have no "FastCGIserver" section to define what PHP5 is.

For details see: HIAWATHA: FASTCGI CONFIGURATION

Actually, unless you are specifically trying to learn about setting up a FastCGI server, there really is no great advantage to using one on a web server that is only accessed by localhost. You won't need the speed, so it becomes just an added complication that has tripped-up a number of Puppy users (including me) over the years.

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#3 Post by WoodLark »

Thanks npierce,

I deleted the FastCGI line from virtualhost and also the following line referring to the banshee toolkit.

I no longer get "Internal Server Error 500"
now I get:

"Forbidden 403".
I tried changing permissions to 755 thinking I might have them too open, but that made no difference.

I really don't care about FastCGI. All I want to do is view PHP pages that I am editing before I upload them to my hosted website.

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#4 Post by npierce »

Now your virtual host isn't allowed to execute CGI programs. To fix it, add this line to your "VirtualHost" section:

Code: Select all

ExecuteCGI = yes

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#5 Post by npierce »

You have this line:

Code: Select all

CGIhandler = /usr/bin/php5-cgi:php
If adding the ExecuteCGI line sends you back to "Error 500", are you sure /usr/bin/php5-cgi exists and is executable?

Perhaps you want to use something else. For instance, the PHP package that I downloaded (php-5.2.5-i486) has /usr/local/bin/php-cgi, which works without setting up FastCGI.

By the way, the error log (in your case, /var/www/hiawatha/error.log) is a good place to look for clues.

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#6 Post by WoodLark »

Thanks again,

I did find out that I needed to comment out the line "CGIextension=php.
This returned me to "Internal Server Error 500".

Originally, the error logs were reporting nothing. I found out that was due to permissions on the log file and directories.

I have been troubleshooting using the logs. What I am finding is a LOT of missing libraries required by PHP5-CGI. I've been hunting down each one and installing it, but there seems to be no end!

I tried the package you recommended, but it refuses to install on my system.

I am about to give up on Slacko entirely and go to Precise, but I will have to change hard drive controllers because Precise does not have the right drivers for my system.

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#7 Post by npierce »

WoodLark wrote:I did find out that I needed to comment out the line "CGIextension=php.
Yes, good find. Having that line would only work if your .php file was an executable program with the full pathname of the interpreter in a #! line at the top, such as:

Code: Select all

#!/usr/local/bin/php-cgi
or, in your case, probably:

Code: Select all

#!/usr/bin/php5-cgi
Since you have a "CGIhandler = /usr/bin/php5-cgi:php" line, hiawtha will find the PHP interpreter for any .php file, whether or not it begins with a #! line, but not if you also have the "CGIextension=php" line.
WoodLark wrote:What I am finding is a LOT of missing libraries required by PHP5-CGI. I've been hunting down each one and installing it, but there seems to be no end!
It does go on and on sometimes, doesn't it? And it may be my imagination but that seems especially true of Debian and Ubuntu packages. Happy hunting!

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#8 Post by npierce »

WoodLark wrote:I tried the package you recommended, but it refuses to install on my system.
That's unfortunate. What was the error?

I just tried booting into a fresh Slacko 5.5 (no save file) and was able to install php-5.2.5-i486 with no trouble. I then added one line to the end of /etc/hiawatha/hiawatha.conf:

Code: Select all

CGIhandler = /usr/local/bin/php-cgi:php
After doing so, I was able to create a .php file in the /root/Web-Server/directory, start hiawatha, enter http://127.0.0.1/phpinfo.php for the URL (localhost also works), and see the correct result.

Of course, that's using the hiawatha that came with Slacko 5.5, not the one you installed from
Debian. Still, I would think that while php-5.2.5-i486 might or might not work with your new hiawatha, it should at least install OK.

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#9 Post by WoodLark »

npierce,

The output of the PPM is just one line reading:

"Error, package php-5.2.5-i486.pet failed to install".

Something has apparently messed up the structure of my Slacko filesystem.

I loaded Precise 5.6.1 on another computer and installed Growler's LHMP .pet. The install went perfectly and PHP worked out of the box; I didn't have to configure anything.

I have ordered a new hard drive controller for this computer. When it comes , I am going to reformat the drives, install Precise and forget about Slacko. It is just too much hassle.

Enough ranting on my part. Thank you again for all your help!

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#10 Post by 01micko »

Recent Debian/Ubuntu packages are not compatible with Slacko because of the decision by those maintainers to change the library paths and probably others from (for example) /usr/lib to /usr/lib-i386. I'd say the initial problem was installing the deb, probably messed up everything.

One has to wonder why you would do that.. :?

Maybe as a safety measure installing debs/rpms should be disabled in Slacko. I might mention it to Barry.
Puppy Linux Blog - contact me for access

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#11 Post by npierce »

Hi WoodLark,

You're welcome.
"Error, package php-5.2.5-i486.pet failed to install"
Oh, that's not a wonderfully helpful error message, is it?

But I'm glad to hear that you have succeeded in getting what you need with a fresh install of Precise 5.6.1. A fresh install of Slacko would probably also work.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#12 Post by 01micko »

npierce wrote:Hi WoodLark,

You're welcome.
"Error, package php-5.2.5-i486.pet failed to install"
Oh, that's not a wonderfully helpful error message, is it?

But I'm glad to hear that you have succeeded in getting what you need with a fresh install of Precise 5.6.1. A fresh install of Slacko would probably also work.
Can only be a corruption of package.

Anyway, I decided to try this with slackware's php from ppm. There were 2 missing libs, libdb (berkley database lib) and libicui18n.

No it wasn't the easiest to setup, I have set up hiawatha before, but not with php, and I have set up apache before on slackware.

In the /etc/php-fpm.conf I had to change the user to "nobody" (and group) from "apache". I also moved the startup files (/etc/rc.d/rc.php-fpm, rc.snmpd and rc.saslauthd) to /etc/init.d where Puppy wants them. They can start from /etc/rc.d but I did it for tidiness, also had to make them executable. Slackware doesn't like to hold your hand, probably because it has to get dirty..

Added CGIhandler = /usr/bin/php-cgi:php to my hiawatha.conf and php is working after a reboot.

HTH
Puppy Linux Blog - contact me for access

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#13 Post by WoodLark »

01micko,

Here are the libraries that php5-cgi reported missing (at least as far as I got before I said 'enough!'):

libonig.so.2
libdb-5.1.so
libqdbm.so.14
libpcre.so.3
libgssapi_krb5.so.2

I am not leaving Slacko because it does not "hold my hand", but because there seem to be a lot more 'quality' packages out there for the Debian/Ubuntu Puppies. I have in the past used Slackware, Debian, and Arch. I like Puppy because of its simplicity (particularly the frugal install option).

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#14 Post by Karl Godt »

I no longer get "Internal Server Error 500"
now I get:

"Forbidden 403".
Had same Error Message 403 today .

So I downloaded the source which is pretty small :
http://www.hiawatha-webserver.org/files/hiawatha-6/ v6.19
which has a ./configure and does not need cmake vLatest .

I prefixed it --prefix=/usr/web instead of /usr to make sure it stays independent.

Code: Select all

./configure --prefix=/usr/web
make 2>>make_errs.log;echo $?
make install
Not a single line in make_errs.log !

Then I ran it like so :

Code: Select all

# hiawatha -v
Hiawatha v6.17.1, cache, IPv6, SSL, URL toolkit, XSLT
# PATH=/usr/web/bin:/usr/web/sbin:$PATH
# hiawatha -v
Hiawatha v6.19, cache, IPv6, SSL, URL toolkit
# hiawatha -d
Press Ctrl-C to shutdown the Hiawatha webserver.
And voila , no more Access Denied :lol:

Still have to find the differences .. :roll:

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

403

#15 Post by raffy »

Isn't error 403 about the mismatch of www (served files) and server ownership? For example, I am now running Upup Precise and its /root/Web-server files have user webuser and group webgroup.
Puppy user since Oct 2004. Want FreeOffice? [url=http://puppylinux.info/topic/freeoffice-2012-sfs]Get the sfs (English only)[/url].

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#16 Post by npierce »

raffy wrote:Isn't error 403 about the mismatch of www (served files) and server ownership?
Yes, one reason for this would be that the requested file is only readable by the owner and/or the group, and the owner and/or group is not the same as defined by the ServerId parameter in the hiawatha.conf file.

But there are a number of other things that can also cause the "403 - Forbidden" error.

For instance, if I define a CGI handler for a certain file type (e.g., php), but hiawatha's ExecuteCGI parameter is not set to "yes", CGI programs are not permitted to be run, and an attempt to access a file of that type will give a 403 error. That is why WoodLark got the 403 error after deleting the UseFastCGI line from hiawatha.conf. (Since UseFastCGI implicitly sets ExecuteCGI to "yes", removing it unsets ExecuteCGI unless it is specifically set elsewhere in hiawatha.conf.)

Not knowing the contents of Karl's hiawatha.conf file, I've no idea why he got the 403 error.

User avatar
oktopod
Posts: 17
Joined: Mon 01 Dec 2014, 20:59
Location: Belgrade, Serbia

#17 Post by oktopod »

When I installed LHMP, it was looking for /etc/hiawatha.conf, not /etc/hiawatha/hiawatha.conf, why is that, it gave me a headache?
So you should copy hiawatha.conf in /etc but who knows what else is corrupted.
In LHMP, PHP files are nowhere to be found, not in /usr/bin/php nor anywhere on disk drive. When I install PHP only from link under this text, I can see that it is installed in puppy package manager, but there are again no PHP files on disk.

problematic LHMP is LHMP-8.0-5.3.4-5.3.10
problematic PHP only: http://www.murga-linux.com/puppy/viewto ... 466171167e

I solved this by installing linux again, started from begining.

Hiawatha was there, operational, reading /etc/hiawatha/hiawatha.conf.

Then I installed PHP from menu / setup / puppy package manager (it also needs libmcrypt, net-snmp, t1lib packages).

Into hiawatha.conf I only added
CGIhandler = /usr/bin/php-cgi:php
StartFile = index.php
and Interface = ip_address under Binding {}

Simple as it should be.

Post Reply