LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构。
Linux是一类Unix计算机操作系统的统称,是目前最流行的免费操作系统。
Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器。
Mysql是一个小型关系型数据库管理系统。
这四种软件均为免费开源软件,组合到一起,成为一个免费、高效、扩展性强的网站服务系统。
#!/bin/bash a='yuminstall-y' b='yumgroupinstall-y' yum_gpk(){ cd/usr/local/src $awgetlibmcrypt-develbzip2-develgccpcre-developenssl-develphp-mcryptlibmcryptlibxml2-devellibjpeg-devellibpng-develfreetype-devel $b"DevelopmentTools" wgethttp://cn2.php.net/distributions/php-5.5.38.tar.gz wgethttp://nginx.org/download/nginx-1.12.0.tar.gz } nginx_install(){ cd/usr/local/src useraddnginx tarzxvfnginx-1.12.0.tar.gz cdnginx-1.12.0/ ./configure--prefix=/usr/local/nginx--user=nginx--group=nginx--with-http_ssl_module--with-http_flv_module--with-http_stub_status_module--with-http_gzip_static_module--with-pcre make&&makeinstall cd/usr/local/nginx/sbin/ ./nginx netstat-ntlp|grepnginx } nginx_check(){ prog="nginxd" nginx_bin="/usr/local/nginx/sbin/nginx" if[-x${nginx_bin}];then echo"Nginxisinstalld" else echo-n"Nginxisnotinstalled" exit5 fi } php_install(){ cd/usr/local/src tarzxvfphp-5.5.38.tar.gz cdphp-5.5.38/ ./configure--prefix=/usr/local/php--with-mysql=mysqlnd--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd--with-openssl--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--enable-sockets--with-mcrypt--with-bz2--enable-fpm--with-gd make&&makeinstall cp/usr/local/src/php-5.5.38/php.ini-production/usr/local/php/etc/php.ini mv/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf useradd-M-s/sbin/nologinphp sed-i-e's\;pid=run/php-fpm.pid\pid=run/php-fpm.pid\g'-e's\nobody\php\g'-e's\listen=127.0.0.1:9000\listen=0.0.0.0:9000\g'/usr/local/php/etc/php-fpm.conf sed-i's\;daemonize=yes\daemonize=no\g'/usr/local/php/etc/php-fpm.conf /usr/local/php/sbin/php-fpm& } php_check(){ netstat-ntlp|grepphp a=`echo$?` if[$a-eq0];then echo"phpisinstalld" else echo"phpisn'tinstalld" fi } mysql_install(){ $amysqlmysql-server systemctlstartmysqld mysqladmin-uroot-password"123456" mysql-uroot-p123456-e"createdatabasewordpress" mysql-uroot-p123456-e"showdatabases" mysql-uroot-p123456-e"grantallprivilegeson*.*to'root'@'%'identifiedby'123456';FLUSHPRIVILEGES;" } mysql_check(){ netstat-ntlp|grepmysql if[$?-eq0];then echo"mysqldisinstalld" else echo"mysqldisn'tinstalld" fi } wordpress_install(){ mkdir/web cd/web/ wgethttps://cn.wordpress.org/wordpress-4.8-zh_CN.tar.gz tarzxvfwordpress-4.8-zh_CN.tar.gz cp�Crdwordpress/*/web cpwordpress/wp-adminwordpress/wp-contentwordpress/wp-includes-r/web } main(){ yum_gpk nginx_install nginx_check php_install php_check mysql_install mysql_check wordpress_install } main
仅提供参考,后续有待完善代码。。。。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。