linux烂笔头记忆

开放端口:
vi /etc/sysconfig/iptables ±A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
service iptables restart 重启

命令行打开新终端
ctrl + alt +f1-6

/etc/apt/sources.list
阿里的源
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
iptables -I INPUT -p tcp -m state --state NEW --dport 1935 -j ACCEPT #放行1935端口的 NEW状态请求
service iptables save #保存规则
service iptables restart #重启防火墙保证新的规则加载进来

LINUX通过下面的命令可以开启允许对外访问的网络端口:
/sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT #开启8000端口
/etc/rc.d/init.d/iptables save #保存配置
/etc/rc.d/init.d/iptables restart #重启服务

关闭防火墙的方法为:

  1. 永久性生效
    开启:chkconfig iptables on
    关闭:chkconfig iptables off
  2. 即时生效,重启后失效
    开启:service iptables start
    关闭:service iptables stop

查看端口是否已经开放
/etc/init.d/iptables status

//固定IP 权限
 vim /etc/network/interfaces
iface eth0(自己的名) inet static
address 192.168.80.129
netmask 255.255.255.0
gateway 192.168.80.2
//永久DNS
 vim /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.80.2
nameserver 8.8.8.8

重启networking服务使其生效:
/etc/init.d/networking restart

ps -ef |grep xxxxx

find . -name “.c"
find . -name "
.js” | xargs grep "‘cmd’"搜索文件里面
磁盘容量查询
df

mysql安装
1.yum list mysql*
2.yum install mysql*
3.service mysqld start
4./usr/bin/mysqladmin -u root password “123456”

Linux中FTP安装与配置:https://blog.csdn.net/pojun_gufeiyang/article/details/70158074

ftp500 : setsebool ftp_home_dir on

passwd UserName

挂载命令:mount /dev/cdrom /mnt

tomcat
wget http://www.aminglinux.com/bbs/data/attachment/forum/apache-tomcat-7.0.14.tar.gz
解压可用

zookeeper
wget http://mirrors.shu.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz
第一步:安装jdk
第二步:把zookeeper的压缩包上传到linux系统。
第三步:解压缩压缩包
tar -zxvf zookeeper-3.4.6.tar.gz
第四步:进入zookeeper-3.4.6目录,创建data文件夹。
第五步:把zoo_sample.cfg改名为zoo.cfg
[root@localhost conf]# mv zoo_sample.cfg zoo.cfg
第六步:修改data属性:dataDir=/root/zookeeper-3.4.6/data
第七步:启动zookeeper
[root@localhost bin]# ./zkServer.sh start
关闭:[root@localhost bin]# ./zkServer.sh stop
查看状态:[root@localhost bin]# ./zkServer.sh status

注意:需要关闭防火墙。
service iptables stop
永久关闭修改配置开机不启动防火墙:
chkconfig iptables off
如果不能成功启动zookeeper,需要删除data目录下的zookeeper_server.pid文件。

你可能感兴趣的:(烂笔头)