LAMP environment compilation (on) -- 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.