Linux learning NOTE _ 13_2_LAMP environment compilation (II) -- compilation process and analysis

Source: Internet
Author: User
LAMP environment compilation (II) -- Installation of the compilation process and analysis library file I. installation of libxml2 [plain] viewplaincopycdlamplib LAMP environment compilation (II) -- compilation process and analysis
 
Library File installation 1. install libxml2
 
[Plain]View plaincopy
Cd/lamp/libxml2-2.6.30./configure -- prefix =/usr/local/libxml2/
# "/" Indicates a directory. -- prefix specifies the installation path, prefix, and prefix. # if no installation directory is specified, by default, different types of files are scattered to different directories.
# Usually in the/usr/local directory # during configuration, pay attention to the error information, such as error. In particular, the last prompt must be focused.
Makemake install

Note:

1. other configure options

Configure -- help # View help information

Configure -- help | grep zlib # View help information related to zlib

2. check whether the source code package software is successfully installed

After the software installation is complete, it is necessary to go to the corresponding software installation directory to check whether the software is successfully installed. if it is Apache or MySQL, we can also find the startup program under its installation directory, check whether it can be used normally. do not use rpm to check whether it is installed or not, and do not use service commands to enable this program!

3. if an error occurs during the installation process

First, you should delete the installation directory: rm-rf/usr/local/libxml2/# is equivalent to detaching the software without any residual information. if it is a service program, disable the service first.

Delete the source code directory: rm-rf/lamp/libxml2-2.6.30

II. install libmcrypt

[Plain]View plaincopy
Cd/lamp/libmcrypt-2.5.8./configure -- prefix =/usr/local/libmcrypt/
Makemake install # make & make install

Note: you can compile all commands into a shell script, and then execute this script every time you install it.

3. install libltdl

[Plain]View plaincopy
Cd/lamp/libmcrypt-2.5.8/libltdl # It is saved in the previous Directory./configure -- enable-ltdl-install # specify the installation options for ltdl
Makemake install

4. install zlib

[Plain]View plaincopy
Cd/lamp/zlib-1.2.3. /configure # do not specify the zlib installation path, because the zlib tool is often called in subsequent installation. If no related options are added, the system will prompt that the tool cannot be found, in this case, you 'd better select the default installation path.
Makemake install
# Make install>/backup/zlib. log save the zlib installation log, so that you can uninstall and upgrade the tool later.
[Plain]View plaincopycd/lamp/libpng-1.2.31./configure -- prefix =/usr/local/libpng/
Makemake install

6. install iis6

[Plain]View plaincopy
# You need to manually create some directories because the mkdir/usr/local/directories 6 directories will not be automatically created during installation.
Mkdir/usr/local/IPv6/binmkdir/usr/local/IPv6/lib
Mkdir/usr/local/Secrets 6/includemkdir-p/usr/local/Secrets 6/man/man1 #-p option: create a directory and create a subdirectory under it.
Cd/lamp/jpeg-6b./configure -- prefix =/usr/local/configure 6/-- enable-shared-enable-static
Makemake install

7. install freetype

[Plain]View plaincopy
Cd/lamp/freetype-2.3.5./configure -- prefix =/usr/local/freetype/
Makemake install

8. install autoconf

[Plain]View plaincopy
Cd/lamp/autoconf-2.61./configure
Makemake install

IX. install the gd Library

[Plain]View plaincopy
Cd/lamp/gd-2.0.35. /configure -- prefix =/usr/local/gd2/-- with-jpeg =/usr/local/Versions 6/-- with-freetype =/usr/local/freetype/
# -- Wite-... specifies the path of the library used to make
Make install
[Plain]Views plaincopycd/lamp/httpd-2.2.9. /configure -- prefix =/usr/local/apache2/-- sysconfdir =/etc/httpd/-- with-included-apr -- disable-userdir -- enable-so -- enable-deflate = shared -- enable-expires = shared -- enable-rewrite = shared -- enable-static-support
# -- Sysconfdir specifies the location where Apache configuration files are saved: make
Make install

