lamp Architecture is one of the most mature enterprise website application patterns, which refers to a complete set of system and related software, which can provide dynamic Web site service and its application development environment. Lamp is an abbreviation. L refers to the Linux operating system; A is the Apache Web server; M is the MySQL database; p is the PHP Web page language.
The advantages of the lamp platform: low cost, all components open source free. Customizable, with a large number of additional components and expandable function modules. Easy to develop. Easy to use. Safe and stable.
One, install Apache
See my previous blog for specific steps
Second, install MySQL database
1. Uninstall the original RPM-installed MySQL to avoid program conflicts
2.MySQL need to compile the installation using CMake, so first install CMakebefore installing we need to prepare aCMakethe source package, because5.5version is not availableconigureconfiguration is required to useCMakeThis tool is configured and we canhttp://www.CMake. org/CMake/resources/software.htmldownload the required version and start installing CMake
Need to create database running user before installation
3. Next, start installing MySQL
Dcamk_install_prefix specify the path of the installation
Dsysconfdir specify the path to the master configuration file
Ddefault Specify the default encoding character
ddefault_collation Specify the character set used by the varsity rules
Dwith_extra_charsets=all specifying an additional coded character set All for all character sets
After the configuration is complete, enter make && make install to start compiling the installation
after installation, adjust the permissions settings for the database
4. Create the configuration file, under the Support-files folder in the MySQL source directory, provide a sample configuration file suitable for different load databases. If you do not determine the application scale of the database system, generally choose MY-MEDIUM.CNF file. Delete the original my.cnf file under etc, and under my-medium.cnf from the support-files folder, Copy to etc/my.cnf.
5. Initialize the database and specify the MySQL user to run
6. Set the variable environment, in order to facilitate the use of MySQL command in any directory, you need to set the environment variable in/etc/profile
7. Add as System service and start MYSQ
Start a successful MySQL database as shown
Third, install PHP
1. Before you install PHP, you need to see if you have installed Zlibe-devel and libxml2-devel, if you do not have a system CD installed.
2. Install the extended database, in real-world applications, some HTTP-based Web applications will require additional extension tools, such as encryption tools Libmcrypt,mhash,mcrypt, etc. (can be downloaded from www.sourceforge.net)
(1) Installation Libmcrypt
(2) Installation Mhash
(3) Installation MCrypt
installation MCrypt Expansion Pack There will be an error
This is where the file is not found in the variable and resolved
After completion, enter make && make install to compile the installation
3. Compiling and installing PHP
--prefix specify the path of the installation
--with-mcrypt support for extension tools such as loading data encryption
--WITH-APXS2 Specify Apcahe Server module Files provided also generated for connection Apache program, which defaults to the Apache Add a configuration item to the main configuration file
--with-mysql Specify MySQL the installation directory
--with-config-file-path Specify a storage path for the configuration file
--enable-sbsrting start a multi-character set to support Chinese characters
Make && make install build installation
Four, httpd.conf configuration adjustment
If the HTTPD server supports PHP page parsing, the PHP program module file needs to be loaded via the LoadModule configuration item and supported by the ". PHP" type Web page file via the AddType configuration item. In addition, modify the Directorylndex configuration line, add index.php configuration items, and identify common PHP home files. Open httpd.conf configuration File "Vim/usr/local/httpd/conf/httpd.conf"
Five, test lamp work together
(1) test whether the PHP Web page is displayed correctly
Write a. php format test page "vim/usr/local/httpd/htdocs/index.php"
Client Connections
Lamp Construction Completed
Six. Lamp Architecture Application Example
Describes a management suite--phpmyadmin. Used for graphical management of MySQL database, even if the SQL statement is not very skilled also can easily manage the MySQL database,phpmyadmin source package can be downloaded from www.phpmyadmin.net. The following is a multi-language version of the source package phpmyadmin-4.2.5-all-languages.tar.gz As an example installation
(1) Unpacking and copying to the Web site Directory
(2) Setting up the configuration file config.inc.php
after you copy the phpMyAdmin suite to the site directory. You also need to create a configuration file to use it properly
(3) Access to phpMyAdmin Web management interface domain name suffix plus/phpmyadmin access
phpadmin System Deployment is complete and the application of shell scripts will be introduced later.
Linux lamp platform Build and deployment with Phpadmin Management Suite