Lamp installation centos + apache + mysql + php + gd2 + phpmyadmin Integrated Installation

Source: Internet
Author: User
Redhat LinuxSimple installation and configuration of PHP5 + MySQL5 + GD2 + Proftpd + phpmyadmin
I always wanted to write an article about Linux PHPDetailed installation and configuration documents of the environment, no time
I would like to take the opportunity to write out the installation and configuration steps for beginners to refer!

First findApachePhpMySQLURL of proftpd source package download
Browse
Http://www.apache.org
Http://www.php.net
Http://www.mysql.com
Http://www.proftpd.org/
And other official websites

Step 1: install apache
Note: The current directory is/tmp,
Directory contains httpd-2.2.4.tar.gz, php-5.2.3.tar.gz and other Binary source package
# Indicates the root permission. # A command is entered.

Run the following command:
Decompress the source package
# Tar-zxf httpd-2.2.4.tar.gz
Go to the installation directory
# Cd httpd-2.2.4
Configure apache installation information
#./Configure -- prefix =/usr/local/apache -- enable-modules = so -- enable-rewrite
Execute make to install
# Make; make install
After installation
# Vi/usr/local/apache/conf/httpd. conf
Find
MaxClients 150
Change
ServerLimit 2000
MaxClients 1000
Apache defaultWorkIn prefork. c mode, the number of concurrent processes is 150, which cannot be accessed after it is exceeded. 150 is far from enough. Therefore, we need to modify the number of concurrent processes according to the requirements of our website, such as 1000.
Because the default maximum number of concurrent processes in apache is 256, you must set ServerLimit 2000 to set the maximum number of concurrent processes available on the server to 2000, and then set the maximum number of concurrent processes to MaxClients 1000.

Find # ServerName www.example.com: 80 and set ServerName below:
ServerName www.mysite.com
Www.mysite.com is your website name and can be replaced by an IP address.
Find DocumentRoot "/usr/local/apache/htdocs"
Set the root directory of your WEB server as shown in Figure
DocumentRoot "/myweb"
Change DirectoryIndex index.html. var
DirectoryIndex index.html index. php index.htm
Find ForceLanguagePriority Prefer Fallback and add
Adddefacharcharset gb2312
Save the changes (for the vi usage, check the Linux vi command)
Run the following command to start the WEB Server:
#/Usr/local/apache/bin/apachectl start
Check if your site is normal and the http://www.mysite.com is available with IP
Stop the service with #/usr/local/apache/bin/apachectl stop

Install the MYSQL Binary Package and decompress it.
# Tar-zxf mysql-standard-5.2.10-linux-i686.tar.gz
# Cp-r mysql-standard-5.2.10-linux-i686/usr/local/mysql
# Vi/usr/local/mysql/support-files/my-medium.cnf.
Add
Max_connections = 1000
Log-slow-queries
Long_query_time = 5
Note: max_connections indicates the maximum number of connections allowed.
Log-slow-queries
Long_query_time: the number of seconds for low-speed query (running an SQL statement at this time is recorded in the log)
COPY it to the/etc/my. cnf file.
# Cp/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf
Add mysql users and user groups
# Groupadd mysql
# Useradd-g mysql
Modify mysql Directory Permissions
# Chown-R root/usr/local/mysql
# Chgrp-R mysql/usr/local/mysql
# Chown-R mysql/usr/local/mysql/data
Generate mysql System Database
#/Usr/local/mysql/scr ī pts/mysql_install_db -- user = mysql &
Start mysql Service
#/Usr/local/mysql/bin/mysqld_safe -- user = mysql &
If Starting mysqld daemon with databases from/usr/local/mysql/data appears
The mysql service is started normally. Press Ctrl + C to jump out.
Modify the root password of mysql
#/Usr/local/mysql/bin/mysqladmin-u root-p password 123456
Enter password when you press Enter: the initial password is empty by default. Continue to press Enter.
123456 is your new password
Note: a problem occurs when MySQL5.0 is installed, that is, the lmysqlclient error is prompted during compilation with PHP. This is because another version of MySQL is used, we need to use the Linux x86 version, not the glibc-2.2. Reference? 45, 100371, 101591 # msg-101591)
 

Install the GD library (for PHP to support GIF, PNG, and JPEG)
Download IIS6, libpng, and freetype and install the module.
Wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
Wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz
Wget http://keihanna.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.10.tar.gz
Wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz

