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. oracle 索引失效原因及解决方法

    oracle 索引失效原因及解决方法 2010年11月26日 星期五 17:10 一.以下的方法会引起索引失效 ‍1,<>2,单独的>,<,(有时会用到,有时不会)3,like ...

  2. Android 中Service生命周期

    使用context.startService() 启动Service 其生命周期为context.startService() ->onCreate()- >onStart()->S ...

  3. OpenGL的视图变换、模型变换、投影变换、视口变换

    产生目标场景的过程类似于用照相机进行拍照: (1) 把照相机固定在三角架上,并让他对准场景从不同位置观察场景(视图变换) gluLookAt (2) 对场景进行安排,使各个物体在照片中的位置是我们所希 ...

  4. PKCS #1 RSA Encryption Version 1.5

    PKCS #1  RSA Encryption Version 1.5 在进行RSA运算时需要将源数据D转化为Encryption block(EB).其中pkcs1padding V1.5的填充模式 ...

  5. 本地获取System权限CMD方法汇总(转)

    本地获取System权限CMD方法汇总(转) 稍微整理了下,大概有三种方法可以本地获取system权限的cmd,但前提都是当前用户具备administrator权限. 下面列举的三种方法各有千秋,看你 ...

  6. 转 java List 与ArrasyList 区别

    转 List是一个接口,而ListArray是一个类, ListArray继承并实现了List. 为什么要用 List list = new ArrayList() ,而不用 ArrayList al ...

  7. dshow,Sample Grabber 从摄像头采集

    char* CCameraDS::QueryFrame() { long evCode, size = 0; #if CALLBACKMODE static double lastSampleTime ...

  8. virutalbox虚拟机硬盘扩容

    大小改变为30GB VBoxManage modifyhd d:\newxp.vdi --resize 30000 然后用diskgenius扩从容量

  9. 能源项目xml文件标签释义--<mvc:annotation-driven>

    <mvc:annotation-driven />的可选配置 <mvc:annotation-driven message-codes-resolver ="bean re ...

  10. Django开发博客- 模型

    django的模型就是用于在数据库中存储的某种类型的对象.在我们的博客系统中, 发表的文章就是一个模型,需要存储在数据库中. 这里我们使用django默认的sqlite3库,对于我们的这个小系统而言已 ...