Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: cpcnw on September 14, 2012, 03:58:59 AM

Title: TCL as micro web server ~ n00b starts here
Post by: cpcnw on September 14, 2012, 03:58:59 AM
Hi all,

Got Core loaded on a USB stick on an old thinclient with the intention of creating a micro webserver!

I now have several daunting tasks in front of me ;

* Install lighttpd
* lighttpd config
* Install ssh service
* ssh config
* Set static ip
* Make all above persisitent

So, my questiosn are;

1) Is the above possible?
2) Has anyone else done this who could throw in some quick pointers to get me started.

Right now I am going round in circles with the wiki trying to find out how to make my ip
static and survive reboots!

Thanks for your patience!
Title: Re: TCL as micro web server ~ n00b starts here
Post by: Rich on September 14, 2012, 08:49:22 AM
Hi cpcnw
Here's a step by step to set up static IP:
http://forum.tinycorelinux.net/index.php/topic,13781.msg77070.html#msg77070
Title: Re: TCL as micro web server ~ n00b starts here
Post by: etopeter on September 14, 2012, 05:44:31 PM
Just few days ago I wrote HowTo setup webserver using nginx. Im not allowed to post external links so I have to post it like this:
blog.matchgenius.com/tinycore-nginx-server-with-php-cgi-and-vsftpd/

I have wordpress running there and another Tiny Core box is my mysql server. Hope that helps.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on September 14, 2012, 06:11:24 PM
Thanks for the tips - I realise now that what I am actually managing to get booted is not the same as what should be happening when following the wiki instruction for installing to USB stick - which actually fails.

So, using UNetbootin-windows248.exe and the core iso I can get a boot but of course the wiki instructions for persistence wont work because there is no extlinux.conf etc

When creating core usb from the CD installer I get one cursor past the syslinux output and a halt.

Guess this should be a seperate post now ...

btw DSL 3.4.12 boots flawlessly but is outdated and gui ...
Title: Re: TCL as micro web server ~ n00b starts here
Post by: etopeter on September 14, 2012, 06:59:46 PM
I guess this is different problem now.
Here's what works for me:
1. Windows format usb FAT32
2. Unetbootin install tiny core iso (download from website not from dropdown)
3. Boot USB
4. Inside console list for your disks and if needed setup linux partitions/swaps
5. Mount your drive /mnt/sda1 (depends on your setup)
6. Create boot dir /mnt/sda1/boot
7. Copy vnlinuz and core.gz from /mnt/sr0/boot (or whatever other device device you have there) to /mnt/sda1/boot
8. Get grub using tce-ab
9. Copy grub files to /mnt/sda1/grub
10. Create grub config /mnt/sda1/grub/menu.lst and make sure you have kernel /boot/vmlinuz and initrd /boot/core.gz
11. Install grub MBR (sudo grub -> root (hd0,0) -> setup (hd0) ( depends on your HD configuration)
12. Create /mnt/sda1/tce/mydata.tgz
13. Reboot

That would be it ... in short.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: bmarkus on September 15, 2012, 02:17:14 AM

So, using UNetbootin-windows248.exe and the core iso I can get a boot but of course the wiki instructions for persistence wont work because there is no extlinux.conf etc


Did you try installation with http://sourceforge.net/projects/core2usb/ ?
Title: Re: TCL as micro web server ~ n00b starts here
Post by: curaga on September 15, 2012, 03:22:22 AM
Quote
So, using UNetbootin-windows248.exe and the core iso I can get a boot but of course the wiki instructions for persistence wont work because there is no extlinux.conf etc

Please don't use third-party installers like Unetbootin and then expect persistence, etc to work automatically.

Either use the native installer from TC, or core2usb as linked above from Windows.


@etopeter:
You shouldn't have to do those three copies to use nginx - that would be a bug in the extension. The PHP bug we know about, but the PHP maintainer's busy and nobody else has expressed interest in updating PHP.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: bmarkus on September 15, 2012, 03:49:32 AM

@etopeter:
You shouldn't have to do those three copies to use nginx - that would be a bug in the extension. The PHP bug we know about, but the PHP maintainer's busy and nobody else has expressed interest in updating PHP.

I will take a look the files installed during next update; current stable is 1.2.3 Advice to rearrange files in the extension welcome.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on September 15, 2012, 08:13:09 AM
Thanks all - will get back to it later today or tomorrow :)
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on September 15, 2012, 08:45:57 AM

So, using UNetbootin-windows248.exe and the core iso I can get a boot but of course the wiki instructions for persistence wont work because there is no extlinux.conf etc


Did you try installation with http://sourceforge.net/projects/core2usb/ ?


When trying to run this I get ;

The application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem

But it doesnt :(

Title: Re: TCL as micro web server ~ n00b starts here
Post by: bmarkus on September 15, 2012, 08:58:30 AM
Never seen such error :(
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on September 16, 2012, 04:39:57 AM
@etopeter can use your method and get a working boot with grub albeit with a few kernel error messages that fly by so fast I don't get a chance to read them. But in any case, thanks ~ my usb boots and I should be happy...

But, I decided to try from Linux again and followed this tute ;

http://fragilematter.blogspot.co.uk/2010/09/installing-tiny-core-linux-on-usb-drive.html (http://fragilematter.blogspot.co.uk/2010/09/installing-tiny-core-linux-on-usb-drive.html)

Which went exactly to plan up until ;

extlinux -i /mnt/sdb1/boot/extlinux

where I get a segmentation fault [using puppy 5.2.8]

Not being one to give up I carried on and tried to boot in any case and now at start up get "Missing Operating System" message prior to dropping to pxe attempts  :(

Getting closer ....

OK, so install syslinux 4.03 and issuing the following command ;

Code: [Select]
syslinux --directory /mnt/sdb1/boot/syslinux --install /dev/sdb1
I get
Code: [Select]
/dev/sdb1: invalid media signature (not a FAT filesystem?)
and there was me thinking syslinux was designed for Linux partitions ...
Title: Re: TCL as micro web server ~ n00b starts here
Post by: Rich on September 16, 2012, 09:39:42 AM
Hi cpcnw
I think syslinux is for installing to FAT and extlinux is for installing to Linux file systems.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on September 16, 2012, 12:07:26 PM
Thanks - looks like it is a extlinux prob - finally got it to the same point manually as the installer does i.e. hanging at the syslinux prompt. Here is what ParkyTowers says about this thinclient;

http://www.parkytowers.me.uk/thin/DT166/Linux.shtml (http://www.parkytowers.me.uk/thin/DT166/Linux.shtml)
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on January 27, 2013, 06:51:29 AM
OK its 4 months down the road and I am re-visiting tc on my thin client and the good news is I got it to boot from a CF connected to the 40 pin disc header on an adapter.

So I booted my laptop to tc+ disc and then plugged in the CF but in a USB adapter. I then installed core to the CF using /dev/sdb [I think]

This went well and completed without error - I used 'showapps noswap waitusb=5 kmap=uk' and chose hdd install and ticked for kb extensions

When  completed I shutdown laptop and removed CF then installed it in the thinclient

It boots ok with one error I cant catch but I still want to do what my original post suggests.

So, starting with persistence - how the hell do I find my disk id or device name?

Have tried fdisk -l and it just falls back to the next line?

cat /etc/fstab doesnt actually show any discs and doing fdisk on /dev/hd[a,b,c] or /dev/sd[a,b,c]
doesnt work either [no device msg]

The first thing I need is persistence and I think I need to specify where my tce= lines

Any help appreciated!
Title: Re: TCL as micro web server ~ n00b starts here
Post by: Rich on January 27, 2013, 09:11:45 AM
Hi cpcnw
Quote
I used 'showapps noswap waitusb=5 .....
Did you actually see the names of your apps being listed when it booted? If not, then 5 seconds was not long
enough, try 10. I think this would also account for no disks being found.
Quote
It boots ok with one error I cant catch ....
Enter:
Code: [Select]
dmesg | lessYou can use the page and arrow keys to navigate and check for errors/warnings.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on January 27, 2013, 11:25:57 AM
Thanks Rich - but if no discs are found how is it booting? Or does the kernel not need controller support for the boot process?

Odd thing is about all this, when using my ext usb cd to load tc it doesnt see the cf 'disc' either...

Lastly for life of me cant get a pipe on my keyboard. I know us keymap is default but this is a compact and its getting it wrong ... I get chevrons where pipe should be ...
Title: Re: TCL as micro web server ~ n00b starts here
Post by: Rich on January 27, 2013, 11:57:09 AM
Hi cpcnw
If I remember correctly, basically, the boot loader finds the disk and loads the kernel into RAM. Then the kernel takes
over and scans the hardware asynchronously. If the process that checks for USB drives hasn't populated the /dev
directory when the kernel is ready for it, the kernel just moves on. The kernel is not aware of the boot loader or which
disk it is loaded from. That's the reason for waitusb=.
Quote
Odd thing is about all this, when using my ext usb cd to load tc it doesnt see the cf 'disc' either...
When you get to the screen with the F2, F3, F4  message, enter:
Code: [Select]
tc waitusb=10and see if your cf disk shows up then.
Sorry, can't help with the keyboard.
By the way, when you boot from the CD, is that listed? Enter:
Code: [Select]
ls /mntfor a list of available drives.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on January 27, 2013, 01:40:51 PM
Cheers Rich - the way I see this is that the tc kernel is not able to support the disc controller whereas puppy does. Im going to boot puppy via cd again and try and get a copy of the dmesg to look at and see whats going on there. Think someone else suggested that on one of my other threads - which is the same issue actually.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: gerald_clark on January 27, 2013, 01:43:47 PM
You should not double post.  It is a waste of everybody's time and just confuses the issue.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on January 27, 2013, 01:47:20 PM
Double post? This is an ongoing issue - revisited after a long time because there was no resolution. One thing has led to another. Im still working through that. If a new post was created every time a new issue came up that was the result of asking a question there would literally be millions of posts.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: gerald_clark on January 27, 2013, 01:56:45 PM
You are the one that said you have another thread which is the same issue, not me.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: cpcnw on January 27, 2013, 02:03:51 PM
Excuse me for not remembering everything I posted 4 months ago and not forseeing that this thread may actually end up about as far as I got last time.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: Rich on January 27, 2013, 02:07:12 PM
OK, let's not have this escalate into anything.

@gerald_clark: Point made.

@cpcnw: Point taken.

Now let's move on please.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: tinypoodle on January 27, 2013, 06:01:10 PM
Excuse me for not remembering everything I posted 4 months ago and not forseeing that this thread may actually end up about as far as I got last time.
Easy:
http://forum.tinycorelinux.net/index.php?action=profile;area=showposts;u=12567
;)
Title: Re: TCL as micro web server ~ n00b starts here
Post by: tinypoodle on February 03, 2013, 03:44:48 PM
If the process that checks for USB drives hasn't populated the /dev
directory when the kernel is ready for it, the kernel just moves on.
It was no different back when /dev used to be purely static.
Title: Re: TCL as micro web server ~ n00b starts here
Post by: Zendrael on February 09, 2013, 01:03:13 PM
Hi!

In the CF, do you have extlinux or grub? (or other...?)

After finding the device you can, you can edit the bootline in the config file of your bootload to tell Core which device has persistent data.