Introduction to "lamp": lamp combination Unstoppable Two years after the market share of the highest release time: 2006-9-27 15:52 Author: Shi Zhijun information Source: Phpchina
Posted by Xu Yongju on October 17, 2001 09:34.
Osso Network, was once a good example of the domestic open source world, but finally to catch up with the trend of the site, in September 2000 to the first half of 2001, did not survive how much time and space. But the author implemented the site's entire system architecture, and is the Austrian cable network let the author start contact with open source, know the wonderful LAMP architecture.
LAMP (Linux + Apache + MySQL + Php/perl/python) has become the fact standard of the web community in recent years. In this article we will introduce the installation of lamp combination, this article assumes that you have installed Linux on your machine, if you have any problems with the installation of Linux, you can go to some of the relevant open source site forums to post, to other users to seek help. You can also seek technical support from the relevant vendors. This article of the lamp in the P, temporarily interpreted as PHP, because this site is based on the Zope + Python architecture, so this site in the future article will focus on this aspect.
All of the lamp portfolio software is open source, so you don't have to worry about the price of the product or the copyright issue. On the contrary, there is an ongoing effort by a wide range of open source community developers to update their versions faster than those of expensive proprietary software. Although Linux is prohibitive because of the interface problem, you don't have to worry, now, these software all adopt the browser management interface, many provide phpmyadmin (one utilizes PHP Language in the browser to manage the MySQL program) and Webmin (through the browser to manage the system) to make your convenient management system.
PHP is now a version of the 4.0.4PL1, is an object-oriented cross-platform platform server-side scripting language. Can be embedded in an HTML language and can be run as an Apache module. Here's an example of the Tarball (. tar.gz) format (and its relative to the RPM format) to describe the installation process.
First, go to the corresponding website to download the latest version of the source code. To keep the system directory distribution consistent, it is recommended that they be unpacked to the/USR/LOCAL/SRC directory:
#tar XVFZ filename.tar.gz
To introduce MySQL installation first:
This sets the MySQL installation directory to/usr/local/mysql and then runs make to compile the source code, which can then be installed with make install.
After installation, you need to add the MySQL library to the system, using the Ldconfig command to achieve:
#echo "/usr/local/mysql/lib/mysql" >>/etc/ld.so.conf
#ldconfig-V | grep libmysqlclient
You can then see the system return:
libmysqlclient.so.10 => libmysqlclient.so.10.0.0
Let MySQL run automatically at startup:
#echo "/usr/local/mysql/bin/safe_mysqld >/dev/null &" >>/etc/rc.d/rc.local
Next initialize the database (switch to the/usr/local/mysql directory):
To start the MySQL service:
# bin/safe_mysqld >/dev/null &
# path= "$PATH:/usr/local/mysql/bin"
If you can return all of MySQL's information, it means that your MySQL has been installed successfully. For security reasons, the root user (Superuser in the database) is required to set the password:
Follow the prompts to enter the password, MySQL settings even if you are done.
The next part is the installation of Apache and PHP. If your system already has Apache, then you need to do a backup first. Then enter the Apache source directory:
Enter configuration command:
Then change to PHP's source code directory:
To configure the PHP compile command:
When you run make and make install, PHP is installed successfully.
Change directory to Apache source code:
Because of the addition of the PHP module, you need to reconfigure Apache's compiled files.
#./configure--prefix=/usr/local/apache--activate-module=src/modules/php4/libphp4.a (Note the path here, the following file does not exist, do not worry.) ）
Then run make and made install and you can see several directories of Apache in the/usr/local/apache directory. In order for Apache to get to know the files that end with PHP, we need to modify the/usr/local/apache/conf/httpd.conf
Find the following line and remove the header as the # number for the comment:
AddType application/x-httpd-php. php
This way, the Web server will know the files that are at the end of PHP, or you will be prompted to save when you browse the site. In order for Apache to automatically recognize index.php as the home page we must also modify the DirectoryIndex line to add index.php:
DirectoryIndex index.html index.php
Then, restart Apache:
A testphp.php file can be created in the/usr/local/apache/htdocs directory, which reads:
Then enter http://localhost/testphp.php on the browser and you should see your current PHP settings.
The apache/php installation method described above is a statically compiled method. Every time a new version comes out or a new module is added, Apache must be recompiled, it takes a long time, we do not recommend this method, Apache version 1.3 after the use of DSO (dynamic sharing object) technology, the dynamic installation of the module, this method is not only applicable to PHP, For other modules, such as Mod_perl,mod_python, the author recommends this approach:
Then compile PHP:
The following steps, like the static ones, are mainly to modify the httpd.conf. The easiest way to distinguish between two installation methods is to use commands:
Looking at the output, there is no MOD_SO.C module for static compilation.
I believe that LAMP, as a low-cost, open source, high-performance Web development platform, in China's relatively backward construction of the Internet, in these years, "Government Internet", "Corporate Internet", "gold project" under the call, will send a bright light, illuminate the web platform. In the back of this light, only two words to foil: "Service."
Freelamp will work hard for these two words. Related websites: http://www.freelamp.com