vps:baresitetest

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
vps:baresitetest [2026/06/23 14:35] – 移除 - 外部编辑 (未知日期) 127.0.0.1vps:baresitetest [2026/06/23 14:35] (当前版本) – ↷ 页面baresitetest被移动至vps:baresitetest xiaobenmao
行 1: 行 1:
 +====== bare site test ======
  
 +===== start =====
 +
 +<code bash baresitetest.sh [enable_line_numbers="true"]>
 +mkdir -p /tmp/testsite
 +echo "hello from server $(date)" > /tmp/testsite/index.html
 +cd /tmp/testsite
 +nohup python3 -m http.server 80 --bind 0.0.0.0 > /tmp/http.log 2>&1 &
 +</code>
 +
 +Non-superuser may not have access to 80 port, use sudo then. 
 +
 +===== stop =====
 +
 +To kill the thread, get its pid via
 +
 +<code bash>
 +ps aux | grep "python3 -m http.server" | grep -v grep
 +</code>
 +
 +and then terminate the task using
 +
 +<code bash>kill <pid></code>
 +
 +or 
 +
 +<code bash>kill -9 <pid></code>