Home Operation and Maintenance CentOS Does centos come with its own server?

Does centos come with its own server?

Jul 29, 2020 am 10:14 AM
centos server

centos不是自带服务器的,安装方法:首先在root操作下新增oper用户;然后将oper用户加入到sudoers中;接着切换到oper重新登录;最后创建常用目录即可。

Does centos come with its own server?

centos不是自带服务器的,安装方法:

1. 新增oper用户(root下操作)

1

2

3

useradd oper

# 修改密码:根据提示输入两次密码

passwd oper

Copy after login

将oper用户加入到sudoers中(可使用sudo命令)

1

2

3

vi /etc/sudoers

# 找到类似地方并加入

oper    ALL=(ALL)       ALL

Copy after login

切换到oper重新登录(重要)

创建常用目录

1

2

3

4

sudo mkdir /data

sudo chown -R oper data

cd /data

mkdir apps

Copy after login

2. 安装数据库mysql5.7

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

# Step0:安装所需的yum命令

sudo yum -y install yum-utils

# Step1: 检测系统是否自带安装mysql

sudo yum list installed | grep mysql

# Step2: 删除系统自带的mysql及其依赖命令:

sudo yum -y remove mysql-libs.x86_64

# Step3: 给CentOS添加rpm源,并且选择较新的源命令:

wget dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

sudo yum localinstall mysql-community-release-el7-5.noarch.rpm

sudo yum repolist all | grep mysql

sudo yum-config-manager --disable mysql55-community

sudo yum-config-manager --disable mysql56-community

sudo yum-config-manager --enable mysql57-community-dmr

sudo yum repolist enabled | grep mysql

# Step4:安装mysql 服务器命令:

sudo yum install mysql-community-server

# Step5: 启动mysql命令:

service mysqld start

# Step6: 查看mysql是否自启动,并且设置开启自启动命令:

chkconfig --list | grep mysqld

chkconfig mysqld on

# Step7: mysql安全设置命令:

# 获取root临时密码

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

# 修改root密码

mysql_secure_installation

# 根据提示修改root密码 ...

# 登录命令(根据提示输入root密码登录):

mysql -u root -p

# 创建数据库:

create database clouds_business;

创建用户:

create user yunch identified by 'Yunch!2#$5^';

# 授权数据库给用户

grant all on clouds_business.* to yunch;

Copy after login

3. 安装jdk1.8

1

2

3

4

5

6

7

8

9

10

11

12

# 1、在Oracle官方网址下载linux-64位的jdk的RPM包,如:jdk-8u121-linux-x64.rpm

# 2、使用SFTP工具将jar包上传至 /data/apps目录下

# 3、执行上传的rpm文件,如:rpm -ivh jdk-8u***-linux-x64.rpm

# 4、配置环境变量(下面代码中版本根据实际情况调整)

vi /etc/profile

JAVA_HOME=/usr/java/jdk1.8.0_191-amd64

JRE_HOME=/usr/java/jdk1.8.0_191-amd64/jre

PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib

export JAVA_HOME JRE_HOME PATH CLASSPATH

# 退出vi,使环境变量生效

source /etc/profile

Copy after login

4. 安装zookeeper

1

2

3

4

5

6

7

8

9

10

11

12

13

# 下载zookeeper安装包(建议3.4及以下版本)

wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz

# 解压

tar -xvf zookeeper-3.4.14.tar.gz

rm -f *.gz

cd zookeeper-3.4.14

cd conf

# 将sample配置文件重命名成正式文件

mv zoo_sample.cfg zoo.cfg

# 启动zookeeper

../bin/zkServer.sh start

# 执行lsof命令观察

lsof -i 2181

Copy after login

5. 安装redis

1

2

3

4

5

6

7

8

9

10

wget http://download.redis.io/redis-stable.tar.gz

tar -xvf ...

mv redis-stable redis

cd redis

vi redis.conf

