Linux 常用
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
手动配文件自动安装:
[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 常用的更多相关文章
- Linux常用命令(一)
Linux常用命令 1. pwd查看当前路径(Print Working Directory) [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...
- linux常用命令的介绍
本文主要介绍Linux常用命令工具,比如用户创建,删除,文件管理,常见的网络命令等 如何创建账号: 1. 创建用户 useradd -m username -m 表示会在/home 路径下添加创建用户 ...
- linux常用指令
整理下来的linux常用指令 mount [-t 文件系统] 设备文件名 挂载点挂载命令,一般用于在挂载ISO,或者其他比如U盘等设备时使用,[-t iso9660]为固定格式,可写可不写,非必写项. ...
- linux——常用命令与脚本
linux常用命令 --文件管理pwd --查看当前目录cd --切换当前目录ls --列出当前目录下的所有文件touch --创建文件mkdir --建立目录rmdir --删除空目录rm --删除 ...
- Linux常用的安全工具 转自https://yq.aliyun.com/articles/52540?spm=5176.100239.blogcont24250.8.CfBYE9
摘要: 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://chenguang.blog.51cto.com/350944/85790 ...
- Linux 常用工具小结:(5) lftp工具使用
Linux 常用工具小结:(1) lftp工具使用. 这里会按照一些比较常用的功能列出,并举一个具体的例子逐一解释功能. 通常使用ftp过程是登陆ftp,浏览ftp内容,下载ftp文件,或者上传ftp ...
- DOS 和 Linux 常用命令的对比
DOS 和 Linux 常用命令的对比 许多在 shell 提示下键入的 Linux命令都与你在 DOS 下键入的命令相似.事实上,某些命令完全相同. 本附录提供了 Windows的 DOS 提示下的 ...
- 第一章,Linux常用命令
20161124 Linux常用命令1.find find /etc/ -size +50k -lsfind /etc/ -size +50k -ls 2> /dev/null查看目录下大于50 ...
- linux常用快捷键
linux常用快捷键:ctrl+c 强制终止当前命令ctrl+l 清屏ctrl+a 光标移动到命令行首ctrl+e 光标移动到命令行尾ctrl+u 从光标合所在的位置删除到行首ctrl+z 把命令放到 ...
- linux常用操作指令
Linux常用操作指令: 常用指令 ls 显示文件或目录 -l 列出文件详细信息l(list) -a 列出当前目录下所有文件及目录,包括隐藏的a(a ...
随机推荐
- (四)ubuntu学习前传—uboot中对Flash和DDR的管理
1.uboot阶段Flash的分区 (1)所谓分区,就是说对Flash进行分块管理.(2)PC机等产品中,因为大家都是在操作系统下使用硬盘的,整个硬盘由操作系统统一管理,操作系统会使用文件系统帮我们管 ...
- ios7适配一些问题以及64位32位
ios7适配一些问题(http://www.cocoachina.com/ios/20130703/6526.html) 1.iOS应用如何实现64位的支持 http://www.codeceo.co ...
- golang csv,xls,xlsx
要用到的包: "golang.org/x/text/encoding/simplifiedchinese" "golang.org/x/text/transform ...
- Machine Learning - 第4周(Neural Networks: Representation)
Neural networks is a model inspired by how the brain works. It is widely used today in many applicat ...
- 在滚动列表中实现视频的播放(ListView & RecyclerView)
英文原文:Implementing video playback in a scrolled list (ListView & RecyclerView) 本文将讲解如何在列表中实现视频播放. ...
- 晒幸福, qq空间晒法
qq空间晒法 1.成为老婆之后,还是说新交的女朋友,这会让女朋友感动
- VC++全局变量初始化
目录 第1章说明 2 1.1 程序启动 2 1.2 强符号.弱符号 2 1.3 动态初始化顺序 3 1.4 exe调用dll 4 1.5 禁用动态初始化 4 1.6 ...
- License Manager 10.3启动失败解决方法
参考:http://jingyan.baidu.com/article/c275f6bac8763ae33d756788.html 安装ARCGIS10.3过程中无法启动license. 解决办法: ...
- Tiny语法分析器(递归下降分析法实现)
递归规约规则是这样的 program→stmt-sequence stmt-sequence→stmt-sequence;statement|statement statement→if-stmt|r ...
- C线程同步/异步
#include<windows.h> #include<stdio.h> #include<string.h> //#include <afxmt.h> ...