增加帮助页面网页代码功能,以及nginx部署
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
server {
|
||||
listen 6045;
|
||||
server_name _;
|
||||
|
||||
location /uft3changecode/ {
|
||||
alias /home/taoc/uft30help/uft3changecode/;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /uft3changecode/index.html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
worker_processes 1;
|
||||
pid /home/taoc/nginx/logs/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /home/taoc/nginx/conf/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
access_log /home/taoc/nginx/logs/help_access.log;
|
||||
error_log /home/taoc/nginx/logs/help_error.log;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 6045;
|
||||
server_name _;
|
||||
|
||||
root /home/taoc/uft30help/html/;
|
||||
index index.html index.htm;
|
||||
|
||||
location /uft3changecode/ {
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /uft3changecode/index.html;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "=== Force Restart Help Documentation Server ==="
|
||||
echo ""
|
||||
|
||||
echo "1. Killing all nginx processes..."
|
||||
pkill -f nginx 2>/dev/null || true
|
||||
sleep 2
|
||||
|
||||
echo "2. Checking for remaining nginx processes..."
|
||||
if pgrep nginx > /dev/null; then
|
||||
echo " Force killing remaining nginx processes..."
|
||||
pkill -9 nginx 2>/dev/null || true
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
echo "3. Checking port 6045..."
|
||||
lsof -i :6045 2>/dev/null || echo " Port 6045 is free"
|
||||
|
||||
echo ""
|
||||
echo "4. Starting fresh nginx instance..."
|
||||
|
||||
NGINX_BIN="/home/taoc/nginx/sbin/nginx"
|
||||
HELP_DOCS_DIR="/home/taoc/uft30help/"
|
||||
CONF_FILE="$HELP_DOCS_DIR/workspace/nginx.conf"
|
||||
|
||||
if [ ! -f "$CONF_FILE" ]; then
|
||||
echo " Copying nginx configuration..."
|
||||
cp "$(dirname "$0")/nginx.conf" "$CONF_FILE"
|
||||
fi
|
||||
|
||||
if [ ! -f "$HELP_DOCS_DIR/workspace/help.conf" ]; then
|
||||
echo " Copying server configuration..."
|
||||
cp "$(dirname "$0")/help.conf" "$HELP_DOCS_DIR/workspace/help.conf"
|
||||
fi
|
||||
|
||||
if [ ! -f "$HELP_DOCS_DIR/uft3changecode/index.html" ]; then
|
||||
echo " Creating default index.html..."
|
||||
cat > "$HELP_DOCS_DIR/uft3changecode/index.html" << 'EOF'
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>UFT30ChangeCode Help</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; text-align: center; padding: 50px; background: #f5f5f5; }
|
||||
.container { background: white; padding: 40px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: inline-block; }
|
||||
.logo { font-size: 64px; margin-bottom: 20px; }
|
||||
h1 { color: #667eea; margin: 0; }
|
||||
.subtitle { color: #666; margin-top: 10px; }
|
||||
.path { background: #f0f0f0; padding: 10px 20px; border-radius: 5px; margin-top: 20px; font-family: monospace; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="logo">📖</div>
|
||||
<h1>UFT30ChangeCode Help</h1>
|
||||
<p class="subtitle">Help Documentation Server</p>
|
||||
<div class="path">Path: /uft3changecode/</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
fi
|
||||
|
||||
echo "5. Testing configuration..."
|
||||
"$NGINX_BIN" -t -c "$CONF_FILE"
|
||||
|
||||
echo "6. Starting nginx..."
|
||||
"$NGINX_BIN" -c "$CONF_FILE"
|
||||
|
||||
sleep 2
|
||||
echo ""
|
||||
echo "=== Server Status ==="
|
||||
if pgrep nginx > /dev/null; then
|
||||
SERVER_IP=$(ip addr show | grep inet | grep -v '127.0.0.1' | grep -v '::1' | head -1 | awk '{print $2}' | cut -d'/' -f1)
|
||||
echo "✅ Server started successfully!"
|
||||
echo ""
|
||||
echo "Access URLs:"
|
||||
echo " Local: http://localhost:6045/uft3changecode/"
|
||||
if [ -n "$SERVER_IP" ]; then
|
||||
echo " Remote: http://$SERVER_IP:6045/uft3changecode/"
|
||||
fi
|
||||
echo ""
|
||||
echo "Verify with:"
|
||||
echo " curl http://localhost:6045/uft3changecode/"
|
||||
else
|
||||
echo "❌ Failed to start server"
|
||||
echo "Check error log: /home/taoc/uft30help/workspace/logs/help_error.log"
|
||||
fi
|
||||
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
NGINX_BIN="/home/taoc/nginx/sbin/nginx"
|
||||
CONF_DIR="/home/taoc/uft30help/workspace"
|
||||
HTML_DIR="/home/taoc/uft30help/html/uft3changecode"
|
||||
CONF_FILE="$CONF_DIR/nginx.conf"
|
||||
|
||||
echo "=== Starting Help Documentation Server (Port 6045) ==="
|
||||
echo ""
|
||||
|
||||
echo "1. Checking directories..."
|
||||
if [ ! -d "$CONF_DIR" ]; then
|
||||
mkdir -p "$CONF_DIR"
|
||||
echo " Created config dir: $CONF_DIR"
|
||||
else
|
||||
echo " Config dir exists: $CONF_DIR"
|
||||
fi
|
||||
|
||||
if [ ! -d "$HTML_DIR" ]; then
|
||||
mkdir -p "$HTML_DIR"
|
||||
echo " Created HTML dir: $HTML_DIR"
|
||||
else
|
||||
echo " HTML dir exists: $HTML_DIR"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "2. Killing all nginx processes..."
|
||||
pkill -f nginx 2>/dev/null || true
|
||||
sleep 2
|
||||
pkill -9 nginx 2>/dev/null || true
|
||||
sleep 1
|
||||
echo " Done"
|
||||
|
||||
echo ""
|
||||
echo "3. Starting nginx..."
|
||||
"$NGINX_BIN" -c "$CONF_FILE"
|
||||
|
||||
sleep 2
|
||||
echo ""
|
||||
echo "4. Testing..."
|
||||
echo ""
|
||||
echo "=== Server Status ==="
|
||||
if pgrep nginx > /dev/null; then
|
||||
SERVER_IP=$(ip addr show | grep inet | grep -v '127.0.0.1' | grep -v '::1' | head -1 | awk '{print $2}' | cut -d'/' -f1)
|
||||
echo "✅ Server running!"
|
||||
echo ""
|
||||
echo "=== Access URLs ==="
|
||||
echo " Local: http://localhost:6045/uft3changecode/"
|
||||
if [ -n "$SERVER_IP" ]; then
|
||||
echo " Remote: http://$SERVER_IP:6045/uft3changecode/"
|
||||
fi
|
||||
else
|
||||
echo "❌ Server not running"
|
||||
echo "Error log:"
|
||||
tail -20 /home/taoc/uft30help/workspace/logs/help_error.log
|
||||
fi
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Checking Help Documentation Server status..."
|
||||
|
||||
if pgrep nginx &> /dev/null; then
|
||||
echo "✅ Help Documentation Server is running"
|
||||
echo "📄 Access URL: http://localhost:8080"
|
||||
else
|
||||
echo "❌ Help Documentation Server is not running"
|
||||
fi
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
NGINX_DIR="/home/taoc/nginx"
|
||||
NGINX_BIN="$NGINX_DIR/sbin/nginx"
|
||||
|
||||
echo "Stopping Help Documentation Server..."
|
||||
|
||||
if [ ! -f "$NGINX_BIN" ]; then
|
||||
echo "Error: nginx binary not found at $NGINX_BIN"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$NGINX_BIN" -s stop
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Help Documentation Server stopped successfully"
|
||||
else
|
||||
echo "❌ Failed to stop nginx"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user