LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 01-12-2006, 05:41 PM   #1
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
linuxquestions.org backend?


For the record, this is mainly out of curiousity. I'm not trying to figure out how to hack linuxquestions or anything like that.

How does a site ilke this work? I understand basic html, and basic programming concepts, and I'm assuming that there is some kind of database that ties in with the php code. Would someone w/ more experiance than me, or perhaps jeremy, explain how this kind of site works? What exactly is AJAX, and how does it benefit this site(aside from the obvious behavior changes, replying w/out reloading the page, etc.)? Why does this site do things the way it does, code-wise?
 
Old 01-12-2006, 06:06 PM   #2
BrianW
Member
 
Registered: Jul 2003
Location: Montana
Posts: 297

Rep: Reputation: Disabled
Its mainly a php bulletin board system (called vbulletin) that runs the forums. I have little knowledge of vbulletin (compared to phpbb2) but the HCL is probably a custom coded hack added to vbulletin. The main page (linuxquestions.org) is a portal system that can display current activity on the forums. The forums basically submit information to to a SQL database. Whenever you open a thread, the php scripts connect to the database and retrieve information and the bulletin board system displays the information in a post/thread view accordingly.

EDIT: Forgot to add about AJAX. I think you'd probably learn more about than from the little I know if you search about it on the web.

Last edited by BrianW; 01-12-2006 at 06:10 PM.
 
Old 01-12-2006, 07:41 PM   #3
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
so anything posted is a database entry? How do all the parts communicate? is it packets? or do they have a "customized language" for lack of a better term? I mean, I know SQL's got it's own interface, so php must use that somehow to communicate. What ties it all together?
 
Old 01-12-2006, 08:52 PM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
PHP is a scripting language, kinda like Perl, or a shell script. All these can communicate with a MySQL database using typical MySQL commands. When you request the page, Apache looks for the page you're trying to access, then uses the proper commands to execute the code. If you were to "View Source" on this page, you would not see the PHP, but rather output from the PHP script - it just happens to output HTML which Apache then serves up as a webpage.
 
Old 01-12-2006, 10:00 PM   #5
BrianW
Member
 
Registered: Jul 2003
Location: Montana
Posts: 297

Rep: Reputation: Disabled
SQL does not actually have its own interface but another php program (ie phpMyAdmin) that allows you to view/edit the contents of the sql database from the web.
What happens when you post something is this. The php script say post.php takes the information in the text box and adds it to other information about the post, date, time, user of entry and formats it into a command.
It will then send to MySQL (or whatever database system) a command to enter the data into a table. There are several tables, ie. one that has the admin board configurations, one that has the rules for the forums (who can post, view, read, edit, moderate...), one that has the thread information and so on.

Commands for the database vary for tasks. Like when you click on a thread the vbulletin file (such as viewtopic.php) will send a command like (and others):
SELECT {this is a string of table entries, userid, user's post count, user email, avatars, post texts, post subject and everything else pertaining to the thread's information that you see} FROM {this is a string of tables that information is stored, ie. POSTS_TABLE, USERS_TABLE...} WHERE $topic_id = {the id of the topic you clicked on}

Thats a pretty rough and short example of what is done. There's alot more that goes on but my knowledge is way lacking to explain much.

EDIT:
If you really want to learn more, you might want to take a look at this link. It has quite a bit of information about php and sql and probably could explain it way better than I. http://dev.mysql.com/tech-resources/...s/ddws/20.html

Last edited by BrianW; 01-12-2006 at 10:08 PM.
 
Old 01-12-2006, 10:08 PM   #6
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
That's actually pretty good, thanks. So how about hardware requirements for all this stuff? Do people who are logged into the site actually logged into the server? Do they have an account there? Assuming the do, I would doubt their given a home directory right? Why was PHP chosed over something like perl(or ASP, but that's kind of a given. Why would one choose PHP over ASP on a windows machine?)?

