LAMP squash file

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

LAMP squash file

#1 Post by growler »

I've made up a PLAMP - Puppy Linux/Apache/Mysql/PHP squash file that you simply drop in to your /mnt/home directory - run the boot configuration to load LAMP-301.sfs on boot then you are away - apache starts on boot the first time out.

htdocs are under /var/www/htdocs and symlinked from /srv/www/htdocs

copy you website under that directory and you are away.

- you need to run mysql_install_db from a terminal window which is the post install script for mysql to initiate the mysql system and test databases.
Reboot or run /etc/init.d/rc.mysqld start and you are away with mysql. You may also wish to review /etc/my.cnf that contains the standard configuration parameters - if you want to run innodb you will need to uncomment the innodb config parameters.

mysql runs as root - and you should change the mysql root password - by default it is blank - see the mysql docs - I removed them from this sfs but the commented online docs are better in any event.

I am not expert on security and I only use this for development.

Thanks raffy the file is at

ftp://ftp.servage.net/sfs_modules/lamp-301.sfs

username: puppy
password: linux

the file is 25Meg - so not such a puppy but there are other files as big here? I took out everything I could including translations - sorry non-english speakers - I don't think there is any compromise on functionality. The no post mode error crops up if I post the file as a .zip also - so ftp it is!

I have updated this squash file to work with Dingo (puppy 400) - needed some additional libraries and also included phpMyAdmin 2.11.6 - this one runs the mysql_install_db script if the initial databases do not exist on first boot. So mysql will come straight up when you boot after setting this .sfs in your boot up configuration.

The file is 27 Meg at:

ftp://ftp.servage.net/sfs_modules/lamp-400.sfs

username: puppy
password: puppylinux
Last edited by growler on Wed 18 Jun 2008, 10:14, edited 10 times in total.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#2 Post by ttuuxxx »

Hi that sounds great only one thing ummmmmm Wheres the link?? to the sfs
thanks for your time
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
prehistoric
Posts: 1744
Joined: Tue 23 Oct 2007, 17:34

website development and security

#3 Post by prehistoric »

Hi growler,

This sounds good for development, but I'm sure there will be people who ignore that restriction. Running Apache as root out on the web sounds like an invitation to exploitation.

We already have user spot to use for didiwiki. Could someone adapt this to run as a restricted user like spot?

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

#4 Post by growler »

Apache runs as user nobody - but as the root group.

I think this is still a risk for use as a live web-server - inside a firewall as an intranet no problem.

It would be good for someone more knowledgable to give this a once over for security purposes.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

Re: LAMP squash file

#5 Post by Béèm »

growler wrote:I would upload the file only I keep getting no post method specified error!
Could be that the file is too big to upload here.
Also all types (extensions) aren't allowed to upload and sfs might be one of those. In fact I just checked and sfs isn't permitted to upload here.
You should make a zip or tar or bz2 f.e.
And then there is still the question of size.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

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

download

#6 Post by raffy »

