1,解决ssh登录慢的问题记录

vim /etc/ssh/ssh_config    #   GSSAPIAuthentication no  把下面这一行的注释去掉

2,Linux查看当前是什么系统

centos cat /etc/redhat-release  ubuntu cat /etc/issue     sudo runlevel

常用方法:find / -name php.ini grep -Fnr class ./  which|whereis nginx  ps -ef | grep nginx ps aux | grep nginx

ps -eo pid,user,group,args,etime,lstart  chmod 777 xxx  || chmod  u+x 脚本名  kill xx  kill -9 $(pgrep nginx)

3,下载与安装

yum upgrade

手动配文件自动安装:

vi /etc/yum.repos.d/mongodb.repo
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

http://mirror.centos.org/centos/7/os/x86_64/Packages/
rpm -Uvh yum-3.2.29-17.el6.centos.noarch.rpm

手动下载安装
wget http://nginx.org/download/nginx-1.2.8.tar.gz
tar -zxvf nginx-1.2.8.tar.gz
cd nginx-1.2.8 
./configure
make && make install

4,自动加载与定时执行   chmod +x /etc/rc.local

vi /etc/rc.local  
touch /var/lock/subsys/local
sudo service php-fpm start
sudo service nginx start
sudo service mariadb start
memcached -d m 256 -u root -l 127.0.0.1 -p 11211 -c 510
php /home/menusifu/nginx/html/workerman/start.php start -d

1,/etc/rc.local
step1. 先修改好脚本,使其所有模块都能在任意目录启动时正常执行;
step2. 再在/etc/rc.local的末尾添加一行以绝对路径启动脚本的行;
2,/etc/init.d

# chkconfig: 2345 20 80
 # description: Saves and restores system entropy pool for
 # higher quality random number generation.

chown root.root /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld
hkconfig --levels 245 mysqld off

$ chown -R root /etc/rc.d/init.d/apache
$ chmod 700 /etc/rc.d/init.d/apache
$ ll /etc/rc.d/rc3.d/
sudo runlevel
update-rc.d mysql start 98 3 .
/etc/rc3.d
3,移除符号链接
update-rc.d -f s10 remove

5,防火

yum install iptables-services
systemctl enable iptables
systemctl [stop|start|restart] iptables OR service iptables status

vi /etc/sysconfig/iptables

# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 9000 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 11211 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22999 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3000 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 9696 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 27017 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

Linux 常用的更多相关文章

  1. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

  2. linux常用命令的介绍

    本文主要介绍Linux常用命令工具,比如用户创建,删除,文件管理,常见的网络命令等 如何创建账号: 1. 创建用户 useradd -m username -m 表示会在/home 路径下添加创建用户 ...

  3. linux常用指令

    整理下来的linux常用指令 mount [-t 文件系统] 设备文件名 挂载点挂载命令,一般用于在挂载ISO,或者其他比如U盘等设备时使用,[-t iso9660]为固定格式,可写可不写,非必写项. ...

  4. linux——常用命令与脚本

    linux常用命令 --文件管理pwd --查看当前目录cd --切换当前目录ls --列出当前目录下的所有文件touch --创建文件mkdir --建立目录rmdir --删除空目录rm --删除 ...

  5. Linux常用的安全工具 转自https://yq.aliyun.com/articles/52540?spm=5176.100239.blogcont24250.8.CfBYE9

    摘要: 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://chenguang.blog.51cto.com/350944/85790 ...

  6. Linux 常用工具小结:(5) lftp工具使用

    Linux 常用工具小结:(1) lftp工具使用. 这里会按照一些比较常用的功能列出,并举一个具体的例子逐一解释功能. 通常使用ftp过程是登陆ftp,浏览ftp内容,下载ftp文件,或者上传ftp ...

  7. DOS 和 Linux 常用命令的对比

    DOS 和 Linux 常用命令的对比 许多在 shell 提示下键入的 Linux命令都与你在 DOS 下键入的命令相似.事实上,某些命令完全相同. 本附录提供了 Windows的 DOS 提示下的 ...

  8. 第一章,Linux常用命令

    20161124 Linux常用命令1.find find /etc/ -size +50k -lsfind /etc/ -size +50k -ls 2> /dev/null查看目录下大于50 ...

  9. linux常用快捷键

    linux常用快捷键:ctrl+c 强制终止当前命令ctrl+l 清屏ctrl+a 光标移动到命令行首ctrl+e 光标移动到命令行尾ctrl+u 从光标合所在的位置删除到行首ctrl+z 把命令放到 ...

  10. linux常用操作指令

    Linux常用操作指令: 常用指令 ls        显示文件或目录 -l           列出文件详细信息l(list) -a          列出当前目录下所有文件及目录,包括隐藏的a(a ...

随机推荐

  1. Binary Tree Paths

    Description: Given a binary tree, return all root-to-leaf paths. For example, given the following bi ...

  2. 高质量JavaScript代码书写基本要点

    翻译-高质量JavaScript代码书写基本要点 by zhangxinxu from http://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/ ...

  3. Linux 系统时间查看 及 时区修改(自动同步时间)

    1:使用date命令查看时区 [root@db-server ~]# date -R   Sun, 11 Jan 2015 07:10:28 -0800   [root@db-server ~]#   ...

  4. final简介

    final简介 final用来修饰方法和属性表示特殊的意义.修饰方法时表示方法不能被重写:修饰属性时表示属性不能被改变,这里属性又分为对象和基本类型,修饰基本类型表示基本类型赋值以后不能再被赋值,修饰 ...

  5. Hbase之Exception

    [hadoop@master hbase-1.2.2]$ ./bin/hbase shell2016-08-25 13:53:56,898 WARN [main] util.NativeCodeLoa ...

  6. AlphaGo实现原理

    AlphaGo已经打败了李世石9段,如果你也懂它背后的原理,或许某一天你也可以开发出一款AI来打败dota或者LOL的世界冠军. Mastering the game of Go with deep ...

  7. Linux 打包和压缩 方法详解

    一般基因组的数据都非常大,所以都会 打包 压缩 后进行传输,拿到数据后的第一步必然就是要 解包 和 解压缩. 基本常识 首先要弄清两个概念:打包 和 压缩. 打包 是指将一大堆文件或目录变成一个总的文 ...

  8. sizeof和strlen()的区别

    二者有本质上的区别 从定义可以知道sizeof只是一个operator,而strlen()则是定义一个定义在<string.h>中的函数;所以sizeof(string)是在计算strin ...

  9. Nodejs环境变量

    PATH,就是那个意思,没有特殊含义. NODE_PATH,将node_modules作为全局模块,多个安装目录用;分开.这样node在加载模块时首先会到项目目录下的node_modules目录加载相 ...

  10. EasyDropDown – 很棒的下拉菜单 含精美主题

    EasyDropDown 是一个 jQuery 插件,你可以毫不费力地将简陋的 Select 元素设置为可定制风格的下拉菜单,用于表单或者一般的导航.和著名的下拉插件 Chosen 很像,但是具有自己 ...