Robert Fashion design splendor

Fashion design is a relatively new category, marking the shift from the dominance of French haute couture in the 1950s to new fashion centers in the United States, Europe, and Japan. Youth, street styles, and pop culture have become increasingly central to fashion design.

Popularity: unranked [?]


A detail in server programming
comment No Comments Written by Robert on March 29, 2008 – 1:54 pm

The web server that receives such a request has to recognize it as a command to run a program, rather than an attempt to retrieve a file. A typical web server is configured to have most CGI programs in a cgi-bin subdirectory in one of the directories associated with the web server; all requests referencing files in this cgi-bin directory are interpreted as commands to run programs. Provided there is some scheme whereby the server can identify them, CGI programs can be located in other directories as well; recognition is often based on something like the use of a file extension such as .cgi. The web server process dealing with the client would fork a new process to handle the request.

When a process forks, the child process starts with a copy of the same code as the parent process; in this case, it would be a copy of the web server program. Of course, the child process has to run a different program, either a CGI program written in C/C++ then compiled and linked to give an executable, or an interpreter for a CGI program written using shell script or Perl script. A process can change the code image that it is running by using the exec system call to load code from a different executable file. Like fork, the exec system call is not cheap; there is an additional delay as the disk is accessed and the code is loaded.When the process finally restarts, at the beginning of the main of the newly loaded program, it has to be able to pick up the data with the client’s request, and it also has to be able to return its outputs to the web server.

The Common Gateway Interface defined rules for these data transfers between web server and CGI program. Two mechanisms are used; these are ‘pipes’ connecting the two processes, and environment variables that the web server sets on behalf of the CGI program. A pipe is simply a memory buffer; one process can write to this buffer, and the other process reads from the buffer. A CGI process is always configured so that its stdout (cout) output stream writes to a pipe, with the output data being read from this pipe by the web server process. If a HTTP request is made using the get method, the CGI program will receive all its inputs as values of environment variables. If the request uses the post method, the name=value data are transferred via a second pipe joining web server and CGI program. The web server writes all name=value data to this pipe; a CGI program is configured so that this pipe connects to its stdin (cin) input stream, allowing it to read the data from its stdin.

Environment variables again take the form of name=value pairs. Environment variables are used very extensively in both Unix and Windows operating systems to set parameters such as the directories that are searched for executable files and for library files, the access details for databases, user preferences, and so forth. If you work on a Unix or Linux system, you can use the env shell command to list your default environment (theWindows NT set command works similarly). The login process sets your initial environment. By default, each newly forked process starts with an environment identical to that of its parent. The exec system call used to start a different program has an optional environment argument; this argument is a collection of these name value pairs. Before invoking the exec system call, a process can construct a new environment, one that contains its own environment data along with extra or replacement data. A web server uses this feature to add data to the default environment, data that describe the web server, the current client and the client’s request.

Popularity: 16% [?]

If you enjoyed the article, why not subscribe?

Browse Timeline

Related Post

Post a Comment

About The Author: Robert



Want to subscribe?

 Subscribe in a reader Or, subscribe via email:
Enter your email address:  
Find entries :