Linux - 安装

Linux - 安装注意事项:

    修改网卡名: 在安装界面设置
 注意不是换行!是空格!
net.ifnames=0 biosdevname=0

    进行网卡配置:

    修改localhost,自动链接网络

     关闭SELinux:

修改配置文件:需要重启服务器
    sed -i 's$=enforcing$=disbale$g' /etc/selinux/config
修改临时关闭:
    setenforce
查看状态:
    getenforce

    修改网卡配置

 

Linux - 常用命令

    cat:
cat -n cs.txt       # 控制台显示行号

 


sed:
只查看ett.txt文件(共100行)内第20到第30行的内容
     seq 40  >   /oldboy/ett.txt
     cat /oldboy/ett.txt 
 
[root@oldboyedu-s8 oldboy]# #sed默认输出文件的每一行 
[root@oldboyedu-s8 oldboy]# sed -n  '20p'   ett.txt 
20
[root@oldboyedu-s8 oldboy]# #-n 取消默认输出
[root@oldboyedu-s8 oldboy]# 取20到 30行
[root@oldboyedu-s8 oldboy]# sed -n  '20,30p'   ett.txt 
    tar
创建压缩包:
    tar z        # 通过gzip 软件进行压缩
    tar c        # create 归档
    tar f        # file 指定压缩包
查看压缩包内容:
    tar tf       # 查看压缩包内容
解压缩:
    tar zxvf    # 解压缩 v:显示解压过程


 Linux - RPM包

"""
安装:
    rpm -ivh bask-completion.rpm


""" 

Linux - 防火墙

    在CentOS7开始,默认是没有iptables的,而是使用了firewall防火墙.
[root@ClementLinux ~]# systemctl stop firewalld.service   # 停止服务
[root@ClementLinux ~]# systemctl status firewalld.service  # 查看服务状态
[root@ClementLinux ~]# systemctl disable firewalld.service  # 禁止开机自启
[root@ClementLinux ~]# systemctl is-active firewalld.service # 是否处于活动状态
[root@ClementLinux ~]# systemctl is-enabled firewalld.service # 是否开机自启

 Linux - 定时任务

-e:编辑该用户的计时器设置;
-l:列出该用户的计时器设置;
-r:删除该用户的计时器设置;
-u<用户名称>:指定要设定计时器的用户名称。

crontab文件:指定包含待执行任务的crontab文件。
文件路径:/etc/crontab

符号:
* : 每; 分/时/日/月/周
/ : 间隔; 分/时/日/月/周

Linux - 时间同步

     pass

Linux - 那些有意思的RPM

   yum install sl cowsay -y 
Linux - Nginx安装
    编译三部曲:
./configure \
--prefix=/application/nginx-1.12.2 \
--with-http_stub_status_module  \
--with-http_ssl_module

    会出先错误

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
提示:缺少PCRE library

     解决办法:

yum install -y pcre-devel

    继续./configure

    提示缺少OpenSSL

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.

    解决办法:

yum install -y openssl-devel

    提示成功!

Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + using system zlib library

  nginx path prefix: "/application/nginx-1.12.2"
  nginx binary file: "/application/nginx-1.12.2/sbin/nginx"
  nginx modules path: "/application/nginx-1.12.2/modules"
  nginx configuration prefix: "/application/nginx-1.12.2/conf"
  nginx configuration file: "/application/nginx-1.12.2/conf/nginx.conf"
  nginx pid file: "/application/nginx-1.12.2/logs/nginx.pid"
  nginx error log file: "/application/nginx-1.12.2/logs/error.log"
  nginx http access log file: "/application/nginx-1.12.2/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

     make && make install  安装完成!

Linux - Nginx使用

    启动Nginx

#检查语法 
/application/nginx-1.12.2/sbin/nginx  -t

#启动nginx
/application/nginx-1.12.2/sbin/nginx  

 Linux - Nginx配置文件

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;                      # 媒体类型
    default_type  application/octet-stream;        # 开启高效的传输模式
    sendfile        on;
    keepalive_timeout  65;                         # 链接超时时间
    server {                                       # 虚拟主机
        listen       80;                           # 监听的端口
        server_name  localhost;                    # 域名
        location / {                               #
            root   html;                           # 站点的根目录
            index  index.html index.htm;           # 首页文件
        }
        error_page   500 502 503 504  /50x.html;   # 错误状态码
        location = /50x.html {                     # 错误首页
            root   html;
        }
    }
}

 

 

 

 

posted @ 2018-05-04 19:22  焦国峰的随笔日记  阅读(115)  评论(0)    收藏  举报
// ############################### // ##############################