Install IIS6
Create directory
# Mkdir/usr/local/limit 6
# Mkdir/usr/local/partition 6/bin
# Mkdir/usr/local/IPv6/lib
# Mkdir/usr/local/latest 6/include
# Mkdir/usr/local/IPv6/man
# Mkdir/usr/local/IPv6/man/man1
# Cd/tmp
# Tar-zxf restart src.v6b.tar.gz
# Cd jpeg-6b
#./Configure -- prefix =/usr/local/defaults 6/-- enable-shared -- enable-static
# Make; make install

Install libpng
# Cd/tmp
# Tar-zxf libpng-1.2.8.tar.gz
# Cd libpng-1.2.8
# Cp SCR implements pts/makefile. STD makefile
# Make; make install

Install FreeType
# Cd/root/soft
# Tar-zxf freetype-2.1.10.tar.gz
# Cd freetype-2.1.10
#./Configure -- prefix =/usr/local/FreeType
# Make; make install

Install the latest GD library
# Cd/tmp
# Tar-zxf gd-2.0.33.tar.gz
# Cd gd-2.0.33
#. /Configure -- prefix =/usr/local/GD2 -- With-JPEG =/usr/local/versions 6/-- With-PNG -- With-zlib -- With-FreeType =/usr/local /FreeType/
# Make; make install

Install PHP

Because PhP5 requires libxml2 support, download and install libxml2 first.
# Cd/tmp
# Wget http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.19.tar.gz
# Tar-zxf libxml2-2.6.19.tar.gz
# Cd libxml2-2.6.19
#./Configure -- prefix =/usr/local/libxml2
# Make; make install

Install libxslt
# Cd/tmp
# Wget http://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/libxslt-1.1.15.tar.gz
# Tar-zxf libxslt-1.1.15.tar.gz
# Cd libxslt-1.1.15
#./Configure -- prefix =/usr/local/libxslt -- with-libxml-prefix =/usr/local/libxml2
# Make; make install

# Tar-zxf php-5.2.3.tar.gz
# Cd php-5.2.3
#. /Configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache/bin/apxs -- with-mysql =/usr/local/mysql/-- enable-ftp -- with-libxml-dir =/usr/local/libxml2 -- with-expat-dir =/usr/lib -- with-xsl =/usr/local/libxslt -- enable-xslt -- with-gd =/usr/local/gd2/-- with-jpeg-dir =/usr/local/with 6/-- with-zlib-dir =/usr/lib -- with-png -- with-freetype-dir =/usr/local/freetype -- enable-mbstring
# Make
# Make install

The./configure
-- Prefix =/usr/local/php5
-- With-apxs2 =/usr/local/apache/bin/apxs
-- With-mysql =/usr/local/mysql/
-- With-libxml-dir =/usr/local/libxml2
Is a required Option

-- With-gd =/usr/local/gd2/
-- With-jpeg-dir =/usr/local/defaults 6/
-- With-png
-- With-zlib-dir =/usr/lib
-- With-freetype-dir =/usr/local/freetype
This is the configuration option for PHP to support the GD library

Configure httpd. conf to make apache support PHP
# Vi/usr/local/apache/conf/httpd. conf
Find AddType application/x-gzip. gz. tgz and add the following content under it:
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps

Restart apache
#/Usr/local/apache/bin/apachectl restart
There is a problem here. If your system has installed the SELinux module, the following error may occur due to security control:
Starting httpd: Syntax error on line 191 of/etc/httpd/conf/httpd. conf:
Cannot load/etc/httpd/modules/libphp5.so into server: libxml2.so. 2: failed to map segment from shared object: Permission denied
[FAILED]
In this case, run the following command in the directory of the specified library file:
Restorecon libxml2.so. 2.6.19
After resolving similar errors, Apache can be started normally.
 
Create content in your Web directory as <? Phpinfo ();?> PHP file, enter the URL to check whether PHP configuration is correct

Install phpmyadmin
Download
# Cd/tmp
# Wget http://nchc.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.10.1.tar.gz
# Tar-zxf phpMyAdmin-2.10.1.tar.gz
PhpMyAdmin must support MySql in PHP.
In Versions later than 2.8, after decompression, You need to manually create a Config directory. After configuration, You need to click Save in configuration on the page to save the file to config. inc. PHP.
# Vi phpMyAdmin-2.10.1/config. Inc. php
Find $ cfg ['servers'] [$ I] ['auth _ type'] = 'config'; change config to HTTP
After saving
Music phpMyAdmin-2.10.1/Your phpMyAdmin directory
Go to phpMyAdmin Management
Note: After PHP connects to the mysql4.1 and 5.0 databases, you must specify the character set for execution such as mysql_query ("set names 'gb2312 '");
Otherwise, Chinese garbled characters are generated!

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.