Showing posts with label Application. Show all posts
Showing posts with label Application. Show all posts

Friday, July 1, 2011

Using Linux, Apache, MySql, and Php For Application Deployment

Linux, Apache, MySql, and Php can all be used to produce software which runs on a web server, and thus eliminates the need for client software installations on a local computer. What this means is that the server contains both the database front end, the database back end, and the client front end all in one package. Upgrades to software based on Linux, Apache, MySql, and Php (Lamp) can be done with very petite time complex at all, since all of the primary software will only have to be installed one time, on one computer. In addition, Lamp software could very categorically be made available to individuals who are outside of a main office. These workers would plainly have to join together to a company's Vpn to run the intended software.

This tutorial will cover Lamp factory on a stand alone server, which will be able to run software designed for a Lamp environment. This tutorial will also cover basic MySql syntax, so that a server administrator can troubleshoot issues within a single application. This tutorial already assumes that a working factory of Linux is available, and that networking is already setup on the working factory of Linux. For the sake of this tutorial, all of the Lamp components will be installed from source code when needed, and from binary packages when appropriate. This tutorial should be applicable across all distributions of Linux. The first step is to successfully setup Apache.

Apache

Apache factory and Configuration

Apache can be downloaded from apache.org. In this example, Apache version 1.3.31 is used. First, create a directory on the root of your file ideas called src.

mkdir /src

Next, move the Apache software to the /src directory, and passage it.

mv apache_1.3.31.tar.gz /src
tar -xvzf apache_1.3.31.tar.gz

Once Apache is extracted to the /src/apache_1.3.31 directory (version numbering will probably differ), turn to that directory, and configure the Apache Http server.

cd apache_1.3.31
./configure --prefix=/usr/local/apache --enable-module=so
make
make install

You will by all means; of course need the Gnu C Compiler installed (Gcc), and Gnu Make (make) in order to setup Apache. This compilation of Apache will take quite some time, the configure options that were passed to Apache tell the configuration script to setup Apache to the /usr/local/apache directory, and to enable module sustain within Apache. Module sustain will later be used to load Php from. Once Apache is installed, the main configuration file should be copied to /usr/local/apache/conf/httpd.conf. You can then test the web server by issuing a start command to the Apache control script, apachectl:

/usr/local/apache/bin/apachectl start

You should now be able to view the default Apache page at the server's ip address, or domain name if applicable. Since Apache is fully up and running, MySql will be installed next.

MySql Installation

MySql can be either installed by source, or by binary packages. Since there is no need for customization to MySql, MySql can be safely installed from binary packages for this step. If you are using Red Hat Linux, the Rpms you will need to download comprise mysql-version, mysql-server-version, and mysql-client-version. You will also need to satisfy any dependencies requested by these packages. If you run Debian, you plainly will need to enter one command:

apt-get setup mysql-server

Apt-get will then fetch the required dependencies, and setup them. Once MySql is installed, you should first create a password, and a test database. This can be finished by:

mysql -u root -p
mysql> Set Password For root@localhost=Password('desired password');
mysql> create database mydb;
mysql> quit

Once you have created a test database, and assigned a password to the root user, you are ready to setup and configure Php to use MySql.

Php factory and Configuration

Php will need to be installed from source code, which may be downloaded from http://www.php.net. The most recent version as of this writing is 4.3.7. Move and passage Php to the same directory used before, /src:

mv php-4.3.7.tar.gz /src
cd /src
tar -xvzf php-4.3.7.tar.gz
cd php-4.3.7
./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
make
make install

Once Php is installed, the configuration file for Php will need to be copied to the /usr/local/lib directory, and Php will need to be enabled within Apache. You can safely substitute the vi command below with whatever your beloved text editor is.

cp php.ini-dist /usr/local/lib/php.ini
vi /usr/local/apache/conf/httpd.conf

Create the following lines, in the respective sections of httpd.conf (the allowable locations will be under the [main] configuration, and generally don't matter where they are located, but for simplicity, you should place them in the sections which are populated by similar directives).

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
LoadModule php4_module libexec/libphp4.so

You will also want to modify the DirectoryIndex value to:

DirectoryIndex index.php index.html

Which will allow Apache to fetch the default index.php file when a directory is called which contains a file called index.php. Apache will now need to be restarted, via the apachectl script.

/usr/local/apache/bin/apachectl restart

Next, create a file under the default document directory (default is /usr/local/apache/htdocs) called index.php, and insert the following text into it.

print

Using Linux, Apache, MySql, and Php For Application Deployment

Wednesday, June 29, 2011

Application - Layer Protocols

We have just learned that network processes chronicle with each other by sending messages into sockets. But how are these messages structured? What are the meanings of the varied fields in the messages? When do the processes send the messages? These questions bring us into the realm of application-layer protocols. An application-layer protocol defines how an application's processes, running on different end systems, pass messages to each other. In particular, an application-layer protocol defines:

o The types of messages exchanged, for example, ask messages and response messages
o The syntax of the varied message types, such as the fields in the message and how the fields are delineated
o The semantics of the fields, that is, the meaning of the facts in the fields
o Rules for determining when and how a process sends messages and responds to messages

Apache

Some application-layer protocols are specified in Rfcs and are therefore in the social domain. For example, the Web's application-layer protocol, Http (the Hyper Text replacement Protocol (Rfc 2616]), is available as an Rec. If a browser developer follows the rules of the Http Rfc, the browser will be able to retrieve Web pages from any Web server that has also followed the rules of the Http Rfc.

Many other application-layer protocols are rights and intentionally not available in the social domain. For example, many existing P2P file-sharing systems use rights application-layer protocols.

It is important to distinguish in the middle of network applications and application- layer protocols. An application-layer protocol is only one piece of a network application. Let's look at a integrate of examples. The Web is a client-server application that allows users to get documents from Web servers on demand. The Web application consists of many components, along with a proper for document formats (that is, Html), Web browsers (for example, Firefox and Microsoft Internet Explorer), Web servers (for example, Apache and Microsoft servers), and an application-layer protocol. The Web's application-layer protocol, H'I' defines the format and sequence of the messages that are passed in the middle of browser and Web server. Thus, Http is only one piece (albeit, an important piece) of the Web application. As another example, an Internet e-mail application also has many components, along with mail servers that house user mailboxes; mail readers that allow users to read and create messages; a proper for defining the buildings of an e-mail message; and application-layer protocols that define how messages are passed in the middle of servers, how messages are passed in the middle of servers and mail readers, and how the contents of confident parts of the mail message (for example, a mail message header) are to be interpreted. The needful application-layer protocol for electronic mail is Smtp (Simple Mail replacement Protocol) [Rfc 2821]. Thus, e-mail's needful application-layer protocol, Smtp, is only one piece (albeit, an important piece) of the e-mail application.

Application - Layer Protocols