Install MySQL 5.1.45 binary and multi-Apache php in CentOS

Source: Internet
Author: User

1. Download the binary version. Many websites now have related downloads, which are about 384 Mb in size and about MB in decompression.

My downloaded version is: mysql-5.1.45-linux-i686-glibc23

2. The glibc2.3 version is required from the file name.

Shell> rpm-q glibc

3. Copy the mysql-5.1.45-linux-i686-glibc23 to/usr/local/mysql;

4. Change the/usr/local/mysql permission to chown mysql. mysql/usr/local/mysql.

5. cd/usr/local/mysql/script

6. vi mysql_install_db: Modify the mysql directory and data creation location:

Basedir = "/usr/local/mysql /"
Builddir = ""
Ldata = "/usr/local/mysql/data" # storage location of generated database files

Langdir = "/usr/local/mysql/share"

7. Run the script to create a database after modification.

8. modify data permissions:

Chown-R mysql. mysql/usr/local/mysql/data

9. Modify the my. cnf file:

Cp/usr/local/mysql/support-files/my-medium.cnf/etc/my5.cnf

[Client]
# Password = your_password
Port = 3308
Socket =/tmp/mysql5145.sock

# Here follows entries for some specific programs

# The MySQL server
[Mysqld]
Port = 3308
Socket =/tmp/mysql5145.sock

10. Start mysql:

/Usr/local/mysql/bin/mysqld_safe -- defaults-file = '/etc/my5145.cnf' -- user = mysql &

Echo/usr/local/mysql/bin/mysqld_safe -- defaults-file = '/etc/my5145.cnf' -- user = mysql &>/etc/rc. local

In this way, mysql can be started at startup.

10. Complete.

Compile and Install Multiple apache:

If apache is installed in/usr/local/apache.

Now install it in/usr/local/apache2.

1. mkdir/usr/local/apache2

2. Start Compilation:

./Configure -- prefix =/usr/local/apache2

3. make

4. make install

Install Multiple php versions:

The previous php4 is installed in/usr/local/php

Install php5 (php-5.2.11) now at/usr/local/php5

1. mkdir/usr/local/php5

. /Configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql =/usr/local/mysql -- with-config- file-path =/usr/local/php5/lib-enable-track-vars -- enable-sockets -- with-zlib

2. make & make install

3. cp php. ini-dist/usr/local/php5/lib/php. ini

4. Edit/usr/local/apache2/conf/httpd. conf.

A. Modify the default listening port:

Listen 8080.

B. Modify the started users and groups.

User

Group

C. Add php support AddType.

D. Modify the search order of the home page.

DirectoryIndex index.html index. php

E. Added support for the default Chinese language.

DefaultCharset

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.