Linux(LAMP)

赛题拓扑:

题目:

  • 安装WEB服务。

  • 服务以用户webuser系统用户运行。

  • 限制WEB服务只能使用系统500M物理内存。

  • 全站点启用TLS访问,使用本机上的“CSK Global Root CA”颁发机构颁发,网站证书信息如下:

    C = CN

    ST = China

    L = BeiJing

    O = skills

    OU = Operations Departments

    CN = *.chinaskills.com

  • 客户端访问https时应无浏览器(含终端)安全警告信息。

  • 当用户使用http访问时自动跳转到https安全连接。

  • 搭建www.chinaskills.cn站点。

  • 网页文件放在StorgeSrv服务器上。

  • 在StorageSrv上安装MriaDB,在本机上安装PHP,发布WordPress网站。

  • MariaDB数据库管理员信息:User: root/ Password: 000000。

[root@appsrv ~]# yum install httpd mod_ssl php php-mysql -y 
[root@appsrv ~]# useradd webuser
[root@appsrv ~]# vim /etc/passwdwebuser:x:666:1001::/home/webuser:/bin/bash    #uid改为1000以下
[root@appsrv ~]# vim /etc/httpd/conf/httpd.conf  #修改66、67行User webuserGroup webuser
[root@appsrv ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@appsrv ~]# vim /etc/systemd/system/multi-user.target.wants/httpd.service
[server]
memorylimit=500M
[root@appsrv ~]# systemctl daemon-reload
[root@appsrv ~]# systemctl restart httpd[root@appsrv ~]# mkdir /webdata
[root@appsrv ~]# vim /etc/fstab192.168.100.200:/webdata /webdata nfs defaults 0 0
[root@appsrv ~]# mount -a
[root@appsrv ~]# df -Th | grep /webdata
192.168.100.200:/webdata nfs4       20G  185M   19G    1% /webdata先配置好CA证书颁发机构
[root@appsrv csk-rootca]# openssl genrsa -out httpd.key 2048
[root@appsrv csk-rootca]# openssl req -new -key httpd.key -out httpd.csr 
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2letter code)[XX]:CN
State or Province Name (full name)[]:China
Locality Name (eg, city)[Default City]:BeiJing                           
Organization Name (eg, company)[Default Company Ltd]:skills
Organizational Unit Name (eg, section)[]:Operations Departments
Common Name (eg, your name or your server's hostname) []:*.chinaskills.cn
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@appsrv csk-rootca]# openssl x509 -req -in http.csr  -CA /csk-rootca/csk-ca.pem -CAkey /csk-rootca/private/cakey.pem -CAcreateserial -out http.crt
Signature ok
subject=/C=CN/ST=China/L=BeiJing/O=skills/OU=Operations Departments/CN=*.chinaskills.cn
Getting CA Private Key
[root@appsrv csk-rootca]# scp http.* root@192.168.100.200:/root
The authenticity of host '192.168.100.200 (192.168.100.200)' can't be established.
ECDSA key fingerprint is SHA256:pWgL9ec8DMjRGJO79thzFylRMNnAsLGLY8TUc+RO8Ms.
ECDSA key fingerprint is MD5:44:5c:51:9a:2c:1b:ff:7c:0c:13:09:d3:77:a9:8e:cd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.200' (ECDSA) to the list of known hosts.
root@192.168.100.200's password: 
http.crt                                        100% 1261     1.6MB/s   00:00    
http.csr                                        100% 1033     2.2MB/s   00:00    
http.key                                        100% 1675     2.9MB/s   00:00    
[root@appsrv csk-rootca]# scp http.* root@192.168.100.254:/root
The authenticity of host '192.168.100.254 (192.168.100.254)' can't be established.
ECDSA key fingerprint is SHA256:fbInU3tFkaQUhhZNSIsHGZOPMG1T1f3J55qqtzfdeAU.
ECDSA key fingerprint is MD5:a4:fa:8d:39:a3:9c:c0:81:1b:f0:6b:5b:f1:31:9e:aa.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.254' (ECDSA) to the list of known hosts.
root@192.168.100.254's password: 
http.crt                                         100% 1261     2.2MB/s   00:00    
http.csr                                         100% 1033     2.6MB/s   00:00    
http.key                                         100% 1675     3.4MB/s   00:00    
[root@appsrv csk-rootca]# cd
[root@appsrv ~]# vim /etc/httpd/conf.d/web.conf
<VirtualHost *:80>
redirect permanent / https://www.chinaskills.cn/
</VirtualHost>
<virtualHost www.chinaskills.cn:443>
Documentroot "/webdata/wordpress"            网站根目录
servername www.chinaskills.cn                网站的域名
sslengine on                                 开启SSL
sslcertificatefile /csk-rootca/httpd.crt     网站证书的路径
sslcertificatekeyfile /csk-rootca/httpd.key  网站密钥的路径
<Directory /webdata >                        配置根目录的权限
require all granted
</Directory>
</VirtualHost>
上传wordpress安装包
[root@appsrv ~]# unzip wordpress-4.9.4-zh_CN.zip 
[root@appsrv ~]# ls /webdata/
wordpress  wordpress-4.9.4-zh_CN.zip 
部署数据库:
[root@storagesrv ~]# systemctl start mariadb
[root@storagesrv ~]# mysql_secure_installation 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.Enter current password for root (enter for none): 
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.Set root password? [Y/n] y                           
New password: 000000
Re-enter new password: 000000
Password updated successfully!
Reloading privilege tables..... Success!By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.Remove anonymous users? [Y/n] ... Success!Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] ... Success!By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.Remove test database and access to it? [Y/n] - Dropping test database...... Success!- Removing privileges on test database...... Success!Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.Reload privilege tables now? [Y/n] ... Success!Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB![root@storagesrv ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 5.5.68-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' identified by 
'000000'with grant option;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> 
[root@storagesrv ~]#
[root@appsrv ~]# systemctl restart httpd[root@insidecli ~]# cp csk-ca.pem /etc/pki/ca-trust/source/anchors/csk-ca.crt
[root@insidecli ~]# update-ca-trust 
[root@insidecli ~]# curl -I http://www.chinaskills.cn
[root@insidecli ~]# curl -I http://www.chinaskills.cninsidecli浏览器访问https://www.chinaskills.cn发布网站

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/5815.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

vue3+elementPlus之后台管理系统(从0到1)(day3-管理员管理)

管理员管理 搭建管理员页面 在views中创建一个manager文件夹&#xff0c;并创建ManagerIndexView.vue、MangagerListView.vue、UserList.vue <!-- src/views/manager/ManagerIndexView.vue --> <template><!-- 作为一个占位符&#xff0c;用于渲染与当前 URL…

CSRF漏洞学习总结

一、什么是CSRF漏洞&#xff1f; CSRF&#xff08;Cross-Site Request Forgery&#xff0c;跨站请求伪造&#xff09;是一种网络攻击&#xff0c;它利用受害者在受信任网站上的已认证会话&#xff0c;来执行非预期的行动。这种攻击的核心在于&#xff0c;攻击者能够诱使受害者…

前端Vue2项目使用md编辑器

项目中有一个需求&#xff0c;要在前端给用户展示内容&#xff0c;内容有 AI 生成的&#xff0c;返回来的是 md 格式&#xff0c;所以需要给用户展示 md 格式&#xff0c;并且管理端也可以编辑这个 md 格式的文档。 使用组件库 v-md-editor。 https://code-farmer-i.github.i…

【JDBC】数据库连接的艺术:深入解析数据库连接池、Apache-DBUtils与BasicDAO

文章目录 前言&#x1f30d; 一.连接池❄️1. 传统获取Conntion问题分析❄️2. 数据库连接池❄️3.连接池之C3P0技术&#x1f341;3.1关键特性&#x1f341;3.2配置选项&#x1f341;3.3使用示例 ❄️4. 连接池之Druid技术&#x1f341; 4.1主要特性&#x1f341; 4.2 配置选项…

Codeforces Round 1000 (Div. 2)(前三题)

A. Minimal Coprime 翻译&#xff1a; 如果 l 和 r 互为同素数&#xff0c;则正整数 [l,r] 的一段称为同素段。 如果一个共素数段 [l,r] 不包含任何不等于它本身的共素数段&#xff0c;那么这个共素数段 [l,r] 就叫做最小共素数段。为了更好地理解这句话&#xff0c;可以参考注…

数据库事务详解

事务-1-数据库事务 今天聊一聊数据库的事务&#xff0c;这里以MySQL为例子。 在MySQL中&#xff0c;事务&#xff08;Transaction&#xff09;是一组SQL操作的集合&#xff0c;这些操作要么全部成功执行&#xff0c;要么全部失败回滚&#xff0c;确保数据的一致性和完整性。事…

攻防世界GFSJ1012 pwnstack

题目编号&#xff1a;GFSJ1012 附件下载后是一个c和库文件&#xff1a; 获取在线场景是 1. 获取伪代码 Exeinfo打开pwn2&#xff0c;分析如图&#xff0c;64位。 IDA Pro(64-bit)打开pwn2&#xff0c;生成伪代码 2. 分析代码漏洞 /* This file was generated by the Hex-Rays …

最小距离和与带权最小距离和

1. 等权中位数 背景&#xff1a; 给定一系列整数&#xff0c;求一个整数x使得x在数轴上与所有整数在数轴上的距离和最小。 结论&#xff1a; 这一系列的整数按顺序排好后的中位数(偶数个整数的中位数取 n 2 或 n 2 1 \frac{n}{2}或\frac{n}{2}1 2n​或2n​1都可)一定是所求点…

【LeetCode 刷题】栈与队列-队列的应用

此博客为《代码随想录》栈与队列章节的学习笔记&#xff0c;主要内容为队列的应用相关的题目解析。 文章目录 239. 滑动窗口最大值347. 前 K 个高频元素 239. 滑动窗口最大值 题目链接 class Solution:def maxSlidingWindow(self, nums: List[int], k: int) -> List[int]…

【优选算法】5----有效三角形个数

又是一篇算法题&#xff0c;今天早上刚做的热乎的~ 其实我是想写博客但不知道写些什么&#xff08;就水一下啦&#xff09; -------------------------------------begin----------------------------------------- 题目解析: 这道题的题目算是最近几道算法题里面题目最短的&a…

Golang:使用DuckDB查询Parquet文件数据

本文介绍DuckDB查询Parquet文件的典型应用场景&#xff0c;掌握DuckDB会让你的产品分析能力更强&#xff0c;相反系统运营成本相对较低。为了示例完整&#xff0c;我也提供了如何使用Python导出MongoDB数据。 Apache Parquet文件格式在存储和传输大型数据集方面变得非常流行。最…

HTTP 配置与应用(局域网)

想做一个自己学习的有关的csdn账号&#xff0c;努力奋斗......会更新我计算机网络实验课程的所有内容&#xff0c;还有其他的学习知识^_^&#xff0c;为自己巩固一下所学知识&#xff0c;下次更新HTTP 配置与应用&#xff08;不同网段&#xff09;。 我是一个萌新小白&#xf…

免费!无水印下载!

软件介绍 这个工具可方便啦&#xff0c;不管是小红书上那些时尚的美照&#xff0c;还是特别搞笑的视频&#xff0c;只要你想下载&#xff0c;轻轻一点就能保存。真的是实现了一键下载&#xff0c;完全没有复杂的操作。下载下来的内容会智能分类呢。这样的话&#xff0c;你的资源…

第二届国赛铁三wp

第二届国赛 缺东西去我blog找&#x1f447; 第二届长城杯/铁三 | DDLS BLOG web Safe_Proxy 源码题目 from flask import Flask, request, render_template_stringimport socketimport threadingimport htmlapp Flask(__name__)app.route(/, methods"GET"])de…

【深度学习】嘿马深度学习笔记第11篇:卷积神经网络,学习目标【附代码文档】

本教程的知识点为&#xff1a;深度学习介绍 1.1 深度学习与机器学习的区别 TensorFlow介绍 2.4 张量 2.4.1 张量(Tensor) 2.4.1.1 张量的类型 TensorFlow介绍 1.2 神经网络基础 1.2.1 Logistic回归 1.2.1.1 Logistic回归 TensorFlow介绍 总结 每日作业 神经网络与tf.keras 1.3 …

STranslate 中文绿色版即时翻译/ OCR 工具 v1.3.1.120

STranslate 是一款功能强大且用户友好的翻译工具&#xff0c;它支持多种语言的即时翻译&#xff0c;提供丰富的翻译功能和便捷的使用体验。STranslate 特别适合需要频繁进行多语言交流的个人用户、商务人士和翻译工作者。 软件功能 1. 即时翻译&#xff1a; 文本翻译&#xff…

缓存之美:万文详解 Caffeine 实现原理(下)

上篇文章&#xff1a;缓存之美&#xff1a;万文详解 Caffeine 实现原理&#xff08;上&#xff09; getIfPresent 现在我们对 put 方法有了基本了解&#xff0c;现在我们继续深入 getIfPresent 方法&#xff1a; public class TestReadSourceCode {Testpublic void doRead() …

GPT 结束语设计 以nanogpt为例

GPT 结束语设计 以nanogpt为例 目录 GPT 结束语设计 以nanogpt为例 1、简述 2、分词设计 3、结束语断点 1、简述 在手搓gpt的时候&#xff0c;可能会遇到一些性能问题&#xff0c;即关于是否需要全部输出或者怎么节约资源。 在输出语句被max_new_tokens 限制&#xff0c…

HackTheBox靶机:Sightless;NodeJS模板注入漏洞,盲XSS跨站脚本攻击漏洞实战

HackTheBox靶机&#xff1a;Sightless 渗透过程1. 信息收集常规探测深入分析 2. 漏洞利用&#xff08;CVE-2022-0944&#xff09;3. 从Docker中提权4. 信息收集&#xff08;michael用户&#xff09;5. 漏洞利用 Froxlor6. 解密Keepass文件 漏洞分析SQLPad CVE-2022-0944 靶机介…

XML外部实体注入--XML基础

一.XML基础 1.XML 基础概念 定义&#xff1a;XML 即可扩展标记语言&#xff08;Extensible Markup Language&#xff09;&#xff0c;用于标记电子文件&#xff0c;使其具有结构性。它是一种允许用户对自己的标记语言进行定义的源语言&#xff0c;可用来标记数据、定义数据类型…