Install apache2 + mysql5 + php5 + gd2 + zend

Source: Internet
Author: User
Install apache2 + mysql5 + php5 + gd2 + zend-Linux Enterprise Application-Linux server application in the source code. For more information, see the following. The advantage of installing with source code is that it is easy to manage. Whether it is apache or php, you only need to re-compile any component.


Download the source code for all the software.

Http://www.apache.org

Http://www.php.net

Http://www.php.net

Http://www.mysql.com

Http://www.zend.com

The following is the software required for GD installation.

Http://www.ijg.org/files/jpegsrc.v6b.tar.gz

Http://www.zlib.net/zlib-1.2.3.tar.gz

Http://prdownloads.sourceforge.n... fig.tar.gz? Download

Http://easynews.dl.sourceforge.n... etype-2.1.3.tar.bz2

Install make gcc g ++

Sudo apt-get install build-essential

Next, install 1. apache2.

Tar-zxvf httpd-2.2.0.tar.gz

Cd httpd-2.2.0

./Configure -- prefix =/usr/local/apache -- enable-module = so

Make

Make install

2. freetype

*

Tar-xvjf freetype-2.1.3.tar.bz2

Cd freetype-2.1.3 *

/Configure make

Make

Install

3. jpeg

*

Tar-xvzf restart src.v6b.tar.gz

Cd jpeg-6b/

./Configure -- enable-shared -- enable-static

Make

Mkdir/usr/local/man (this directory may already exist)

Mkdir/usr/local/man/man1

Make install

4. zlib

Tar zxvf zlib-1.2.3.tar.gz

Cd zlib-1.2.3

./Configure

Make

Make install

5. libpng

Tar zxvf libpng-1.2.8-config.tar.gz

Cd zlib-1.2.8

./Configure

Make

Make test

Make install

6. gd2

Tar-zxvf gd-2.0.27.tar.gz

Cd gd-2.0.27/

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

Make

Make install

7. mysql

When installing mysql, a component libncurses5-dev is missing by default, first install

Sudo apt-get libncurses5-dev

Groupadd mysql

Useradd-g mysql

Tar zxvf mysql-5.0.19.tar.gz

Cd mysql-5.0.19

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

Make

Make install

Scripts/mysql_install_db

Chown-R root/usr/local/mysql

Chown-R mysql/usr/local/mysql/var

Chgrp-R mysql/usr/local/mysql

Cp support-files/my-medium.cnf/etc/my. cnf

/Usr/local/mysql/bin/mysqld_safe &

/Usr/local/mysql/bin/mysqladmin-u root password 'new-password'

After entering mysql, the most important thing is to set the root user password in Mysql. Otherwise, the Mysql service is no longer secure.


Mysql> grant all privileges on *. * TO root @ localhost identified by "123456"; note that I use 123456 as the root user password, but this password is not safe, it is recommended that you use a password consisting of uppercase and lowercase letters and numbers, with no less than 8 characters.
In this case, the root user password in MySQL is set up, and then the database you need is created with the root user. Here we take xoops as an example:


Mysql> create database xoops; mysql> grant all privileges on xoops. * TO xoops_root @ localhost identified by "654321 ";
In this way, a xoops_roots user is created, which has all permissions on the database xoops. In the future, we will use xoops_root to manage the xoops database, instead of using the root user. This user's permissions will only be limited to the xoops database.
If you want to implement remote access or control, you have to do two things:
1:


Mysql> grant all privileges on xoops. * TO xoops_root @ "%" identified by "654321"; allow xoops_root users TO log on to MySQL from any machine.
Second:


$ Sudo gedit/etc/mysql/my. in the old cnf version,> skip-networking => # in the new version of skip-networking> bind-address = 127.0.0.1 => bind-address = your machine's IP address so that you can allow other the machine has accessed MySQL.
8. php

Two components are missing by default when installing php.

Sudo apt-get install FLEX (I don't know what this component is)

Sudo apt-get install libxml2 libxml2-dev

Tar zxvf php-5.1.2.tar.gz

Cd php-5.1.2

. /Configure -- with-gd =/usr/local/gd2 -- with-apxs2 =/usr/local/apache/bin/apxs -- with-xml -- with-mysql =/usr/local/ mysql

Make

Make install

Cp php. ini-dist/usr/local/lib/php. ini

9. config apche

Remember to back up httpd. conf

Sudo cp/usr/local/apache/conf/httpd. conf/usr/local/apache/conf/httpd. conf. bak

Vi/usr/local/apache/conf/httpd. conf

Add these two rows

AddType application/x-httpd-php. php. phtml

AddType application/x-httpd-php-source. phps

Some parameters in apache need to be modified.

If ServerName is not modified, an error is reported when apache is started.

Change DocumentRoot to the directory you want to specify.

Find this item: The IfModule dir_module adds the file you want to create as the first page. I added index.htm index. php and typed a space in the middle.

If you want to enable apache to support the shtml format, you can find the following text

This shoshould be changed to whatever you set DocumentRoot.

Set Change the directory to your main directory and add the primary des here. Note that it is case-sensitive. Because I don't want anyone to see my directory structure, the Index is removed from Options FollowSymLinks primary des.

After completing this step, search for the two rows and remove the previous #

AddType text/html. shtml AddOutputFilter

AddOutputFilter between des. shtml

10. php config

Vi/usr/local/lib/php. ini

Register-golbals = On (change the parameter to On)

11. ZendOptimizer

Tar zxvf ZendOptimizer-2.6.2-linux-glibc21-i386.tar.gz

Cd ZendOptimizer-2.6.2-linux-glibc21-i386

./Install. If no exception occurs, press enter all the way.

The advantage of this installation is that the files are relatively uniform and all files are installed in the/usr/local directory, which is easy to back up and can be easily extended. I am basically enough to use these features, if you need it, install it.
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.