Linux常用命令

Linux常用命令,第1张

Linux常用命令 Linux常用命令 1、Cnetos7使用yum安装nginx
  1. 查看gcc版本

    gcc -v
    
  2. gcc安装命令

    yum -y install gcc
    
  3. 安装openssl

    # openssl是web安全通信的基石,没有openssl,可以说我们的信息都是在裸奔。。。。。。
    yum install -y openssl openssl-devel
    
  4. 安装nginx

    yum install -y nginx
    
  5. 启动并设置开机自启

    sudo systemctl start nginx
    sudo systemctl enable nginx
    
2、开放防火墙端口
  1. 开启防火墙

    systemctl start firewalld.service  
    
  2. 关闭防火墙

    systemctl stop firewalld.service
    
  3. 重启防火墙

    firewall-cmd --reload
    
  4. 开启端口

    firewall-cmd --zone=public --add-port=80/tcp --permanent
    #重新加载
    firewall-cmd --reload
    
  5. 查看已开放的端口

    firewall-cmd --list-ports
    
3、安装jdk
  1. 解压jdk安装包

    # 解压
    tar -zxvf jdk-8u271-linux-x64.tar.gz
    # 修改解压后的文件名称为jdk1.8
    mv xxx/ jdk1.8
    
  2. 配置环境变量

    vim /etc/profile
    # 在最后边加
    # JAVA环境变量
    JAVA_HOME=/xxx/xxx/xxx
    PATH=$JAVA_HOME/bin:$PATH
    CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export JAVA_HOME
    export PATH
    export CLASSPATH
    
  3. 测试是否安装成功

    [root@iZ2ze7jmwvt3iec793aif4Z java]# java -version
    java version "1.8.0_271"
    Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
    Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
    [root@iZ2ze7jmwvt3iec793aif4Z java]# javac
    Usage: javac  
    where possible options include:
      -g                         Generate all debugging info
      -g:none                    Generate no debugging info
      -g:{lines,vars,source}     Generate only some debugging info
      -nowarn                    Generate no warnings
      -verbose                   Output messages about what the compiler is doing
      -deprecation               Output source locations where deprecated APIs are used
      -classpath           Specify where to find user class files and annotation processors
      -cp                  Specify where to find user class files and annotation processors
      -sourcepath          Specify where to find input source files
      -bootclasspath       Override location of bootstrap class files
      -extdirs             Override location of installed extensions
      -endorseddirs        Override location of endorsed standards path
      -proc:{none,only}          Control whether annotation processing and/or compilation is done.
      -processor [,,...] Names of the annotation processors to run; bypasses default discovery process
      -processorpath       Specify where to find annotation processors
      -parameters                Generate metadata for reflection on method parameters
      -d              Specify where to place generated class files
      -s              Specify where to place generated source files
      -h              Specify where to place generated native header files
      -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files
      -encoding        Specify character encoding used by source files
      -source           Provide source compatibility with specified release
      -target           Generate class files for specific VM version
      -profile          Check that API used is available in the specified profile
      -version                   Version information
      -help                      Print a synopsis of standard options
      -Akey[=value]              Options to pass to annotation processors
      -X                         Print a synopsis of nonstandard options
      -J                   Pass  directly to the runtime system
      -Werror                    Terminate compilation if warnings occur
      @                Read options and filenames from file
    

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5137191.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-17
下一篇 2022-11-17

发表评论

登录后才能评论

评论列表(0条)

保存