Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 18 Aug 2019, 17:31
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Slacko, Hiawatha server and PHP
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
WoodLark


Joined: 17 Apr 2007
Posts: 128
Location: South Carolina, USA

PostPosted: Wed 11 Sep 2013, 16:34    Post subject:  Slacko, Hiawatha server and PHP  

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” message from the PPM.

I then installed PHP version 5.4.7 from the PPM.

I also installed PHP5-CGI version 5.4.4 from the Debian repository

I created a php page (phpinfo.php) which does nothing except call phpinfo(), and placed it in the /root/EXTRAS/www directory (EXTRAS is a symlink to /mnt/sdc1) and set access on /mnt/sdc1 to 777 (just to make sure there were no permissions issues).

When I attempt to view phpinfo.php, I get “Internal Server Error 500”.

My /etc/hiawatha.conf file reads as follows:

Code:
# Hiawatha main configuration file
#


# GENERAL SETTINGS
#
ServerId = nobody
ConnectionsTotal = 250
ConnectionsPerIP = 25
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log


# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
   Port = 80
   Interface = 127.0.0.1
   MaxKeepAlive = 30
   TimeForRequest = 3,20
}
#
#Binding {
#   Port = 443
#   Interface = ::1
#   MaxKeepAlive = 30
#   TimeForRequest = 3,20
#   SSLcertFile = hiawatha.pem
#}


# BANNING SETTINGS
# Deny service to clients who misbehave.
#
#BanOnGarbage = 300
#BanOnMaxPerIP = 60
#BanOnMaxReqSize = 300
#KickOnBan = yes
#RebanDuringBan = yes


# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications.
#
#CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/php5-cgi:php
#CGIhandler = /usr/bin/python:py
#CGIhandler = /usr/bin/ruby:rb
#CGIhandler = /usr/bin/ssi-cgi:shtml
CGIextension = php, php5
#
#FastCGIserver {
#   FastCGIid = PHP5
#   ConnectTo = 127.0.0.1:2005
#   Extension = php, php5
#}


# URL TOOLKIT
# This URL toolkit rule was made for the Banshee PHP framework, which
# can be downloaded from http://www.hiawatha-webserver.org/banshee
#
#UrlToolkit {
#   ToolkitID = banshee
#   RequestURI isfile Return
#   Match ^/(css|files|images|js|slimstat)($|/) Return
#   Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
#   Match .*\?(.*) Rewrite /index.php?$1
#   Match .* Rewrite /index.php
#}


# DEFAULT WEBSITE
# It is wise to use your IP address as the hostname of the default website
# and give it a blank webpage. By doing so, automated webscanners won't find
# your possible vulnerable website.
#
Hostname = 127.0.0.1
WebsiteRoot = /root/EXTRAS/www
StartFile = index.html
AccessLogfile = /var/www/hiawatha/access.log
ErrorLogfile = /var/www/hiawatha/error.log
#ErrorHandler = 404:/error.cgi


#VIRTUAL HOSTS
#Use a VirtualHost section to declare the websites you want to host.

VirtualHost {
   Hostname = localhost
   WebsiteRoot = /root/EXTRAS/www
   StartFile = index.php
   AccessLogfile = /var/www/hiawatha/access.log
   ErrorLogfile = /var/www/hiawatha/error.log
   TimeForCGI = 5
   UseFastCGI = PHP5
   UseToolkit = banshee
}


# DIRECTORY SETTINGS
# You can specify some settings per directory.
#
#Directory {
#   Path = /home/baduser
#   ExecuteCGI = no
#   UploadSpeed = 10,2
#}


It looks right to me (it would wouldn't it?). Can anyone spot what I am missing?
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 12 Sep 2013, 08:34    Post subject:  

Hi WoodLark,

In your "VirtualHost" section, you tell hiawatha to use the FastCGI server named PHP5.
Code:
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.
Back to top
View user's profile Send private message 
WoodLark


Joined: 17 Apr 2007
Posts: 128
Location: South Carolina, USA

PostPosted: Thu 12 Sep 2013, 11:16    Post subject:  

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.
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 12 Sep 2013, 11:35    Post subject:  

Now your virtual host isn't allowed to execute CGI programs. To fix it, add this line to your "VirtualHost" section:
Code:
ExecuteCGI = yes
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 12 Sep 2013, 12:48    Post subject:  

You have this line:
Code:
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.
Back to top
View user's profile Send private message 
WoodLark


Joined: 17 Apr 2007
Posts: 128
Location: South Carolina, USA

PostPosted: Thu 12 Sep 2013, 16:04    Post subject:  

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.
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 12 Sep 2013, 17:44    Post subject:  

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:
#!/usr/local/bin/php-cgi

or, in your case, probably:
Code:
#!/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!
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 12 Sep 2013, 20:18    Post subject:  

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:
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.
Back to top
View user's profile Send private message 
WoodLark


Joined: 17 Apr 2007
Posts: 128
Location: South Carolina, USA

PostPosted: Thu 12 Sep 2013, 21:00    Post subject:  

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!
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8699
Location: qld

PostPosted: Thu 12 Sep 2013, 21:10    Post subject:  

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.. Confused

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
Back to top
View user's profile Send private message Visit poster's website 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Thu 12 Sep 2013, 21:38    Post subject:  

Hi WoodLark,

You're welcome.

Quote:
"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.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8699
Location: qld

PostPosted: Thu 12 Sep 2013, 22:46    Post subject:  

npierce wrote:
Hi WoodLark,

You're welcome.

Quote:
"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
Back to top
View user's profile Send private message Visit poster's website 
WoodLark


Joined: 17 Apr 2007
Posts: 128
Location: South Carolina, USA

PostPosted: Fri 13 Sep 2013, 07:36    Post subject:  

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).
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4208
Location: Kiel,Germany

PostPosted: Sun 01 Dec 2013, 02:20    Post subject:  

Quote:
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:
./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:
# 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 Laughing

Still have to find the differences .. Rolling Eyes
Back to top
View user's profile Send private message 
raffy

Joined: 25 May 2005
Posts: 4843
Location: Manila

PostPosted: Mon 02 Dec 2013, 09:15    Post subject: 403  

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? Get the sfs (English only).
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0787s ][ Queries: 11 (0.0175s) ][ GZIP on ]