background preloader

Programmation WEB

Facebook Twitter

How to manage a PHP application's users and passwords. Alexander Peslyak Founder and CTO Openwall, Inc. better known as Solar DesignerOpenwall Project leader April 2010 Last revised: August 2010 Some rights reserved Introduction Almost all large PHP applications, as well as many small ones, have a notion of user accounts, and, whether we like it or not, they typically use passwords (or at best passphrases) to authenticate the users.

How to manage a PHP application's users and passwords

Finally, some of the more recent blog posts, forum comments, and the like have started to recommend phpass, the password/passphrase hashing framework for PHP that I wrote, and which has already been integrated into many popular "web applications" including phpBB3, WordPress, and Drupal 7. In this article/tutorial, I will guide you through the steps needed to introduce proper (in my opinion at least) user/password management into a new PHP application. We will also briefly touch many related topics. Password/passphrase hashing Decent systems/applications do not actually store users' passwords. Salting Stretching Schema. Getting Started with CGI Programming in C. This is an introduction to writing CGI programs in the C language.

Getting Started with CGI Programming in C

The reader is assumed to know the basics of C as well how to write simple forms in HTML and to be able to install CGI scripts on a Web server. The principles are illustrated with very simple examples. Two important warnings: To avoid wasting your time, please check—from applicable local doc­u­ments or by contacting local webmaster—whether you can install and run CGI scripts written in C on the server. At the same time, please check how to do that in detail—specifically, where you need to put your CGI scripts. This document was written to illustrate the idea of CGI scripting to C pro­gram­mers. Why CGI programming? As my document How to write HTML forms briefly explains, you need a server side-script in order to use HTML forms reliably.

CGI is simply an interface between HTML forms and server-side scripts. To say "Hello world" in Python CGI Web Programming in 5 minutes. By Forrest Sheng Bao I have lotta Python programs for bioinformatics research.

To say "Hello world" in Python CGI Web Programming in 5 minutes

I wanted to put them onto the web. I only developed Web apps in PHP before. And it seemed to be a big pain for porting a Python program to the web. But, I figured out in 5 minutes. First, you need an Apache server on your Linux/Mac OS/Windows box. Second, configure cgi in Apache. Perl Hello World CGI - First CGI program, learn how to create a simple CGI script in Perl. A CGI script can be as simple or complex as you need it to be.

Perl Hello World CGI - First CGI program, learn how to create a simple CGI script in Perl.

It could be in Perl, Java, Python or any programming language. At it's core, a CGI application simply takes a request via HTTP (typically a web browser) and returns HTML. Let's look at a simple Hello World CGI script and break it down into it's simplest forms. #! /usr/bin/perl print "Content-type: text/html\n\n"; print <<HTML; <html><head><title>A Simple Perl CGI</title></head><body><h1>A Simple Perl CGI</h1><p>Hello World</p></body> HTML exit; If you run the program on the command line, you'll see that it does exactly what you'd expect.

The key line is the first print statement: print "Content-type: text/html\n\n"; This tells the browser that the document coming after the two newlines is going to be HTML. Once the header is sent, it's just a matter of sending the HTML document itself. . #! This new CGI script will insert the current date into the page each time the script is called. Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Debian Wheezy. Version 1.0 Author: Falko Timme <ft [at] falkotimme [dot] com> Follow me on Twitter Last edited 05/27/2013 Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a Debian Wheezy server with PHP5 support (through PHP-FPM ) and MySQL support (LEMP = L inux + nginx (pronounced " e ngine x") + M ySQL + P HP) . I do not issue any guarantee that this will work for you!

1 Preliminary Note In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 . 2 Installing MySQL 5 In order to install MySQL, we run apt-get install mysql-server mysql-client You will be asked to provide a password for the MySQL root user - this password is valid for the user root@localhost as well as root@server1.example.com , so we don't have to specify a MySQL root password manually later on: 3 Installing Nginx.