# 修改密码和端口号

sudo make && sudo make install

# 运行redis

nohup redis-server redis.conf &

# 日志在 nohup.out里面

Copy after login

6. 安装nginx

1

2

3

4

5

6

7

sudo yum -y install nginx

# 修改权限

sudo chown -R oper /etc/nginx

# 修改/etc/nginx/nginx.conf配置

#在 conf.d里面增加.conf文件

# 重启命令

sudo nginx -s reload

Copy after login

相关教程推荐:centos教程

The above is the detailed content of Does centos come with its own server?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the backup methods for GitLab on CentOS What are the backup methods for GitLab on CentOS Apr 14, 2025 pm 05:33 PM

Backup and Recovery Policy of GitLab under CentOS System In order to ensure data security and recoverability, GitLab on CentOS provides a variety of backup methods. This article will introduce several common backup methods, configuration parameters and recovery processes in detail to help you establish a complete GitLab backup and recovery strategy. 1. Manual backup Use the gitlab-rakegitlab:backup:create command to execute manual backup. This command backs up key information such as GitLab repository, database, users, user groups, keys, and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify /etc/gitlab

How to optimize CentOS HDFS configuration How to optimize CentOS HDFS configuration Apr 14, 2025 pm 07:15 PM

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

Centos stops maintenance 2024 Centos stops maintenance 2024 Apr 14, 2025 pm 08:39 PM

CentOS will be shut down in 2024 because its upstream distribution, RHEL 8, has been shut down. This shutdown will affect the CentOS 8 system, preventing it from continuing to receive updates. Users should plan for migration, and recommended options include CentOS Stream, AlmaLinux, and Rocky Linux to keep the system safe and stable.

How to check CentOS HDFS configuration How to check CentOS HDFS configuration Apr 14, 2025 pm 07:21 PM

Complete Guide to Checking HDFS Configuration in CentOS Systems This article will guide you how to effectively check the configuration and running status of HDFS on CentOS systems. The following steps will help you fully understand the setup and operation of HDFS. Verify Hadoop environment variable: First, make sure the Hadoop environment variable is set correctly. In the terminal, execute the following command to verify that Hadoop is installed and configured correctly: hadoopversion Check HDFS configuration file: The core configuration file of HDFS is located in the /etc/hadoop/conf/ directory, where core-site.xml and hdfs-site.xml are crucial. use

Centos configuration IP address Centos configuration IP address Apr 14, 2025 pm 09:06 PM

Steps to configure IP address in CentOS: View the current network configuration: ip addr Edit the network configuration file: sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 Change IP address: Edit IPADDR= Line changes the subnet mask and gateway (optional): Edit NETMASK= and GATEWAY= Lines Restart the network service: sudo systemctl restart network verification IP address: ip addr

Centos shutdown command line Centos shutdown command line Apr 14, 2025 pm 09:12 PM

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

What is the CentOS MongoDB backup strategy? What is the CentOS MongoDB backup strategy? Apr 14, 2025 pm 04:51 PM

Detailed explanation of MongoDB efficient backup strategy under CentOS system This article will introduce in detail the various strategies for implementing MongoDB backup on CentOS system to ensure data security and business continuity. We will cover manual backups, timed backups, automated script backups, and backup methods in Docker container environments, and provide best practices for backup file management. Manual backup: Use the mongodump command to perform manual full backup, for example: mongodump-hlocalhost:27017-u username-p password-d database name-o/backup directory This command will export the data and metadata of the specified database to the specified backup directory.

Centos install mysql Centos install mysql Apr 14, 2025 pm 08:09 PM

Installing MySQL on CentOS involves the following steps: Adding the appropriate MySQL yum source. Execute the yum install mysql-server command to install the MySQL server. Use the mysql_secure_installation command to make security settings, such as setting the root user password. Customize the MySQL configuration file as needed. Tune MySQL parameters and optimize databases for performance.

See all articles