Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Lnmp script installation

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

#! / bin/bash

SOFTWARE_SOURCE=/home/source

NGINX_VERSION=nginx-1.8.0.tar.gz

MYSQL_VERSION=mysql-5.6.26.tar.gz

PHP_VERSION=php-5.5.29.tar.gz

If [!-d $SOFTWARE_SOURCE/nginx-1.8.0]; then

Echo "= start installation of Nginx=="

For i in $(chkconfig | awk'{print $1}'); do chkconfig $i off; done

Chkconfig network on

Chkconfig sshd on

Chkconfig rsyslog on

Chkconfig crond on

Yum install gcc gcc-c++ zlib zlib-devel pcre pcre-devel openssl openssl-devel-y

Tar xf $SOFTWARE_SOURCE/$NGINX_VERSION-C $SOFTWARE_SOURCE

Cd $SOFTWARE_SOURCE/nginx-1.8.0

. / configure\

-- prefix=/usr/local/nginx\

-- user=web\

-- group=web\

-- with-http_stub_status_module\

-- with-http_ssl_module

Make & & make install | | exit 1

Echo "= Nginx installed successfully = ="

Else

Echo "= failed to install Nginx ="

Fi

If [!-d $SOFTWARE_SOURCE/mysql-5.6.26]; then

Echo "= start installation of MySQL=="

Useradd-s / sbin/nologin mysql

Yum install cmake ncurses ncurses-devel-y

Tar xf $SOFTWARE_SOURCE/$MYSQL_VERSION-C $SOFTWARE_SOURCE

Cd $SOFTWARE_SOURCE/mysql-5.6.26

Cmake\

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\

-DMYSQL_DATADIR=/home/mysql/data\

-DSYSCONFDIR=/etc\

-DWITH_MYISAM_STORAGE_ENGINE=1\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_MEMORY_STORAGE_ENGINE=1\

-DWITH_READLINE=1\

-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock\

-DMYSQL_TCP_PORT=3306\

-DENABLED_LOCAL_INFILE=1\

-DWITH_PARTITION_STORAGE_ENGINE=1\

-DEXTRA_CHARSETS=all\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci

Make & & make install | | exit 1

Echo "= MySQL installed successfully = ="

Else

Echo "= failed to install MySQL ="

Echo "= MySQL installed successfully = ="

Else

Echo "= failed to install MySQL ="

Fi

If [!-d $SOFTWARE_SOURCE/php-5.5.29]; then

Echo "= start installation of PHP=="

Yum install make gd gd-devel zlib zlib-devel\

Libxml2 libxml2-devel freetype\

Freetype-devel libpng libpng-devel\

Bison bison-devel libjpeg libjpeg-devel\

Libmcrypt libmcrypt-devel curl curl-devel-y

Tar xf $SOFTWARE_SOURCE/$PHP_VERSION-C $SOFTWARE_SOURCE

Cd $SOFTWARE_SOURCE/php-5.5.29

. / configure\

-- prefix=/usr/local/php\

-- with-config-file-path=/usr/local/php/etc\

-- with-mysql=/usr/local/mysql/\

-- with-mysqli=/usr/local/mysql/bin/mysql_config\

-- with-pdo-mysql=/usr/local/mysql\

-- with-libxml-dir\

-- with-png-dir\

-- with-jpeg-dir\

-- with-freetype-dir\

-- with-gd\

-- with-zlib-dir\

-- with-openssl\

-- with-mcrypt\

-- enable-xml\

-- enable-soap\

-- enable-safe-mode\

-- enable-short-tags\

-- enable-static\

-- enable-mbstring=all\

-- enable-sockets\

-- enable-fpm\

-- enable-mbstring\

-- with-curl\

-- with-mhash\

Make & & make install | | exit 1

Echo "= PHP installed successfully = ="

Else

Echo "= failed to install PHP ="

Fi

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report