//安全设置
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

最新文章

  1. H5项目开发分享——用Canvas合成文字
  2. Java 加解密 AES DES TripleDes
  3. android 项目中出现红色感叹号的解决方法
  4. mysql workbench
  5. HTML中为何P标签内不可包含块元素?
  6. python_递归
  7. MySQL 5.6 和 MariaDB-10.0 的性能比较测试
  8. eclipse 将文件夹作为sourcefolder
  9. 24C01的IIC 讀寫的c51程式
  10. Yii2 独立操作
  11. PHPCMS二次开发——对栏目可用 limit 限定获取
  12. java多线程知识点概述
  13. 洛谷P2286 [HNOI2004]宠物收养场【Treap】题解+AC代码
  14. Java 常见摘要算法——md5、sha1、sha256
  15. 【CSS基础】实现 div 里的内容垂直水平居中
  16. Rancher
  17. G++ C++之区别
  18. kernel内核配置说明
  19. 移动端html5页面导航栏悬浮遮挡内容第一行解决办法
  20. hadoop2对应的eclipse插件使用

热门文章

  1. MySQL报错: Character set ‘utf8mb4‘ is not a compiled character set and is not specified in the ‘/usr/share/mysql/charsets/Index.xml‘ file
  2. Stuck on "Authenticating with iTunes Store"
  3. C++11 中的function和bind、lambda用法
  4. javascript 相关小的知识点集合
  5. Tensorflow name_scope
  6. bzoj4428
  7. C# 之 6.0 新特性
  8. Get与Post区别小结
  9. mysql基本操作(一)
  10. 【AtCoder】AGC013