• ubuntu16 64 搭建lnmp环境


    //安全设置
    linux(ubuntu16 64) 安全设置
    1.修改ssh端口
    vi /etc/ssh/sshd_config
    如果用户想让22和60000端口同时开放,只需在/etc/ssh/sshd_config增加一行内容如下:
    [root@localhost /]# vi /etc/ssh/sshd_config
    Port 22
    Port 60000
    保存并退出

    2.设置ssh允许登陆的ip
    方法一:
    vim /etc/hosts.allow
    输入 sshd:60.207.126.124:allow

    vim /etc/hosts.deny
    输入(表示除了上面允许的,其他的ip 都拒绝登陆ssh)
    sshd:ALL

    最后sshd重启
    service sshd restart

    方法二:
    比如说你只允许60.207.126.124 这个IP进入,其它都禁止:
    vim /etc/ssh/sshd_config
    添加一行:
    allowusers xxx@60.207.126.124
    注:xxx为你用来登入服务器的用户名

    //防止报错信息
    vim /etc/hosts 加入 127.0.0.1 ICP-System-Online

    3.设置ufw
    安装防火墙 sudo apt-get install ufw
    开启防火墙 sudo ufw enable
    //sudo ufw default deny
    开启端口
    sudo ufw allow 22
    sudo ufw allow 80
    sudo ufw allow 3306
    重启reboot
    //说明
    http://wiki.ubuntu.org.cn/UFW%E9%98%B2%E7%81%AB%E5%A2%99%E7%AE%80%E5%8D%95%E8%AE%BE%E7%BD%AE#.E6.8E.A8.E8.8D.90.E8.AE.BE.E7.BD.AE


    4.设置复杂密码 可以省略

    5.安装lnmp
    http://blog.csdn.net/STFPHP/article/details/53492723
    安装 MySQL时一个一个安装
    //sudo apt-get –y install mysql-server mysql-client php7.1-mysql
    sudo apt-get install mysql-server
    //sudo apt-get install mysql-client
    sudo apt-get install php7.1-mysql

    6.ubuntu下mysql远程连接 https://www.linuxidc.com/Linux/2017-01/139502.htm
    mysql>create database actsightdb;
    mysql>GRANT ALL PRIVILEGES ON actsightdb.* TO drcloud@"%" IDENTIFIED BY "QWEasd123" WITH GRANT OPTION;
    mysql>flush privileges;
    mysql>use actsightdb;
    sudo /etc/init.d/mysql restart
    vi /etc/mysql/mysql.conf.d/mysqld.cnf
    添加'#'注释掉其中的"bind-address = 127.0.0.1"

    7.更改Nginx配置 网站放置目录
    vim /etc/nginx/sites-available/default
    /etc/init.d/nginx restart

    8.开启php报错信息
    修改配置文件
    vim /etc/php/7.0/fpm/php.ini
      设置display_errors = On
    设置error_reporting = E_ALL | E_STRICT
    vim /etc/php/7.0/fpm/php-fpm.conf
      设置php_flag[display_errors] = on (没有就加上)
    重启/etc/init.d/php7.1-fpm restart

    9、安装php扩展时可以 使用 apt-cache search curl | grep php 来查看此扩展的版本

    10、安装phpmyadmin 

    sudo apt-get install phpmyadmin

    sudo ln -s /usr/share/phpmyadmin /home/www/ICP-System/phpmyadmin

  • 相关阅读:
    JS基础(一)异常错误
    实验四 主存空间的分配和回收
    实验三、进程调度模拟程序实验
    学习进度条
    软件工程学期总结
    实验四、主存空间的分配和回收
    诚信与道德
    【操作系统】实验三、进程调度模拟程序实验
    软件工程---在此基础上,进行软件的改进
    【操作系统】实验二 作业调度模拟程序
  • 原文地址:https://www.cnblogs.com/gaogaoxingxing/p/8631175.html
Copyright © 2020-2023  润新知