/Usr/local/apache2/bin/apachectl start # start Apache
Echo "/usr/local/apache2/bin/apachectl start">/etc/rc. d/rc. sysinit # set chcon-t texrel_shlib_t filename for Apache startup # enable SELinux's filename module.

11. install the ncurses tool

[Plain]View plaincopy
Cd/lamp/ncurses-5.6./configure -- with-shared -- without-debug -- without-ada -- enable-overwrite
Makemake install

12. install MySQL

[Plain]View plaincopy
Groupadd mysqluseradd-g mysql
Cd/lamp/mysql-5.0.41./configure -- prefix =/usr/local/mysql/-- with-extra-charsets = all
# -- With-extra-charsets = all indicates that make is supported for all character sets.
Make install
# Configure MySQLcp support-files/my-medium.cnf/etc/my. cnf # generate MySQL configuration file my. cnf
/Usr/local/mysql/bin/mysql_install_db-user = mysql # create the mysql user authorization table chown-R root/usr/local/mysql
Chown-R mysql/usr/local/mysql/varchgrp-R mysql/usr/local/mysql

# Start MySQL
/Usr/local/mysql/bin/mysqld_safe -- user = mysql &
# Log on to MySQL and set password for 'root' @ 'localhost' = PASSWORD ('123 ');

# Set MySQL to boot automatically
Cp/lamp/mysql-5.0.41/support-files/mysql. server/etc/rc. d/init. d/mysqldchown root. root/etc/rc. d/init. d/mysqld # Change the file owner and group at the same time
Chmod 755/etc/rc. d/init. d/mysqldchkconfig -- add mysqld
Chkconfig -- list mysqld # Check the startup status of MySQL at various running levels chkconfig -- levels 245 mysqld off # Close MySQL auto-start at 245 running level

 

13. install PHP

 

[Plain]View plaincopy
Cd/lamp/php-5.2.6. /configure -- prefix =/usr/local/php/-- with-config-file-path =/usr/local/php/etc/-- with-apxs2 =/usr/local/apache2/ bin/apxs -- with-mysql =/usr/local/mysql/-- with-libxml-dir =/usr/local/libxml2/-- with-jpeg-dir =/usr/local /Versions 6/-- with-freetype-dir =/usr/local/freetype/-- with-gd =/usr/local/gd2/-- with-mcrypt =/usr/local/libmcrypt /-- with-mysqli =/usr/local/mysql/bin/mysql_config -- enable-soap -- enable-mbstring = all -- enable-sockets
Makemakeinstall
# -- With-config-file-path # specify the location where the configuration file is stored # -- with-apxs2 # specify the path of Apache
# -- With-mysql # specify the directory where MySQL is located # -- with-libxml-dir # specify the directory where libxml is located
# -- With-jpeg-dir # specify the save location of the jpeg library...
# -- With-mysqli # specify mysqli settings # -- enable-soap # activate soap support
# -- Enable-mbstring = all # enable multi-byte support # -- enable-sockets # enable sockets communication feature support
...

# Generate a PHP configuration file
Cpphp. ini-dist/usr/local/php/etc/php. ini # set Apache to parse php files
Echo "Addtype application/x-httpd-php. php. phtml">/etc/httpd. conf/usr/local/apache2/bin/apachectlrestart

# Compile a PHP test script: vi/usr/local/apache2/htdos/info. php

[Php]View plaincopy
?>
[Plain]View plaincopycd/lamp/ZendOptimizer-....../install. sh
Select/usr/local/php/etc as the save path of php. ini.
[Plain]View plaincopycp-a/lamp/phpMyAdmin -.... /usr/local/apache2/htdocs/phpmyadmincp config. sample. inc. php config. inc. php # Generate The phpMyAdmin configuration file
Edit the configuration file: change the content in ''with auth_type to 'http'
 
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.