LAMP configuration details, specific configuration process

Source: Internet
Author: User
For more information about LAMP configuration, see Linux Enterprise Application-Linux server application. Disclaimer: This tutorial has passed the RedHat Linux 9 test (using a linux system installed with a vmvm)
First download the software package, which contains nine library files:
Mysql_5.0.41-linux-i686.tar.gz zlib-1.2.3.tar.gz httpd-2.2.6.tar.gz
Libpng-1.2.8.tar.gz freetype-2.1.10.tar.gz jpegsrc.v6b.tar.gz
Libxml2-2.6.11.tar.gz gd-2.0.33.tar.gz php-5.2.4.tar.gz
For a total of 9 source code packages, go to the LAMP directory in the red link FTP directory to download them.
Upload the downloaded file to the/root/soft directory (the soft folder is created by yourself)
Then input cd soft in shell or terminal.
**************************************** ********
Note: '//' is a comment or explanation, which is out of the command range.
1. Install mysql:
# Tar zxvf mysql-5.0.41-linux-i686.tar.gz
// Awaiting Decompression
# Music mysql-5.0.41-linux-i686/usr/local/mysql
# Groupadd mysql
# Useradd-d/usr/local/mysql/data-s/sbin/nologin-g mysql
# Cd/usr/local/mysql
# Chown-R root.
# Chown-R mysql data
# Chown-R mysql.
#./Scripts/mysql_install_db -- user = mysql
#./Bin/mysqld_safe -- user = mysql &
# Cp./support-files/mysql. server/etc/rc. d/init. d/mysqld
# Chmod 700/etc/rc. d/init. d/mysqld
# Chkconfig -- add mysqld
// Test and install
#/Usr/local/mysql/bin/mysqladmin ping
// Mysql alive is displayed
#/Usr/local/mysql/bin/mysqladmin version
// The mysql version is displayed.
#/Usr/local/mysql/bin/mysql
// Enter the mysql command prompt. You can enter select 1 + 1 for a simple test.
// Add the root password
#/Usr/local/mysql/bin/mysqladmin-uroot-p
2. Install zlib-1.2.3
# Tar zxvf zlib-1.2.3.tar.gz
# Cd zlib-1.2.3
#./Configure -- prefix =/usr/local/zlib
# Make
# Make install
3. install Apache
# Tar zxvf httpd-2.2.6.tar.gz
# Cd httpd-2.2.6
#. /Configure -- prefix =/usr/local/apache -- sysconfdir =/etc/httpd -- enable-so -- enable-track-vars -- enable-rewrite -- with-z-dir =/ usr/local/zlib
# Make
# Make install
// Set the apache service to be started at the same time when linux is started.
# Echo "/usr/local/apache/bin/apachect1 start">/etc/rc. d/rc. local
4. Install libpng-1.2.8
# Tar zxvf libpng-1.2.8.tar.gz
# Cd libpng-1.2.8
# Cp scripts/makefile. linux makefile
# Make
# Make install
5. Install freetype
# Tar-zvxf freetype-2.1.10.tar.gz
# Cd freetype-2.1.10
# Mkdir-p/usr/local/freetype
#./Configure -- prefix =/usr/local/freetype
# Make; make install
6. Install composer SRC. v6b
// Create a directory first
# Mkdir-p/usr/local/limit 6
# Mkdir-p/usr/local/partition 6/bin
# Mkdir-p/usr/local/users 6/include
# Mkdir-p/usr/local/Example 6/man
# Mkdir-p/usr/local/ipv6man1
# Mkdir-p/usr/local/users 6/man/man1
// Start Installation
# Tar zxvf restart src.v6b.tar.gz
#./Configure -- prefix =/usr/local/defaults 6/-- enable-shared -- enable-static
# Make
# Make install
# Make install-lib
7. Install libxml2
# Tar-zxvf libxml2-2.6.11.tar.gz
# Cd libxml2-2.6.11
# Mkdir-p/usr/local/libxml2
#./Configure -- prefix =/usr/local/libxml2
# Make
# Make install
# Cp xml2-config/usr/bin
// Follow 'y' to confirm the prompt
8. Install the gd library
# Tar-zvxf gd-2.0.33.tar.gz
# Mkdir-p/usr/local/gd2
# Cd gd-2.0.33
#. /Configure -- prefix =/usr/local/gd -- with-jpeg =/usr/local/resize 6/-- with-png =/usr/local/lib/-- with-zlib = /usr/local/zlib -- with-freetype =/usr/local/freetype/
# Make; make install
9. install php
# Tar zvxf php-5.2.4.tar.gz
# Mkdir-p/usr/local/php
# Cd php-5.2.4
#./Configure -- prefix =/usr/local/php \
> -- With-apxs2 =/usr/local/apache/bin/apxs \
> -- With-mysql-dir =/usr/local/mysql \
> -- With-xml =/sur/local/libxml2 \
> -- With-png =/usr/local/lib \
> -- With-jpeg-dir =/usr/local/defaults 6 \
> -- With-zlib =/usr/local/zlib \
> -- With-freetype =/usr/local/freetype \
> -- With-gd =/usr/local/gd \
> -- With-mysql-dir =/usr/local/mysql/bin/mysql_config \
> -- Enable-track-vars \
> -- Enable-soap \
> -- Enable-mbstring = all \
# Make
# Make install
# Cp php. ini-dist/usr/local/php/lib/php. ini
// Use vi to modify httpd. conf
# Vi/etc/httpd. conf
Find "# AddType application/x-gzip.gz.tgz" and add a line below:
AddType application/x-httpd-php. php
Save and exit
Start apache service
Enter the command:./httpd-k start in the/usr/local/apache/bin directory.


By now, lamp has been configured. You can place the php test file in the/usr/local/apache/htdocs directory.
For example, test. php
The content includes:
Phpinfo ();
?>
Enter the address http: // localhost/test. php in the browser.
If displayed, the configuration is successful.

There is a problem here. apache is not started with the system.

If you cannot connect to localhost, enter the directory in shell.
# Cd/usr/local/apache/bin
#./Httpd-k start
To start apache,
Then perform the test
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.