BCLinux开源软件镜像手册-LNMP运行环境
-
BCLinux开源软件镜像手册-LNMP运行环境
产品描述
本镜像提供的LNMP集成包是全球最经典的PHP运行环境,帮助您在Linux服务器下快速的安装部署PHP应用程序,省去繁琐的配置工作,事半功倍。 LNMP Stack(Linux-Nginx-MySQL-PHP)集成包是全球最流行的Web运行环境之一,基于免费、开源软件构建。框架中包括:Linux操作系统,Nginx Web服务器软件,MySQL数据库,PHP编程语言等四种核心组件以及其他相关辅助组件。通过组合、优化和兼容性处理,将所有组件打包成一个高性能、高集成性的Web运行环境解决方案包,保证能够兼容运行绝大部分PHP应用程序。
环境说明
- 操作系统:BigCloud Enterprise Linux 7
- 软件列表:
- nginx-1.10.2
- mariadb-5.5.50
- php-5.4.16
- redis-3.2.1
- memcached-1.4.15
- phpMyAdmin-4.4.15
- pure-ftpd-1.0.4
软件配置
- Nginx配置文件路径:/etc/nginx/
- Nginx网站主目录:/usr/share/nginx/html/
- Nginx主配置文件:/etc/nginx/nginx.conf
- Mariadb主配置文件:/etc/my.cnf
- PHP主配置文件:/etc/php.ini
- Memcached主配置文件:/etc/sysconfig/memcached
- PHP Memcached扩展配置:/etc/php.d/memcache.ini
- Redis主配置文件:/etc/redis.conf
- PHP Redis扩展配置:/etc/php.d/redis.ini
- Pure-FTPd主配置文件:/etc/pure-ftpd/pure-ftpd.conf
使用说明
- Nginx服务主页:http://IP
- PHPMyAdmin管理主页:http://IP/phpMyAdmin,默认账号密码:root/bclinux
- 默认管理FTP账号密码:nginx/bclinux,默认根目录:/usr/share/nginx/html/
[root@demo-bclinux-7 ~]# ftp 192.168.10.46 Connected to 192.168.10.46 (192.168.10.46). 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- 220-You are user number 1 of 50 allowed. 220-Local time is now 14:34. Server port: 21. 220-IPv6 connections are also welcome on this server. 220 You will be disconnected after 15 minutes of inactivity. Name (192.168.10.46:root): nginx 331 User nginx OK. Password required Password: 230 OK. Current directory is / Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 227 Entering Passive Mode (192,168,10,46,40,237) 150 Accepted data connection drwxr-xr-x 2 995 nginx 4096 Dec 15 11:00 . drwxr-xr-x 2 995 nginx 4096 Dec 15 11:00 .. -rw-r--r-- 1 995 nginx 3650 Oct 31 20:37 404.html -rw-r--r-- 1 995 nginx 3693 Oct 31 20:37 50x.html -rw-r--r-- 1 995 nginx 3700 Oct 31 20:37 index.html -rw-r--r-- 1 995 nginx 24 Dec 15 10:59 index.php -rw-r--r-- 1 995 nginx 368 Oct 31 20:37 nginx-logo.png lrwxrwxrwx 1 0 0 22 Dec 15 11:00 phpMyAdmin -> /usr/share/phpMyAdmin/ -rw-r--r-- 1 995 nginx 2811 Oct 31 20:37 poweredby.png 226-Options: -a -l 226 9 matches total ftp>
- 默认数据库账号密码:root/bclinux,默认存放目录:/var/lib/mysql
[root@demo-bclinux-7 ~]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 6 Server version: 5.5.50-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
- 调整Memcached最低内存大小:
[root@demo-bclinux-7 ~]# vim /etc/sysconfig/memcached ... CACHESIZE="64" => 单位M,默认64M,可调整 ... [root@demo-bclinux-7 ~]# systemctl restart memcached
- 调整Redis最大内存大小:
[root@demo-bclinux-7 ~]# vim /etc/redis.conf ... # maxmemory <bytes> => 取消#注释,单位字节,可调整 ... [root@demo-bclinux-7 ~]# systemctl restart redis
- 创建FTP账户:
[root@demo-bclinux-7 ~]# mkdir -p /data/www [root@demo-bclinux-7 ~]# chown ftpuser:ftpgroup /data/www [root@demo-bclinux-7 ~]# groupadd ftpgroup [root@demo-bclinux-7 ~]# useradd ftpuser -g ftpgroup -d /dev/null -s /sbin/nologin [root@demo-bclinux-7 ~]# pure-pw useradd fuser1 -u ftpuser -g ftpgroup -d /data、www [root@demo-bclinux-7 ~]# pure-pw mkdb [root@demo-bclinux-7 ~]# systemctl restart pure-ftpd
服务管理
- Nginx Server:
systemctl { enable | start | status | restart | reload } nginx
- Mariadb:
systemctl { enable | start | status | restart } mariadb
- PHP-FPM:
systemctl { enable | start | status | restart } php-fpm
- Redis:
systemctl { enable | start | status | restart } redis
- Memcached:
systemctl { enable | start | status | restart } memcached
- Pure-FTPD:
systemctl { enable | start | status | restart } pure-ftpd