美文网首页linuxlinux tools
(网络服务)Linux运维之道

(网络服务)Linux运维之道

作者: SkTj | 来源:发表于2019-01-26 19:43 被阅读124次

    apachectl 启动参数:
    start,stop,restart,graceful,graceful -stop,status,configtest

    options :
    all,execcgi followsyminks indexes


    order deny,allow
    deny from all
    --
    <IfModule xxmodule>
    xx
    </IfModule>
    --


    image.png

    <Directory ~ "">

    <Files 文件名>xx </File>

    <Location url>

    <VirtualHost * :80>
    ServerAdmin xx@qq.com
    DocumentRoot "/usr/local/zz"
    ServerName www.xx.com
    ServerAlias web.xx.com
    ErrorLog "xx.log"
    CustomLog "a.log" common
    </VirtualHost>
    iptables -A INPUT -p tcp --dport 80 -j ACCEPT


    apache ssl 443


    image.png
    image.png

    --
    KILL:参数
    HUP 新配置
    USR1 日志文件
    QUIT 优雅的关闭,保持现有连接
    TERM 快速关闭
    --
    nginx:
    worker_processes 1;
    error_log
    pid
    events worker_connections
    tcp_nopush on;
    gzip on;
    ssl on;
    error_page 500 502 /50x.html
    location = /50x.html{}
    nginx ssl配置


    image.png

    mysqladmin :
    create db_name
    drop dbname
    extended-status
    flush-hosts
    flush-privileges
    flush-logs
    flush-tables
    password
    ping
    reload
    refresh
    shutdown
    start-slave
    stop-slave
    --
    mysqldump --all-databases
    --no-date
    --no-create-info
    --port --password
    备份所有数据库:
    mysqldump -u root -p xx --all-database>xx.sql
    mysqldump -uroot -p xx --database xx >xx.sql
    mysql -u -p<
    not null
    auto_increment
    primary key
    key
    default charset
    engine
    --
    alter table test rename ee;
    alter table test add date timestamp
    alter table test add index (date);
    alter table test modify id xx;
    alter table test add primary key ();
    alter table test drop column note;
    rename xx test1 to xxx;
    --
    mysql 从txt中导入数据
    load data infile '/tmp/txt' into table hr.employees;
    load data infile 'x' into table hr.employees fields terminated by ',';
    mysql安全


    image.png

    grant all on hr.* to 'xx'@'' identified by '"
    show grant for xx;
    --
    revoke all on hr.* from username1
    drop user xxx;
    --


    image.png

    --
    iptables
    input output forward prerouting postrouting
    iptables -t nat/filter -A :追加 D删除 -I 插入 -F 清空 -L 列出 -R 替换
    -p tcp/udp -s 来源 -d 目标 -i eth0 --sport --dport --src-range 地址范围 --sports --state
    ACCEPT DROP REJECT LOG DNAT SNAT REDIRECT


    image.png

    应用案例


    net.ipv4.ip_forward=1
    iptables -t nat -I POSTROUTING -s xx/24 -j SNAT --to-source xx


    image.png
    image.png

    防火墙备份与还原:
    iptables-save > xx
    iptables-restore<xx
    commit


    相关文章

      网友评论

        本文标题:(网络服务)Linux运维之道

        本文链接:https://www.haomeiwen.com/subject/mbkmjqtx.html