nick rpi
Posts: 10
Joined: Wed May 30, 2012 4:20 pm

Packets In > 'Magic Happens' > Packets Out

Wed Oct 03, 2012 1:30 pm

Hi all. I've been setting up my Pi as a LAMP server with Wordpress. As I'm still pretty new to Linux and computers in general, I encountered a few problems. After hours of searching around, I solved them and learnt a lot along the way. This is fine, but I still don't feel like I totally understand whats going on. I understand what each LAMP component is responsible for. But how do they interact with each other? If any talented Pi users can help write an idiot-proof description of this, I'd be very grateful.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Packets In > 'Magic Happens' > Packets Out

Wed Oct 03, 2012 1:35 pm

This is a very big question and is not specific to the Raspberry Pi.

I suggest that you search the internet for "tutorial lamp server".

You may find this useful...
http://en.wikipedia.org/wiki/LAMP_server

nick rpi
Posts: 10
Joined: Wed May 30, 2012 4:20 pm

Re: Packets In > 'Magic Happens' > Packets Out

Wed Oct 03, 2012 1:42 pm

bredman wrote:This is a very big question and is not specific to the Raspberry Pi.

I suggest that you search the internet for "tutorial lamp server".

You may find this useful...
http://en.wikipedia.org/wiki/LAMP_server
I completely understand what your saying. I've read many tutorials and I'm nearly there. Just looking for a basic signal flow description. I know its not specific to Pi but a lot of Linux based forums are rude and unhelpful to noobs like myself. Cheers

User avatar
pedley
Posts: 17
Joined: Fri Feb 10, 2012 9:19 am
Location: Yorkshire, UK

Re: Packets In > 'Magic Happens' > Packets Out

Wed Oct 03, 2012 1:47 pm

As bredman says not a specific pi issue but here is my best attempt to explain as far as I can :-

L = Linux (The operating system, a collection of software that manages computer hardware resources. Most soft communicates with the OS rather than direct with the hardware, so if a piece of software wants to get somthing from the disk it will ask the OS for it which will then fetch the information)

A = Apache (A piece of software designed for sending webpages to a web browser. This communicates with the OS to retrieve the pages from the disk/storage, if the page uses PHP(the P part) then it sends it to PHP for processing. Then it does what it needs to do with it, then sends it back to the OS for the OS to send it out through the network adapter)

M = MySQL (A piece of software - this is responsible for database storage and manipulation. This communicates with PHP, when it needs to get the information out of the database or put information in)

P = PHP (A scripting language used mainly for webpages. This language is used to get data from MySQL or send it to MySQL, get information sent from the user, process the data and then generate a webpage which it sends to apache to be sent out the the user.)

PHP <-> MySQL
|
Apache
|
Linux
|
Hardware (eg RPi)

nick rpi
Posts: 10
Joined: Wed May 30, 2012 4:20 pm

Re: Packets In > 'Magic Happens' > Packets Out

Wed Oct 03, 2012 1:57 pm

Perfect mate. Just what I needed. Like I said, I've got it all setup alright. I followed the guide in the R-Pi book by Eben but I didn't really understand the ins and outs. Nice one

User avatar
pedley
Posts: 17
Joined: Fri Feb 10, 2012 9:19 am
Location: Yorkshire, UK

Re: Packets In > 'Magic Happens' > Packets Out

Wed Oct 03, 2012 2:03 pm

OK just realised I misread the original post let me try again.

Request from the internet -> Linux

Linux sees that it is a web request and sends it to Apache

Linux -> Apache

Apache sees if request is for a static item if so sends it out. If the file is PHP then apache hands it off to PHP

Apache -> PHP

PHP process the script inside the file and sends it back to Apache for Apache to send out to the user using Linux. If the PHP needs information from the database to complete a request is sent to MySQL

PHP <-> MySQL
PHP->Apache

Then apache sends this to Linux to be sent over the network port
Apache -> Linux

I might just draw a diagram it seems easier that way.

nick rpi
Posts: 10
Joined: Wed May 30, 2012 4:20 pm

Re: Packets In > 'Magic Happens' > Packets Out

Wed Oct 03, 2012 2:37 pm

Cheers mate. You've just made sense of pages of guides and tutorials I've read. No messing about.

Return to “Beginners”