Http2 + PHP5 + MySQL5 + GD2 + Proftpd + php

Source: Internet
Author: User
Tags apache php php mysql xslt
Http2 + PHP5 + MySQL5 + GD2 + Proftpd + php -- Linux Enterprise Application-Linux server application information. For more information, see the following. I have always wanted to write a detailed installation and configuration article on the PHP environment in Linux.
I would like to take the opportunity to write out the installation and configuration steps for beginners to refer!

If you have any mistakes, please testify against them. Thank you! -By Mayer

First, I created a soft folder under the/root directory to save the source package I want to install.
Mkdir/root/soft
Cd/root/soft

First, find the URL for downloading the apache php mysql proftpd source package.
Browse
Http://www.apache.org
Http://www.php.net
Http://www.mysql.com
Http://www.proftpd.org/
And other official websites
Direct download using wget

Wget http://apache.justdn.org/httpd/httpd-2.0.55.tar.gz

Wget http://cn.php.net/get/php-5.0.5.tar....php.net/mirror

Wget http://dev.mysql.com/get/Downloads/M...eznetsols.org/


Step 1: install apache
Note: The current directory is/root/soft,
Directory has
Httpd-2.0.55.tar.gz, php-5.0.5.tar.gz
And other Binary source code packages
# Indicates the root permission. # A command is entered.

Run the following command:
Decompress the source package
# Tar-zxf httpd-2.0.55.tar.gz
Go to the installation directory
# Cd httpd-2.0.55
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
By default, apache works in prefork. c mode, and the number of concurrent processes is 150, which cannot be accessed after it is exceeded. 150 is far from enough. Therefore, we need to change it as needed on our own 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 MYSQL
# Tar-zxf mysql-standard-5.0.15-linux-i686.tar.gz
# Cp-r mysql-standard-5.0.15-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/scripts/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

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/sourc...g-1.2.8.tar.gz
Wget http://keihanna.dl.sourceforge.net/s...-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/root/soft
# 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/root/soft
# Tar-zxf libpng-1.2.8.tar.gz
# Cd libpng-1.2.8
# Cp scripts/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/root/soft
# 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 the latest Curl Library
# Cd/root/soft
# Wget http://curl.haxx.se/download/curl-7.15.0.tar.gz
# Tar-zxf curl-7.15.0.tar.gz
#./Configure -- prefix =/usr/local/curl
# Make; make install

Install PHP

Because php5 requires libxml2 support, download and install libxml2 first.
# Cd/root/soft
# Wget http://ftp.gnome.org/pub/GNOME/sourc...-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/root/soft
# Wget http://ftp.gnome.org/pub/GNOME/sourc...-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.0.5.tar.gz
# Cd php-5.05
#. /Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache/bin/apxs -- with-mysql =/usr/local/mysql/-- with-curl =/usr/local/curl -- enable-ftp -- with-libxml-dir =/usr/local/libxml2 -- with-expat-dir =/usr/lib -- enable-soap -- with-xsl =/usr/local/libxslt -- enable-xslt -- with-gd =/usr/local/gd2/-- with-jpeg-dir =/usr/local/defaults 6/ -- with-zlib-dir =/usr/lib -- with-png -- with-freetype-dir =/usr/local/freetype
# Make
# Make install

The./configure
-- Prefix =/usr/local/php
-- 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

-- With-curl =/usr/local/curl supports CURL Library
-- Enable-ftp support for opening FTP library functions

-- Enable-soap -- with-xsl =/usr/local/libxslt -- enable-xslt
Let PHP support SOAP, which is usually used less and can be removed

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
Create content in your Web directory PHP file, enter the URL to check whether PHP configuration is correct


Install phpmyadmin
Download
# Cd/root/soft
# Wget http://nchc.dl.sourceforge.net/sourc...6.4-pl3.tar.gz
# Tar-zxf phpMyAdmin-2.6.4-pl3.tar.gz
# Vi phpMyAdmin-2.6.4-pl3/config. inc. php
Find $ cfg ['servers'] [$ I] ['auth _ type'] = 'config'; change config to http
After saving
Music phpMyAdmin-2.6.4-pl3/Your phpmyadmin directory
How to solve the problem of Chinese garbled characters in MySQL 4.0-4 port old database
Go to phpmyadmin Management
Create your database name and select gb2312_bin encoding.
Then import the SQL file you have backed up. Select the character set of the file during import: gb2312.
OK after completion
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.