Install Apache + MySQL + PHP in UbuntuServer

Source: Internet
Author: User
Currently, PHP has developed into a mainstream Web programming language. To use PHP for programming, we must first build a PHP system environment, many articles in this area can be found on the Internet, but most of them are for older software versions, or install using the RPM software package in the RedHat environment. This article describes how to use the latest source code package in the javastuserver environment for compilation and installation. Although the javastuserver comes with the LAMP environment package, you can choose to install it,

Currently, PHP has developed into a mainstream Web programming language. To use PHP for programming, we must first build a PHP system environment, many articles in this area can be found on the Internet, but most of them are for older software versions, or install using the RPM software package in the RedHat environment. This article describes how to use the latest source code package to compile and install Ubuntu Server. Although the environment package of Ubuntu Server comes with LAMP, you can choose to install it, however, this article aims to illustrate the process of using the software source code package for compilation and installation. This facilitates the management of the software and the user's understanding of the final configuration of the software environment. For the same reason, this article will not elaborate on how to install and configure the PHP environment using apt-get In Ubuntu Server.

(Note: This article is based on the actual installation process. In order to illustrate some problems, there are repeated operations during this period. For those who wish to complete the installation configuration at one time, we recommend that you read the full text before proceeding with the actual operation)

The reason for choosing Ubuntu Server as the system environment is entirely out of personal preferences. For users using other Linux distributions, the configuration process for compiling and installing software using source code packages is basically the same, the methods and procedures described in this article can also be applied to other Linux releases.

We will not repeat the installation of the operating system here. There may be some differences between different Linux Release versions, as long as the settings are correct, it will not affect the subsequent PHP environment setup. Because all use source code package for installation, compilation, so, http://www.adbrite.cc this article is recommended to separate the/opt partition when installing the operating system, as the software installation partition, it is not installed in the default/usr/local directory to facilitate future configuration and management.

By default, Ubuntu Server does not install any application software. It is a "pure" operating system. However, in the process of compiling and installing the source code package, some necessary editors and library files are required, that is, the Ubuntu dependency, this article will briefly introduce this part of content during compilation and installation.

(Here I will explain that apt-get of Ubuntu is a good tool. With this program, you can easily install various applications, however, to use this program, you must set the "software source". After the system is installed, the default software source list can be found at/etc/apt/sources. in list, most of the software sources are Internet software sources, but for systems that have not yet configured network links, these Internet software sources will not work. In this case, you can install the software through the Ubuntu CD, but sources. by default, the disc software source is blocked in list. You need to manually modify it:

Cd/etc/apt

Sudo vi sources. list

Use "#" to block or delete the Internet software source, and remove "#" before the software source to enable the software source.

In addition, the sources. the disc source recorded in the list is the Ubuntu-Server disc, but the software source in the Ubuntu-Server disc is not as rich as that in the Ubuntu-Server disc, we recommend that you add a Ubuntu-DVD disc to sources. list, you can use the Ubuntu-DVD disc to install the required software as needed, without having to connect to the Internet. The procedure is as follows:

Sudo apt-cdrom add

(You will be prompted to insert the disc and set the Ubuntu-DVD disc to OK .)

After the modification and addition are complete, you also need to update the software source list so that the system can accurately identify the list as follows:

Sudo apt-get update

Now, the configuration of the software source is complete. In the installation process described later in this article, apt-get is involved in the use of the CD source, instead of using any Internet software source .)

Let's get down to the truth and start our installation and configuration journey.

First, we need to obtain the source code packages for Apache, Mysql, and PHP. The official website of the software is as follows:

Apache: http://www.apache.org

MySQL: http://www.mysql.com

PHP: http://www.php.net

The downloaded source code packages are:

Httpd-2.2.9.tar.gz

Mysql-5.0.67.tar.gz

Php-5.2.6.tar.gz

After each source package is decompressed, a directory with the same name as its main file name will be generated (use the tar command to decompress the package, and use the parameter zxvf, that is, "tar zxvf compressed package name "), because Apache and Mysql support needs to be configured during PHP compilation and installation, PHP can only be installed at the end, while the installation sequence of Apache and MySQL is relatively random, this article will first install MySQL (it is recommended that you create a separate directory for software compilation and installation to avoid data confusion with the source package and facilitate software re-compilation ).

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.