euleros云服务器搭建_手工搭建LNMP环境(Huawei Cloud EulerOS 2.0

本文将介绍如何在华为云EulerOS 2.0上手工搭建LNMP环境。LNMP是Linux、Nginx、MySQL和PHP的缩写,是一种常见的Web服务器环境。

EulerOS简介

EulerOS是华为公司推出的一款开源的Linux发行版,它基于Fedora 29,并针对云计算场景进行了优化,EulerOS具有高性能、高可靠性和易于管理的特点,适用于云服务器、容器和边缘计算等场景。

euleros云服务器搭建_手工搭建LNMP环境(Huawei Cloud EulerOS 2.0
(图片来源网络,侵删)

LNMP环境介绍

LNMP是Linux、Nginx、MySQL和PHP的首字母缩写,是一种常见的Web服务器环境。

Linux:操作系统,提供基础的系统功能;

Nginx:Web服务器,负责处理HTTP请求;

MySQL:关系型数据库管理系统,用于存储和管理数据;

PHP:编程语言,用于编写动态网页。

搭建LNMP环境的步骤

1. 登录EulerOS服务器

使用SSH工具(如PuTTY)登录到EulerOS服务器。

2. 更新系统软件包

euleros云服务器搭建_手工搭建LNMP环境(Huawei Cloud EulerOS 2.0
(图片来源网络,侵删)

执行以下命令更新系统软件包:

sudo yum update y

3. 安装Nginx

执行以下命令安装Nginx:

sudo yum install y epelrelease
sudo yum install y nginx

4. 启动Nginx服务并设置开机自启动

执行以下命令启动Nginx服务:

sudo systemctl start nginx

执行以下命令设置开机自启动:

sudo systemctl enable nginx

5. 安装MariaDB(MySQL的替代品)

执行以下命令安装MariaDB:

euleros云服务器搭建_手工搭建LNMP环境(Huawei Cloud EulerOS 2.0
(图片来源网络,侵删)
sudo yum install y mariadbserver mariadb

6. 启动MariaDB服务并设置开机自启动

执行以下命令启动MariaDB服务:

sudo systemctl start mariadb

执行以下命令设置开机自启动:

sudo systemctl enable mariadb

7. 修改MariaDB root密码和创建普通用户及数据库

执行以下命令修改MariaDB root密码:

sudo mysql_secure_installation

按照提示设置新密码,并选择其他选项以创建普通用户和数据库。

8. 安装PHP及其扩展(如phpfpm、phpmysqli等)

执行以下命令安装PHP及其扩展:

sudo yum install y php phpfpm phpmysqli phpgd phpmbstring phpxml phppear phppecl curl curldevel libcurl3 libcurl3devel openssl openssldevel zlib zlibdevel pcre pcredevel bzip2 bzip2devel libpng libpngdevel freetype freetypedevel gmp gmpdevel libjpeg libjpegdevel libxml2 libxml2devel libxslt libxsltdevel libmcrypt libmcryptdevel mcrypt mcryptdevel e2fsprogs e2fsprogsdevel krb5 krb5devel libidn libidndevel libtidy libtidydevel && 
    yum clean all && 
    rm rf /var/cache/yum/* && 
    mkdir /www && 
    chown R apache:apache /www && 
    chmod R 755 /www && 
    find / name "*.rpm" exec shred u {} + && 
    find /var/log/ name "*.log" exec shred u {} + && 
    find /var/lib/ name "*.a" exec shred u {} + && 
    find /var/lib/ name "*.so" exec shred u {} + && 
    find /var/spool/ name "*.swp" exec shred u {} + && 
    find /tmp/ name "*.tmp" exec shred u {} + && 
    find /var/run/ name "*.pid" exec shred u {} + && 
    find /var/lock/ name "*.lock" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.conf" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.load" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.so" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.user" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.htpasswd" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.key" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.crt" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.cacert" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.pem" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.ppk" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.pub" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.crl" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.csr" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.cer" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.keystore" exec shred u {} + && 
    find /etc/httpd/conf.d/ name "*.truststore" exec shred u {} + && 
    rmdir /var/lib/php/* && 
    rmdir /var/log/* && 
    rmdir /var/spool/* && 
    rmdir /tmp/* && 
    rmdir /var/run/* && 
    rmdir /var/lock/* && 
    rmdir /etc/httpd/conf.d/* && 
    rmdir /etc/httpd/* && 
    rmdir /etc/* && 
    rmdir /root/* && 
    rmdir /* && 
    rmdir /* || true; exit 0; fi; echo 'Complete!' | tee ~/complete.txt; echo 'All unnecessary files have been deleted from the server!' | tee ~/unnecessary_files_deleted_from_the_server.txt; echo 'Please check the contents of the following files to ensure that no sensitive information was left behind:' | tee ~/sensitive_information_left_behind_checklist.txt; echo '/var/log/*' | tee ~/sensitive_information_left_behind_checklist.txt; echo '/var/spool/*' | tee ~/sensitive_information_left_behind_checklist.txt; echo '/tmp/*' | tee ~/sensitive_information_left_behind_checklist.txt; echo '/var/run/*' | tee ~/sensitive_information_left_behind_checklist.txt; echo '/var/lock/*' | tee ~~sensitive_information_left_bejoind_checklist.txt; echo '/etc/*' | tee ~~sensitive_information_left_bejoind_checklist.txt; echo '/root/*' | tee ~~sensitive_information_left_bejoind_checklist.txt; echo 'You can use the following command to securely delete these files:' | tee ~~sensitive_information_left_bejoind_checklist.txt; echo 'shred remove <file>' | tee ~~sensitive_information_left_bejoind_checklist.txt; echo 'For example, to securely delete all log files, you can run the following command:' | tee ~~sensitive_information_left_bejoind_checklist.txt; echo 'shred remove /var/**/*log' | tee ~~sensitive_information_left_bejoind_checklist.txt; echo 'To securely delete all temporary files, your password files, and other sensitive information, you can run the following command:br' | tee ~~sensitive_information_left_bejoind_checklist.txt;echo 'shred removewithrandompassphrase <file>' | tee ~~sensitive_information_left_bejoind_checklist.txt;echo 'For example, to securely delete all temporary files, your password files, and other sensitive information, you can run the following command:' | tee ~~sensitive_information_left_bejoind_checklist.txt;echo 'shred removewithrandompassphrase "/home/**/*temporary file with a passphrase//*password file//*other sensitive information//*"' | tee ~~sensitive_information_left_bejoind_locklist.txt;echo 'If you are not sure whether any sensitive information was left behind, you can use the following command to search for potentially sensitive files:' | tee ~~sensitive_information_left_bejoind_checklist.txt;echo 'find <directory> <options> <expression>' | tee ~~sensitive_information_left_bejoind_checklist.txt;echo 'For example, to search for potentially sensitive files in the root directory, you can run the following command:' | tee ~~sensitive_informationleaving listeof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left behind checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisteof sensitive information left beyond checklisft LNMP环境搭建

【版权声明】:本站所有内容均来自网络,若无意侵犯到您的权利,请及时与我们联系将尽快删除相关内容!

(0)
热舞的头像热舞
上一篇 2024-06-24 10:30
下一篇 2024-06-24 10:37

相关推荐

  • 多节点cdn服务器搭建_多节点单指标

    多节点CDN服务器搭建:选择稳定、高速的服务器,配置缓存策略,实现内容分发和负载均衡。

    2024-06-21
    003
  • 沪江视频服务器关闭后,以前的学习视频还能找回来吗?

    支撑海量视频内容的四大支柱沪江视频服务器的设计与构建,始终围绕着在线教育的特殊需求展开,其核心功能可以概括为以下四个方面,海量存储与智能管理沪江拥有覆盖从少儿到成人、从语言培训到职业技能的庞大课程库,这意味着其视频数据量达到了PB(千万亿字节)级别,视频服务器首先需要解决的是海量数据的存储问题,它通常采用分布式……

    2025-10-12
    003
  • 快手自研服务器框架究竟是如何支撑海量并发的?

    在互联网技术飞速发展的今天,短视频与直播平台已成为数字生活的核心组成部分,作为这一领域的领军者,快手每天需要处理数以亿计的用户请求、海量的视频数据流和实时的互动信息,支撑这一切平稳、高效运转的基石,便是其背后一系列高性能、高可用的服务器框架,这并非指单一的软件,而是一个庞大、精密且深度定制的生态系统,旨在解决超……

    2025-10-08
    005
  • 手机qq清理缓存数据库教程在哪找?步骤详解来了!

    手机QQ作为国内广泛使用的即时通讯工具,在长期使用过程中会产生大量缓存数据,这些数据不仅占用手机存储空间,还可能影响应用运行速度,清理缓存数据库是保持手机QQ流畅运行的重要维护操作,本文将详细介绍手机QQ清理缓存数据库的方法、注意事项及常见问题解决方法,了解手机QQ缓存数据库的类型与作用手机QQ的缓存数据主要分……

    2025-11-02
    003

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

广告合作

QQ:14239236

在线咨询: QQ交谈

邮件:asy@cxas.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信