One-click installation package for LAMP in centos 7

Source: Internet
Author: User

One-click installation package for LAMP in centos 7
The LAMP one-click installation package contains a lot of online searches, but it is found that there are fewer LAMP one-click installation packages in CentOS7. The following describes how to use the LAMP one-click installation package in CentOS7.

Not long ago, CentOS was updated to CentOS7.0.1406. To support this version, the LAMP one-click installation script has undergone a lot of updates and tests, and many problems have been encountered, which are recorded here.
As CentOS7 redirects the service to systemctl, some of the boot script needs to be rewritten. This process also takes a lot of time to test. In addition, some dependent packages originally in CentOS6 do not exist in CentOS7, such as libc-client-devel, which is necessary for installing php-imap extensions, without it, compilation of PHP extension imap will inevitably encounter errors, so you can only manually compile and install the imap-2007f, and specify the imap extension path.
Removed some dependency packages that do not exist in both the old and new CentOS, such as libmcrypt-devel, and compiled and installed the latest version.

Some of the most important updates are listed as follows.

1. The method for obtaining public IP addresses is changed.
InIn CentOS7, ifconfig is not installed by default, which is dependent on the net-tools Package. Therefore, the IP address obtained from ifconfig is changed to the curl outer link to obtain the IP address.
Therefore, to install this script, you must ensure the network connection.

2. Manually install some dependent packages

These dependency packages include pcre, libiconv, libmcrypt, mcrypt, re2c, libedit, and imap.
InCentOS5 pcre version is too low will cause Apache compilation failure; MySQL to use readline function, compile and install libedit; PHP extension imap, rely on libc-client shared library, compile and install imap-2007f and so on.
Some of the errors are not detailed on the Internet, especially for Chinese websites. So let's list it here.
PHP compilation error:
Configure: error: utf8_mime2text () has new signature, but U8T_CANONICAL is missing. This shocould not happen. Check config. log for additional information.
This is caused by the lack of dependency packages for imap extensions. Compile and install imap-2007f steps:

Copy the code wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz as follows
Tar-zxf imap-2007f.tar.gz
Cd imap-2007f
Make lr5 PASSWDTYPE = std SSLTYPE = unix. nopwd EXTRACFLAGS =-fPIC IP = 4
Rm-rf/usr/local/imap-2007f/
Mkdir/usr/local/imap-2007f/
Mkdir/usr/local/imap-2007f/include/
Mkdir/usr/local/imap-2007f/lib/
Cp c-client/*. h/usr/local/imap-2007f/include/
Cp c-client/*. c/usr/local/imap-2007f/lib/
CPC-client/c-client.a/usr/local/imap-2007f/lib/libc-client.a

Note: During 64-bit compilation, the make parameter must contain EXTRACFLAGS =-fPIC, but not 32-bit.
At the same timeWhen compiling PHP imap extensions in CentOS7, add the following parameters:

Copy the Code as follows -- with-imap =/usr/local/imap-2007f
-- With-imap-ssl

InDuring CentOS6 compilation, because the dependency package libc-client-devel has been installed, the parameters are as follows:

The Code is as follows:

-- With-imap
-- With-imap-ssl
-- With-kerberos

3. Added some judgment functions.

Added some judgment functions, such as whether to be 64-bit or notCentOS7.

4. Update the Startup Script

Apache STARTUP script/etc/init. d/httpd change, copied to the/usr/local/apache/bin/apachectl file, and to/etc/init. d/httpd status is available, with the configuration file/usr/local/apache/conf/extra/httpd-info.conf added.

5,Problems that may occur in CentOS7

After LAMP is installed, you cannot access the website using an IP address. Check the process and find that httpd and mysqld are also started. The firewall seems to be shut down, and the ping is OK, but it cannot be accessed.
After some troubleshootingThe problem caused by CentOS7's latest firewalld. In this case, we need to replace firewalld with the classic iptables-services.

Run the following command to copy the yum-y install iptables-services Code:
Systemctl mask firewalld
Systemctl enable iptables
Systemctl stop firewalld
Systemctl start iptables

6. PHP component support
So far, one-click installation scripts such as LAMP, LNMP, and LANMP have not been fully supported by PHP components. Many of them are missing. The most typical ones are imap and ldap.
To support these components, I have made a lot of improvements and tests. Put a PHP probe here to support all components and four third-party components.


Although the LAMP one-click installation script has been tested in a large number, there are still some imperfections. If you encounter problems during use, install the log lamp. log to I [at] teddysun.com

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.