search
HomeOperation and MaintenanceCentOSDoes centos come with its own server?

Does centos come with its own server?

Jul 29, 2020 am 10:14 AM
centosserver

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

Does centos come with its own server?

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

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

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

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

vi /etc/sudoers
# 找到类似地方并加入
oper    ALL=(ALL)       ALL

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

创建常用目录

sudo mkdir /data
sudo chown -R oper data
cd /data
mkdir apps

2. 安装数据库mysql5.7

# 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;

3. 安装jdk1.8

# 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

4. 安装zookeeper

# 下载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

5. 安装redis

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里面

6. 安装nginx

sudo yum -y install nginx
# 修改权限 
sudo chown -R oper /etc/nginx
# 修改/etc/nginx/nginx.conf配置
#在 conf.d里面增加.conf文件
# 重启命令
sudo nginx -s reload

相关教程推荐: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
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
CentOS's Purpose: Building Robust and Reliable ServersCentOS's Purpose: Building Robust and Reliable ServersMay 11, 2025 am 12:18 AM

CentOS is suitable for building powerful and reliable servers. Its advantages include: 1. Stability and reliability, support cycle up to 10 years; 2. Security, built-in SELinux and regular security patches; 3. Compatibility and ecosystem, highly compatible with RHEL, with a rich software warehouse; 4. Performance optimization, suitable for various hardware platforms and providing kernel tuning.

The Future of CentOS: Transitioning to New DistributionsThe Future of CentOS: Transitioning to New DistributionsMay 10, 2025 am 12:19 AM

CentOS will continue to evolve in the future, and users should choose alternative distributions. 1) Evaluate the requirements, choose such as RockyLinux or AlmaLinux, and focus on stability and support. 2) Develop a migration plan, use tools such as CentOS2Rocky, and pay attention to testing and verification. 3) Plan early, maintain contact with the open source community, and ensure a smooth transition.

CentOS: The Choice for Server EnvironmentsCentOS: The Choice for Server EnvironmentsMay 09, 2025 am 12:21 AM

CentOS is widely selected as a server operating system because it is stable, secure and free. 1.CentOS is based on RHEL, providing enterprise-level stability and a life cycle of up to 10 years. 2. It has rich software packages and strong community support. 3. Simple installation, use yum management software package, and intuitive configuration. 4. Improve server management efficiency through command line tools, regular backups and log management. 5. Optimize server performance by adjusting kernel and network parameters.

The Future of CentOS: What's Next?The Future of CentOS: What's Next?May 08, 2025 am 12:01 AM

CentOS will continue to develop through CentOSStream in the future. CentOSStream is no longer a direct clone of RHEL, but is part of RHEL development. Users can experience the new RHEL functions in advance and participate in development.

CentOS: From Development to Production EnvironmentsCentOS: From Development to Production EnvironmentsMay 07, 2025 am 12:08 AM

The transition from development to production in CentOS can be achieved through the following steps: 1. Ensure the consistent development and production environment, use the YUM package management system; 2. Use Git for version control; 3. Use Ansible and other tools to automatically deploy; 4. Use Docker for environmental isolation. Through these methods, CentOS provides powerful support from development to production, ensuring the stable operation of applications in different environments.

CentOS Stream: The Successor and its ImplicationsCentOS Stream: The Successor and its ImplicationsMay 06, 2025 am 12:02 AM

CentOSStream is a cutting-edge version of RHEL, providing an open platform for users to experience the new RHEL functions in advance. 1.CentOSStream is the upstream development and testing environment of RHEL, connecting RHEL and Fedora. 2. Through rolling releases, users can continuously receive updates, but they need to pay attention to stability. 3. The basic usage is similar to traditional CentOS and needs to be updated frequently; advanced usage can be used to develop new functions. 4. Frequently asked questions include package compatibility and configuration file changes, and requires debugging using dnf and diff. 5. Performance optimization suggestions include regular cleaning of the system, optimizing update policies and monitoring system performance.

CentOS: Examining the Reasons Behind the End of LifeCentOS: Examining the Reasons Behind the End of LifeMay 04, 2025 am 12:12 AM

The reason for the end of CentOS is RedHat's business strategy adjustment, community-business balance and market competition. Specifically manifested as: 1. RedHat accelerates the RHEL development cycle through CentOSStream and attracts more users to participate in the RHEL ecosystem. 2. RedHat needs to find a balance between supporting open source communities and promoting commercial products, and CentOSStream can better convert community contributions into RHEL improvements. 3. Faced with fierce competition in the Linux market, RedHat needs new strategies to maintain its leading position in the enterprise-level market.

The Reasons for CentOS's Shutdown: A Detailed AnalysisThe Reasons for CentOS's Shutdown: A Detailed AnalysisMay 03, 2025 am 12:05 AM

RedHat shut down CentOS8.x and launches CentOSStream because it hopes to provide a platform closer to the RHEL development cycle through the latter. 1. CentOSStream, as the upstream development platform of RHEL, adopts a rolling release mode. 2. This transformation aims to enable the community to get exposure to new RHEL features earlier and provide feedback to accelerate the RHEL development cycle. 3. Users need to adapt to changing systems and reevaluate system requirements and migration strategies.

See all articles

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 Article

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor