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
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
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!
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.