Linux study NOTE _ 13_mongolamp environment compilation (on) -- Preparations before compilation

Source: Internet
Author: User
LAMP environment compilation (on) -- Preparations before compilation 1. Introduction 1. why should we build Apache, PHP, and MySQL on Linux? 1) compile (on) their running efficiency LAMP environment on Linux-preparations before compilation

I. INTRODUCTION

1. Why should I build Apache, PHP, and MySQL on Linux?

1) their running efficiency on Linux is higher than that on Windows

2) some modules are only developed for Linux

3) These software was first developed on Linux/UNIX.

2. why not use the latest software?

Because the latest software is not necessarily used by enterprises, most of them use the most stable version!

3. Why do I use the source code package for installation?

Binary packages have their own limitations. for example, binary packages cannot be customized and source code cannot be obtained. In most cases, binary packages are applicable to a specific platform. The source package has a strong applicability. for example, if you have a good understanding of the source code, you can adjust it and make some corresponding settings during compilation, optimize its performance!

4. installation sequence

Apache ---> MySQL ---> PHP

II. install the compilation tool gcc, gcc-c ++, and make

Take CentOS5.5 as an example. if you select Server installation, gcc and gcc-c ++ are not installed, but make is usually installed by default.

1. mkdir/mnt/cdrom

2. mount/dev/cdrom/mnt/cdrom

3. if you cannot connect to the Internet at this time, you can set the disc as the yum source to solve the headache.

1), modify the configuration file:/etc/yum. repos. d/CentOS-Media.repo

Setting options: enable = 1

Baseurl = file: // mnt/cdrom # modify according to the original format

2). mkdir/backup

Mv/etc/yum. repos. d/CentOS-Base.repo/backup # this way, yum won't retrieve this file, so yum won't search for yum sources on the Internet

4. install gcc and gcc-c ++

Yum install gcc

Yum install gcc-c ++

5. if Apache, MySQL, and PHP binary packages are installed in the system

1. it is recommended that you uninstall it because the port is the same as the newly installed port by default.

Yum remove http

2. or make sure that their services are closed.

Service mysql status

Service httpd status

Service mysql stop # turn it off if it is enabled

3. or use the following command to check whether the service is started

Ps-le | grep mysql # if it can be detected, stop it

However, we cannot use the rpm command to view or uninstall a software installed through the source code package.

3. disable SELinux

Edit the configuration file/etc/sysconfig/selinux

Add or modify to: SELINUX = disabled

4. modify Netfilter/iptables

Iptables-F # Delete all default access rules

5. compile tar. sh

cd /lampls *.tar.gz > ls.listfor TAR in `cat ls.list`do    tar -zxf $TARdone 

6. [review] install the source code package software

1. decompress the unpack. tar.gz command: tar-zxf...

2../configure configuration: collect the hardware and software information of the system and generate the files required for compilation.

3. make compilation: compile the source code into an executable file.

4. make install copy and install: Copy the compiled files to the corresponding directory, and set the corresponding permissions for the corresponding files.

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.