乙巳🐍年

acc8226 的博客

Apache 是世界使用排名第一的 Web 服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的 Web 服务器端软件之一。

1. 执行如下命令,安装 Apache 服务及其扩展包。

1
yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql

2. 执行如下命令,启动 Apache 服务。

1
systemctl start httpd.service

3. 测试 Apache 服务是否安装并启动成功。

Apache 默认监听 80 端口,所以只需在浏览器访问即可。

阅读全文 »

Jetty 提供了一个 web 服务器和 servlet 容器,另外还提供了对 HTTP/2、 WebSocket、 OSGi、 JMX、 JNDI、 JAAS 和许多其他集成的支持。这些组件是开放源码的,可以免费用于商业用途和分发。

在开发和生产中,Jetty 被广泛应用于各种项目和产品中。Jetty 长期以来深受开发人员的喜爱,因为它可以轻松地嵌入到设备、工具、框架、应用服务器和现代云服务中。

下载地址 https://www.eclipse.org/jetty/download.html

参考文档 Jetty : The Definitive Reference (eclipse.org)

启动和关闭服务脚本

1
2
service jetty start
service jetty stop
阅读全文 »

  • web 服务器, 轻量级, 能处理大并发量
  • 反向代理服务器(负载均衡)

你可以轻松的在服务器上通过 Nginx 部署 HTTP 静态服务。

安装

windows 下 Nginx 环境的安装

下载压缩包后进行解压,双击里面的 nginx.exe 即可运行

linux 下 Nginx 环境的安装

CentOS 下 yum 安装
使用 yum 来安装 Nginx
yum install nginx -y

ubuntu 下 apt-get 安装
apt install nginx

使用 docker 安装 nginx
请参考教程: Docker 安装 Nginx | 菜鸟教程

阅读全文 »

tomcat 版本的选择

Apache Tomcat 是 Jakarta EE (正式的 Java EE)技术的一个子集的开放源码软件实现。ApacheTomcat 的不同版本可用于规范的不同版本。规范和相应的 Apache Tomcat 版本之间的映射如下:

Servlet Spec JSP Spec EL Spec WebSocket Spec Authentication (JASPIC) Spec Apache Tomcat Version Latest Released Version Supported Java Versions
6.0 3.1 5.0 2.1 3.0 10.1.x 10.1.0-M16 (beta) 11 and later
5.0 3.0 4.0 2.0 2.0 10.0.x 10.0.22 8 and later
4.0 2.3 3.0 1.1 1.1 9.0.x 9.0.64 8 and later
3.1 2.3 3.0 1.1 1.1 8.5.x 8.5.81 7 and later
3.1 2.3 3.0 1.1 N/A 8.0.x (superseded) 8.0.53 (superseded) 7 and later
3.0 2.2 2.2 1.1 N/A 7.0.x (archived) 7.0.109 (archived) 6 and later (7 and later for WebSocket)
2.5 2.1 2.1 N/A N/A 6.0.x (archived) 6.0.53 (archived) 5 and later
2.4 2.0 N/A N/A N/A 5.5.x (archived) 5.5.36 (archived) 1.4 and later
2.3 1.2 N/A N/A N/A 4.1.x (archived) 4.1.40 (archived) 1.3 and later
2.2 1.1 N/A N/A N/A 3.3.x (archived) 3.3.2 (archived) 1.1 and later
阅读全文 »

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form method="POST" enctype="multipart/form-data" onsubmit="return false;">
<input id=file type=file placeholder="select a file" />
</form>
<pre id=log></pre>
<script src="https://cdn.jsdelivr.net/gh/satazor/SparkMD5@master/spark-md5.min.js"></script>
<script>
var log = document.getElementById("log");
document.getElementById("file").addEventListener("change", function () {
var blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice,
file = this.files[0],
chunkSize = 2097152, // read in chunks of 2MB
chunks = Math.ceil(file.size / chunkSize),
currentChunk = 0,
spark = new SparkMD5.ArrayBuffer(),
frOnload = function (e) {
spark.append(e.target.result); // append array buffer
currentChunk++;
if (currentChunk < chunks) {
loadNext();
} else {
log.innerHTML += "\n加载结束 :\n计算后的文件md5:\n" + spark.end() + "\n现在你可以选择另外一个文件!\n";
}
},
frOnerror = function () {
log.innerHTML += "\n糟糕,好像哪里错了.";
};

function loadNext() {
var fileReader = new FileReader();
fileReader.onload = frOnload;
fileReader.onerror = frOnerror;
var start = currentChunk * chunkSize,
end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize;
fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
};

loadNext();
});
</script>
</body>
</html>
阅读全文 »
0%