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
动态cdn原理图_内容分发网络 CDN
下一篇 2024-06-24 10:37

相关推荐

  • 为什么hl3150cdn共享打印机没有手?

    HL3150CDN共享打印机没有手动进纸功能。

    2024-10-05
    0020
  • 服务器 d盘无法显示

    服务器 D 盘无法显示,可能是磁盘分区损坏、文件系统错误、权限设置问题或硬盘故障等导致。可尝试检查分区、修复文件系统、调整权限,或更换硬盘来排查解决。

    2025-04-06
    0025
  • 如何重置京瓷P8060CDN打印机的管理员用户密码?

    京瓷p8060cdn打印机的管理员用户密码通常是在设备初次设置时由用户自定义设置的。如果您忘记了密码,您可以尝试使用默认的管理员用户名和密码组合,或者查阅设备的用户手册以获取更多信息。如果这些方法都不起作用,您可能需要联系京瓷的客服支持以获取进一步的帮助。

    2024-10-05
    0071
  • 数据库损坏了,如何利用日志文件恢复数据?

    数据库日志文件是记录所有事务和数据库修改的序列文件,它构成了数据库灾难恢复的基石,当发生数据误删、硬件故障或数据损坏时,通过日志文件可以将数据库恢复到故障前的特定时间点,甚至是某个特定事务之前的状态,从而最大限度地减少数据丢失,理解并掌握日志恢复技术,对于每一位数据库管理员而言都至关重要,核心原理:日志文件如何……

    2025-10-08
    0049

发表回复

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

广告合作

QQ:14239236

在线咨询: QQ交谈

邮件:asy@cxas.com

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

关注微信