Last edited by raffy on Fri 26 Feb 2010, 07:55, edited 1 time in total.
Puppy user since Oct 2004. Want FreeOffice? [url=http://puppylinux.info/topic/freeoffice-2012-sfs]Get the sfs (English only)[/url].

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

Web-server PHP MySQL for 4.2

#7 Post by growler »

In preparation for 4.2 I thought I would configure a squash file to work with hiawatha web-server that Barry intends to bundle with puppy 4.2 by default - having read a little bit about it, it seems that it is quite a solid and fast performer and a fraction of the size of apache, with all the features I need and its emphasis on security! It makes sense to use Hiawatha for my purposes - seems like a another good find of Barry's!

However, I want to use hiawatha with a modified

/etc/hiawatha/httpd.conf

and

/etc/hiawatha/php-fcgi.conf

building the new files into the squash file doesn't work since the files in pup_4xx.sfs are layered over the top of my squash file ones.

Has anyone any idea on how I can get the new files over the top of the old config files in pup_4xx.sfs?

Maybe we are looking at a PET here?

User avatar
pacchiee
Posts: 28
Joined: Tue 30 Sep 2008, 08:31
Location: Bengaluru, KA, IN

#8 Post by pacchiee »

Since am a new to puppy, can anyone tell me the steps to get lamp-400.sfs installed? Am using Puppy DINGO.

Thanks.

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

#9 Post by growler »

It depends on whether you are using a

"full"

or

"frugal"

installation of puppy.

Frugal

If you have a pup_save.sfs file that gets checked on each boot and saved to on shutdown then you are using a frugal installation in this case you download the squash file and put it in your

/mnt/home

directory.

Now click on Menu->System->BootManager configure bootup

Click the option that allows extra squash files to be loaded at boot time.

The squash files that you have available to be loaded up will show in the left box - select

lamp_400.sfs

and click the add button. Also make sure the check box that says

"Ignore above user selection and load all with _400 in filename"

is unchecked.

Now reboot... easy.


Full Install

If you are working with a full install to hard disk then you need to extract the .sfs into the directory tree - ie all the files are uncompressed and you are no longer using the compressed file system. There is a utilitiy for doing this see:

http://www.murga-linux.com/puppyviewtop ... 6&t=17068

Alternatively you can go into rox and click on the squash file to mount it - then copy the contents from the mount point normally something like

/mnt/+lamp_400.sfs

to the root directory /

you can do this from an Rxvt shell command line with:

Code: Select all

#cp -a --remove-destination /mnt/+lamp_400.sfs/* /
click on the squash file again to unmount it. Reboot should kick off mysql and apache. Alternatively at the command line you can type:

Code: Select all

#/etc/init.d/rc.mysqld start
#/etc/init,d/rc.httpd start

User avatar
pacchiee
Posts: 28
Joined: Tue 30 Sep 2008, 08:31
Location: Bengaluru, KA, IN

#10 Post by pacchiee »

growler, I downloaded lamp-400.sfs to my-documents and clicked on it. It was mounted on /mnt/+root+my-documents+lamp-400.sfs. What should I do next?

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

#11 Post by growler »

Are you using a full install or a frugal install?

ricstef
Posts: 52
Joined: Wed 02 Aug 2006, 02:25
Location: Woodstock, ON. Canada

Hiawatha and PHP

#12 Post by ricstef »

@growler
[snip]In preparation for 4.2 I thought I would configure a squash file to work with hiawatha web-server[/snip]

Has anyone any idea on how I can get the new files over the top of the old config files in pup_4xx.sfs?
Why not prepare your .sfs as before, minus the conf files. Plus a .pet which contains only the .conf files. One could then download your .sfs, and activate it as before. But then install the .pet before first-time use.
A reboot would be necessary to embrace the .sfs and .conf files, of course.

I find this project particularly interesting because I too wanted to utilize Hiawatha in P406. In my case I wanted to use PHP with it. Even though I installed the PHP5 .pet and made changes in the .conf files, It won't execute PHP files, html pages are fine of course.

I'm wondering if you would attach your .conf files so I can see what I missed ?

Cheers.
Richard.

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

#13 Post by growler »

/etc/hiawatha/httpd.conf

Code: Select all

#ServerId = www-data
ServerId = nobody
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log

Binding {
	Port = 80
}

MimetypeConfig = /etc/mime.types
CGIhandler = /usr/bin/perl:pl
CGIextension = pl

FastCGIserver {
	FastCGIid = PHP5
	ConnectTo = 127.0.0.1:2005
	Extension = php
	SessionTimeout = 30
}

Hostname = 127.0.0.1
WebsiteRoot = /root/httpd
StartFile = index.html, index.php
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log


VirtualHost {
	Hostname = localhost
	WebsiteRoot = /root/httpd
	StartFile = index.php
	AccessLogfile = /var/log/hiawatha/access.log
	ErrorLogfile = /var/log/hiawatha/error.log
	ExecuteCGI = yes
	FastCGI = PHP5
}
/etc/hiawatha/php-fcgi.conf

Code: Select all

# PHP FastCGI configuration

# PidFile = <path to PID-file>
#
PidFile = /var/run/php-fcgi.pid

# Forks = <number of forks per server>
#
#Forks = 3

# Setenv <key> = <value>
#

# Server = <php-cgi executable>;<binding>;<UID>[:<GIDs>][;<PHP configuration file>]
#
Server = /usr/bin/php-cgi ; 127.0.0.1:2005 ; nobody ; /etc/php.ini
/etc/init.d/rc.httpd - to start the fast cgi daemons and hiawatha on boot

Code: Select all

#!/bin/sh
#
# /etc/rc.d/rc.httpd
#
# Start/stop/restart/graceful[ly restart]/graceful[ly]-stop
# the Hiawatha (httpd) web server.
#
# To make Hiawatha start automatically at boot, make this
# file executable:  chmod 755 /etc/rc.d/rc.httpd
#
# For information on these options, "man apachectl".


case "$1" in
  'start')
    /usr/sbin/php-fcgi -c /etc/hiawatha/php-fcgi.conf
    /usr/sbin/hiawatha -c /etc/hiawatha
  ;;
  'stop')
    /usr/sbin/php-fcgi -k
    killall hiawatha
    rm -f /var/run/hiawatha.pid
  ;;
  *)
    echo "Usage: $0 {start|stop}"
  ;;
esac


I thought I would just make it a PET - its uninstallable then on a full hard-drive install

HTH

User avatar
pacchiee
Posts: 28
Joined: Tue 30 Sep 2008, 08:31
Location: Bengaluru, KA, IN

#14 Post by pacchiee »

growler, its a full installation on hdd.

Meanwhile, if I just access http://localhost, it shows phpinfo() output. How is this possible without apache running? Does puppy comes with default php installation?

ricstef
Posts: 52
Joined: Wed 02 Aug 2006, 02:25
Location: Woodstock, ON. Canada

Hiawatha and PHP

#15 Post by ricstef »

@growler
Thanks for your quick reply :) ; I'll look at it tonight.
I thought I would just make it a PET - its uninstallable then on a full hard-drive install
Sound good to me. 8)

Cheers,
Richard.

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

PHP 5.2.6 and Mysql 5.0.67 PET for 4.1

#16 Post by growler »

I compiled the latest mysql 5.0.67 and PHP 5.2.6 and packaged it up to use the hiawatha secure (and fast) web-server bundled with puppy 4.1 - also included are the necessary scripts to start the servers at boot time and the php fast cgi daemons to serve PHP pages. I also incldued phpMyAdmin 3.0

Since I compiled from source and used just the basics without PEAR and documentation etc it is quite a lot more compact than the previous squash files. Its just 8743 Kb.

Once the PET is installed point a browser at

http://localhost/index.php

to see the php configuration

and

http://localhost/phpMyAdmin/index.php

to administer MySQL

I uploaded again to ftp.servage.net
as the

user: puppy
password: puppylinux

Hope this is useful to someone

Leon
Posts: 265
Joined: Wed 22 Jun 2005, 21:33

Re: Hiawatha and PHP

#17 Post by Leon »

growler wrote:Since I compiled from source and used just the basics without PEAR and documentation etc it is quite a lot more compact than the previous squash files. Its just 8743 Kb.
That's very small.
Thank you for your efforts.
ricstef wrote:Why not prepare your .sfs as before, minus the conf files. Plus a .pet which contains only the .conf files. One could then download your .sfs, and activate it as before. But then install the .pet before first-time use.
A reboot would be necessary to embrace the .sfs and .conf files, of course.
growler,
I too would be interested in this solution. Would you be willing to make a .sfs file?

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

#18 Post by growler »

I think that solution (having a PET for the conf files and a .sfs for the rest) is a little ugly - and hiawatha would choke with the httpd.conf file which does not have the files available if the .sfs is not available - so you'd need to uninstall the PET and reinstate the old conf files. The conf file tells it about the PHP install/fastcgi and tells it to parse .php files - when PHP is not there things won't work well.

The PET is much smaller than the old squash files which included apache as well as a fat mysql and PHP. The old .sfs was using slackware binaries - this is all re-worked from the ground up for puppy 4.1 now. With the PET package management it is of course very easy to install and uninstall packages - a reboot it not required after installing - and the web-server PHP fastcgi daemons and mysql are all started by the pinstall.sh script. A reboot after uninstalling is probably a good idea.

mysql, hiawatha and PHP all run as the "nobody" user too - I managed to get around having to run mysql as the root user which was less than ideal.

Leon
Posts: 265
Joined: Wed 22 Jun 2005, 21:33

#19 Post by Leon »

Ah, OK then.
Thank you for the explanation.

Post Reply