weblab finished
This commit is contained in:
99
weblab/webroot/index.html
Normal file
99
weblab/webroot/index.html
Normal file
@@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>简单Web服务器测试页面</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.container {
|
||||
background-color: white;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
text-align: center;
|
||||
border-bottom: 2px solid #4CAF50;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.info {
|
||||
background-color: #e8f5e8;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.feature {
|
||||
margin: 15px 0;
|
||||
padding: 10px;
|
||||
background-color: #f8f9fa;
|
||||
border-left: 4px solid #007bff;
|
||||
}
|
||||
.success {
|
||||
color: #28a745;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>🎉 Web服务器运行成功!</h1>
|
||||
|
||||
<div class="info">
|
||||
<p class="success">恭喜!你的C语言Web服务器已经成功运行!</p>
|
||||
<p>这个页面证明了服务器能够正确处理HTTP请求并返回静态网页内容。</p>
|
||||
</div>
|
||||
|
||||
<h2>服务器功能特性:</h2>
|
||||
|
||||
<div class="feature">
|
||||
<h3>✅ HTTP协议支持</h3>
|
||||
<p>服务器实现了基本的HTTP/1.1协议,能够解析GET请求并返回适当的响应。</p>
|
||||
</div>
|
||||
|
||||
<div class="feature">
|
||||
<h3>✅ 配置文件支持</h3>
|
||||
<p>通过webserver.ini文件可以配置服务器端口和网站根目录。</p>
|
||||
</div>
|
||||
|
||||
<div class="feature">
|
||||
<h3>✅ 访问日志记录</h3>
|
||||
<p>服务器会记录所有访问请求的IP地址、时间和请求路径到webserver.log文件。</p>
|
||||
</div>
|
||||
|
||||
<div class="feature">
|
||||
<h3>✅ 多种文件类型支持</h3>
|
||||
<p>支持HTML、CSS、JavaScript、图片等多种MIME类型的文件。</p>
|
||||
</div>
|
||||
|
||||
<div class="feature">
|
||||
<h3>✅ 并发访问支持</h3>
|
||||
<p>服务器能够在不重启的情况下处理多次访问请求。</p>
|
||||
</div>
|
||||
|
||||
<h2>测试建议:</h2>
|
||||
<ul>
|
||||
<li>尝试访问不存在的页面,查看404错误处理</li>
|
||||
<li>检查webserver.log文件中的访问记录</li>
|
||||
<li>修改webserver.ini配置文件并重启服务器</li>
|
||||
<li>在webroot目录中添加更多HTML、CSS、图片文件进行测试</li>
|
||||
</ul>
|
||||
|
||||
<div class="info">
|
||||
<p><strong>访问时间:</strong><span id="datetime"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 显示当前时间
|
||||
document.getElementById('datetime').textContent = new Date().toLocaleString('zh-CN');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user