A Small Web Server [closed] - webserver

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Can someone suggest a small webserver implementation that will illustrate the concepts of what a webserver does? It should be in a language that is easily read, and understood, and should implement security and cgi, maybe javascript?

thttpd, a tiny/turbo/throttling http server.
It is written in C. If by "a language that is easily read" you meant "not C," then nevermind.

lighttpd

Github Mongrel source repository
Well documented
Fully tested
Mostly Ruby so it's quite easy to read
You can pull down the repo and play around with the code quite easily

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=webserver.r
A web server written in a few lines - easily understood.
or, this one, with CGI
http://www.rebol.org/view-script.r?script=webserv.r
What do you mean by security?
Javascript is normally just page content.

http://www.rebol.net/cookbook/recipes/0057.html
one of the former REBOL ones with explanations

The Noir web server (Clojure) is very neat, here's an example server:
(ns my-app
(:use noir.core)
(:require [noir.server :as server]))
(defpage "/welcome" []
"Welcome to Noir!")
(server/start 8080)

Related

As of 2014, what technology is a good replacement for mod_perl? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I've been using mod_perl for years. I have a few modules that handle Apache requests at early states, basically custom responses based on request headers that alter the normal response from Apache, like custom response codes and things like that.
I've been told by others that these days there are better ways to run Perl applications in a fast way (e.g. with a persistent interpreter that only takes subs as request handlers, similar to mod_perl), but none of them can tell me with good authority or experience what is proven to work as fast (or even better, if better) as mod_perl.
I'd like to get a more experienced opinion on that subject and I thought StackOverflow can be a perfect place to get answers from such people.
So, as of 2014, which alternatives to mod_perl are proven to be good or even better (in terms of performance and reliability) and why? Which pros or cons do you get with them compared to mod_perl?
The Plack module, which implements the Perl Web Server Gateway Interface (PSGI)
is popular for good reason.
It presents a standard API that allows a Perl web application to run on old CGI, FastCGI, mod_perl, and others, or it can behave as a stand-alone web server on its own.
I can't offer any benchmark figures, but I will update this answer if I find anything relevant.

Suggestions needed on tools and technologies to use for building a Facebook-like website [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
With so many tools and technologies lying around, I am looking for suggestions around the best ones (UI/server-side frameworks/database/CMS) to use for building a web(site/app) similar to Facebook itself.
Details of the website cannot be revealed due to privacy concerns. But largely, the experience and interactions would be similar to what Facebook has (such as continuous feeds, groups, upload data/files, comments, etc.), just that it would be in a different domain.
Information (or links) on what technologies/frameworks are such sites/portals using will also be of great help!
Elgg is a great start. they have numerous plugins (some that even make it look very similar to facebook). I've seen some prototypes that where built in a few days that have tons of functionality
The simple answer is PHP. But people likely imagine a LAMP stack.
Facebook has reengineered the front side and back side of PHP, as I understand it. They use the HipHop compiler to cut the cost of execution of PHP. And I don't know the details, but they have some kind of backside distributed database they use instead of PHP/LAMP traditional use of MySQL.
(See http://www.facebook.com/note.php?note_id=24413138919 for a description of one of the mechanisms they use, Cassandra).
If you don't care about scale, you can skip these two steps and save a lot of engineering.

perl networking tutorial [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
So far I've been using wget and curl to do screen scraping. Now I would like to switch to perl. What's a good tutorial that will cover basic web programming in perl (preferably without restating the basics)? I'm talking about basic things like getting and parsing pages, submitting forms, proxies, etc.
I've used WWW-Mechanize in the past to achieve the basic web crawling functionality, including form submission and the like.
There are some pretty good examples.
These should pretty much cover everything you're looking for:
http://www.perl.com/pub/2002/08/20/perlandlwp.html
http://lwp.interglacial.com/
http://www.perl.com/pub/2003/01/22/mechanize.html
http://gd.tuwien.ac.at/linux/ldp/LDP/LGNET/108/oregan2.html
Tools you will need besides Perl:
HTTP Live Headers (Firefox extension) or eqv. to reverse engineer Javascript requests to primitive GET / POST so you can mimic that with Mechanize or LWP, etc.
As already mentioned by other posters, a good headless-browser is WWW::Mechanize module.
I would suggest spending some time learning HTML::TreeBuilder & especially HTML::TreeBuilder::XPath and HTML::Query. the last two will become very handy when you will want to get actual data from HTML documents.
HTML::TableExtract is also a nice module to extract data from HTML tables when needed.
basically, using all of the above will give you the ability to crawl most sites.
Have fun crawling (-:

Well written Perl Open Source to learn from? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
is there any well written perl open source out there (not using any kinda of framework) that i could use as sample for learning and good pratice of the perl...
I've searched around and found many things for PHP, but nothing in perl that uses no framework.
Thanks in advance.
Have you tried browsing CPAN? You can find code there doing pretty much anything, and many distributions post links to their github repositories, so you can follow along in the development process.
CPAN Ratings has reviews and rankings of a large number of releases, which helps you differentiate between good releases and bad ones, but being able to make this determination for yourself would be best, which you get through learning and experience.

Webmessenger, IM, Chat Clients - Jabber based? (like Facebook) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
does anyone know a AJAX based chat client that connects to a Jabber server, and does the same things as Facebook or Netlog chatbar, plus Multi User Chat (MUC).
I love the UI of cometchat.com/demo (left side of the chatbar is for MUC, right side Web-IM for my friends)
The only client I found until now is http://www.ijab.im/ - which is very new and doesn't speak MUC yet.
If anybody knows other libraries - thanks for sharing!
I recommend using strophejs and the book Professional XMPP with jquery and Javascript by Jack Moffitt.
strophejs is pretty much low level but very powerful, and the book code samples take you everywhere you want to go.
And, complementing Christopher's comment, speeqe.com is written in part by Moffitt and using strophejs !
You could take a look at speeqe.com — "a web based, group chat client that works with the XMPP/MUC protocol."
It's open source too..