Centos 配置服务器

(配置服务器 除了Git Bash Here 还可以安装Xshell 网址:https://xshell.en.softonic.com/ 

 Wincp 网址:https://winscp.net/eng/docs/lang:chs)

一.Nginx 安装

1.yum install -y gcc-c++pcre pcre-develzlib zlib-developenssl openssl-devel

2.wget http://nginx.org/download/nginx-1.18.0.tar.gz

3.tar zxvf nginx-1.18.0.tar.gz

4.cd nginx-1.18.0

5. ./configure --prefix=/usr/local/nginx

6. make&&make install

7.启动

cd /usr/local/nginx/sbin

./nginx

8.查看启动状态

  • 通过端口查询: lsof -i:80 #nginx默认是80端口

    • 通过进程查询: ps -ef | grep nginx
    • 访问网页查询 curl 127.0.0.1

9.配置文件详情

进入配置文件

cd /usr/local/nginx/conf/

vi nginx.conf

在 nginx.conf 的注释符号为: #

... #全局块 events { #events块 ... } http #http块 { ... #http全局块 server #server块 { ... #server全局块 location [PATTERN] #location块 { ... } location [PATTERN] { ... } } server { ... } ... #http全局块 }
  1. #修改完成后,重新加载配置文件
  2.  cd /usr/local/nginx/sbin/

./nginx -s reload

root指路径
server_name 域名
  
 二.node安装
1.运行Node.js安装程序脚本

下载并执行脚本:

$ sudo yum -y install curl
$ curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -

2.在CentOS 8/7、RHEL 8/7系统上安装Node.js 14版本及以上版本

 

RHEL 8上的安装与基于RHEL 7的Linux发行版上的安装相同,唯一的区别是,Node.js AppStream存储库已在RHEL/CentOS 8系统上被安装脚本禁用,如果您要安装AppStream版本的Node.js,则需要启用它:

 
sudo yum install -y nodejs
3.验证是否安装成功

验证node:$ node -v

  返回信息:验证 npm $ npm -v 

4.安装 Yarn 程序包管理器

$curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo<br>// 安装包

$sudo yum install yarn

5.如果需要为Node.js构建本机加载项,请考虑安装开发工具,运行如下命令:

$ sudo yum install gcc-c++ make 
 
三.Mysql
首先查看:rpm -qa|grep -i mysql 

 删除操作(一个一个删除):yum remove '软件名'

( 2 )下载安装

如果无法执行wget命令,则先安装wget:

yum -y install wget

下载MySql:

wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

安装MySql:

yum localinstall mysql57-community-release-el7-11.noarch.rpm

查看是否安装成功:

yum repolist enabled | grep "mysql.*-community.*" 

(3) 设置服务

安装mysql:

yum install mysql-community-server

启动mysql:

systemctl start mysqld

关闭mysql:

systemctl stop mysqld

查看是否启动:

systemctl status mysqld

重启mysql:

systemctl restart mysqld

(4)开机自启

设置开机自启:

systemctl enable mysqld

继续执行:

systemctl daemon-reload

(5)修改密码

查看默认密码:

grep 'temporary password' /var/log/mysqld.log

连接数据库:

mysql -u root -p 密码

Mysql密码有安全策略,在/etc/my.cnf中加入 validate_password = off 可以设置关闭密码检验

重启mysql:

systemctl restart mysqld

进入mysql之后,修改密码:

alter user 'root'@'localhost' identified by '新密码';

(6)远程连接

远程连接设置:

grant all privileges on *.* to root@'%'identified by '数据库密码';

连接成功

 
 
 
 

Centos 配置服务器的更多相关文章

  1. 【转】CentOS 6 服务器安全配置指南

    原文连接: CentOS 6 服务器安全配置指南(通用) Linux 是一个开放式系统,可以在网络上找到许多现成的程序和工具,这既方便了用户,也方便了黑客,因为他们也能很容易地找到程序和工具来潜入 L ...

  2. [转帖]CentOS 6 服务器安全配置指南(通用)

    CentOS 6 服务器安全配置指南(通用) http://seanlook.com/2014/09/07/linux-security-general-settings/  发表于 2014-09- ...

  3. CENTOS 配置好SVN服务环境后,其他服务器无法访问 Error: Can't connect to host '192.168.1.103': 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

    CENTOS 配置好SVN服务环境后,其他服务器无法访问   根据 下面的步骤配置好服务后,使用本机可以正常 连接到 SVN 服务, 但是使用局域网的其他服务器访问时出现下面的错误, Error: C ...

  4. Centos配置多个tomcat服务器,并用nginx实现负载均衡

    centos配置tomcat请参见上一篇博文 :http://www.cnblogs.com/nanyangzp/p/4897655.html 一:多tomcat利用不同端口开启服务器 多个tomca ...

  5. CentOS Linux服务器安全设置

    转自:http://www.osyunwei.com/archives/754.html 引言: 我们必须明白:最小的权限+最少的服务=最大的安全 所以,无论是配置任何服务器,我们都必须把不用的服务关 ...

  6. Centos vsftpd服务器搭建

    Centos vsftpd服务器搭建 时间:2016-07-18 1.最为简单的vsftpd服务器搭建 1.安装vsftpd 1.yum 安装 yum install vsftpd 2.rpm文件安装 ...

  7. 配置服务器有错/usr/libexec/gconf-sanity-check-2的退出状态为256

    问题描述: CentOS启动的时候报如下错误:“配置服务器有错/usr/libexec/gconf-sanity-check-2的退出状态为256” 问题原因: 在装hadoop的时候误删了/tmp文 ...

  8. CentOS配置SSH免密码登录后,仍提示输入密码

    CentOS配置SSH无密码登录需要3步: 生成公钥和私钥 导入公钥到认证文件,更改权限 测试 1.生成公钥和私钥 ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 默 ...

  9. CentOS 配置防火墙操作实例(启、停、开、闭端口)CentOS Linux-FTP/对外开放端口(接口)TomCat相关

    链接地址:http://blog.csdn.net/jemlee2002/article/details/7042991 CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作 ...

随机推荐

  1. SpringCloud升级之路2020.0.x版-44.避免链路信息丢失做的设计(2)

    本系列代码地址:https://github.com/JoJoTec/spring-cloud-parent 我们在这一节我们将继续讲解避免链路信息丢失做的设计,主要针对获取到现有 Span 之后,如 ...

  2. Codeforces 685C - Optimal Point(分类讨论+乱搞)

    Codeforces 题面传送门 & 洛谷题面传送门 分类讨论神题. 首先看到最大值最小,一眼二分答案,于是问题转化为判定性问题,即是否 \(\exists x_0,y_0,z_0\) 满足 ...

  3. dlang 读取gz压缩文件

    没找到打开gz压缩文件的标准库,暂时调用系统命令打开gz压缩文件(参考:https://dlang.org/phobos/std_process.html#.Redirect.stdoutToStde ...

  4. 基于MS SQL Server的数据库学习安排

    序号 分类 学习内容 目标/要求 方式 学时 考核 参考资料 1 基础知识 数据库理论 理解数据库基本理论 面授 1 能阐述元素.数据记录.数据表.数据库的基本概念T-SQL语法要求 https:// ...

  5. Linux—yum安装python-pip

    centos下安装pip时失败: [root@wfm ~]# yum -y install pipLoaded plugins: fastestmirror, refresh-packagekit, ...

  6. 变量、内存区域、MDK文件(map、htm)

    变量分为:局部变量和全局变量 局部变量:函数体内部定义的变量,作用域为函数内部,static声明(静态局部变量)该变量则函数调用结束后不消失而保留值,分配的存储空间不释放. 全局变量:函数体外部定义的 ...

  7. 『与善仁』Appium基础 — 16、APPium基础操作API

    目录 1.前置代码 2.安装和卸载APP 3.判断APP是否已安装 4.关闭APP软件和关闭驱动对象 5.发送文件到手机和获取手机中的文件 6.获取当前屏幕内元素结构(重点) 7.脚本内启动其他APP ...

  8. A Child's History of England.11

    CHAPTER 4 ENGLAND UNDER ATHELSTAN AND THE SIX BOY-KINGS Athelstan, the son of Edward the Elder, succ ...

  9. day17 常用模块的应用

    day17 常用模块的应用 老师博客园地址:https://www.cnblogs.com/linhaifeng/articles/6384466.html#_label11 一.time与datet ...

  10. Mockito 入门详解

    一个测试方法主要包括三部分: setup 执行操作 验证结果 public class CalculatorTest { Calculator mCalculator; @Before // setu ...