Last edited by microsoft/linux; 01-12-2006 at 10:09 PM.
 
Old 01-12-2006, 10:22 PM   #7
BrianW
Member
 
Registered: Jul 2003
Location: Montana
Posts: 297

Rep: Reputation: Disabled
As for the language chosen, I think it is all up to who ever writes the code. People (like you and I on linuxquestions) don't have a regular user account on the machine thats hosts the site. If you've dabled with webhosting on your linux box, its kind of like that. Any computer can actually run a site, but the more people who view it and interact, the more resources are neccessary to keep it running smooth. I can't remember about PHP (I believe it just runs as a component in Apache) but SQL runs under a user account. We just connect to Apache and it does the rest. I believe that mysql.com link above actually details it.
I hope I'm correct, someone who knows correct me if I'm wrong please .
 
Old 01-12-2006, 10:32 PM   #8
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
I've played around a little bit, but it was just internal(I have a dynamic IP, and my parents won't let me...). Is there anything better about one language over the other? or is it just personal preference? Hmmm...I think that's all my questions for now...I'll be back though
 
Old 01-12-2006, 11:35 PM   #9
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083
The site runs on the LAMP stack and at our size we use more resources than you might think. As was indicated, you don't have any kind of system or shell account, but are simply a record in the user table. As for why PHP, it's really a matter of choice. PHP is simple, clean, built for the web and does what we want. As for AJAX (Asynchronous JavaScript And XML), http://en.wikipedia.org/wiki/AJAX is a good place to start.

--jeremy
 
Old 01-13-2006, 12:40 AM   #10
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
Hey jeremy, I know you're busy, but would it possible to do a write up on how linuxquestions.org works? I'm sure I'm not the only interested, and, unless there's some reason not to(security, etc.), I don't see an negative effects. Something to think about...
 
Old 01-13-2006, 05:49 AM   #11
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
PHP is a good choice for lots of applications because it is very powerful but it is just so easy to learn! It's beyond easy and it has a fantastic reference. If you're site is going to be based around a forum system though, PHP is the obvious choice because vBulletin is by far the best forum software around.

Honestly, the best way to understand this is to install Apache, PHP and MySQL and teach yourself the basics of the language. It'll take you a solid weekend to get the basics down and something neato written to show off to everyone
 
Old 01-13-2006, 06:27 AM   #12
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083
The LAMP stack is well documented enough that I'm not sure there is much I could really add.

--jeremy
 
Old 01-13-2006, 08:31 AM   #13
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Very simply put it works like this:

1. PHP Code sitting on the server gets executed whenever a page is requested. PHP interacts with the MySQL server using PHP commands for MySQL (with the php-mysql module).

2. PHP renders output in the form of HTML to the client (end user) using the data retrieved from the MySQL server and also stores user data submitted in HTML forms into the MySQL server.

3. All data in the site, user accounts, posts, topics, forums, categories and other dynamic info are stored in the MySQL database.

Since vBulletin powers the main forum, most of the functionality is part of the vBulletin code, but of course the extra sections on this site like HCL, reviews and so on are add-ons or hacks... All of course coded in PHP.
 
Old 01-13-2006, 08:46 AM   #14
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
ok, sounds good. Thanks for all the information you guys(or girls). I'll probably be back with more questions
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Welcome to linuxquestions.org jeremy LQ Suggestions & Feedback 22 05-06-2021 04:05 PM
LinuxQuestions.org jstephens84 LQ Suggestions & Feedback 6 11-16-2005 02:43 PM
Linuxquestions.org bullium LQ Suggestions & Feedback 6 01-03-2005 03:18 PM
New to LinuxQuestions.org blues36 LinuxQuestions.org Member Intro 1 11-17-2004 01:56 AM
LinuxQuestions.org will be in the .Org Village at LWE UK jeremy LQ Suggestions & Feedback 34 10-10-2004 09:41 AM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration