# hgfs **Repository Path**: techbrew/hgfs ## Basic Information - **Project Name**: hgfs - **Description**: 恒光金银丝官方 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-08 - **Last Updated**: 2026-06-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 恒光金银丝有限公司官网 静态网站项目,用于展示恒光金银丝有限公司(恒光纺织)的企业信息、产品中心、门店分布等内容。 ## 项目结构 ``` hgfs/ ├── index.html # 主页面 ├── styles.css # 样式文件 ├── script.js # 交互脚本 └── README.md # 项目说明文档 ``` ## 快速预览 直接用浏览器打开 `index.html` 文件即可预览网站。 ## Nginx 部署指南 ### 1. 安装 Nginx ```bash # 更新软件源 sudo apt update -y # 安装 Nginx sudo apt install -y nginx # 启动 Nginx sudo systemctl start nginx # 检查 Nginx 状态 sudo systemctl is-active nginx ``` ### 2. 创建网站目录 ```bash # 创建网站目录 sudo mkdir -p /home/www/hgmetallicyarn # 设置目录权限 sudo chmod -R 755 /home/www/hgmetallicyarn sudo chown -R www-data:www-data /home/www/hgmetallicyarn ``` ### 3. 配置站点 创建 Nginx 配置文件: ```bash sudo nano /etc/nginx/conf.d/hgmetallicyarn.conf ``` 添加以下配置: ```nginx server { listen 80; server_name www.hgmetallicyarn.cn hgmetallicyarn.cn; root /home/www/hgmetallicyarn; index index.html index.htm; location / { try_files $uri $uri/ =404; } access_log /var/log/nginx/hgmetallicyarn.cn.access.log; error_log /var/log/nginx/hgmetallicyarn.cn.error.log; } server { listen 80; server_name www.hgmetallicyarn.com hgmetallicyarn.com; root /home/www/hgmetallicyarn; index index.html index.htm; location / { try_files $uri $uri/ =404; } access_log /var/log/nginx/hgmetallicyarn.access.log; error_log /var/log/nginx/hgmetallicyarn.error.log; } ``` ### 4. 上传网站文件 从 Git 克隆项目并复制文件: ```bash # 克隆项目 git clone https://gitee.com/techbrew/hgfs.git # 复制文件到网站目录 sudo cp -r hgfs/* /home/www/hgmetallicyarn/ # 更新文件 sudo cp -r /root/hgfs/* /home/www/hgmetallicyarn/ ``` ### 5. 测试并重载 Nginx ```bash # 测试配置 nginx -t # 重载 Nginx nginx -s reload # 或使用 systemctl sudo systemctl reload nginx ``` ### 6. 验证部署 ```bash # 检查 Nginx 状态 ps aux | grep nginx # 检查网站文件 ls -la /home/www/hgmetallicyarn/ ``` ## 更新网站内容 当本地文件更新后,执行以下命令同步到服务器: ```bash cd hgfs/ git pull sudo cp -r /root/hgfs/* /home/www/hgmetallicyarn/ nginx -s reload ``` ## HTTPS 配置(推荐) 使用 Let's Encrypt 免费证书: ```bash # 安装 Certbot sudo apt install certbot python3-certbot-nginx # 获取证书(将 your-domain.com 替换为您的域名) sudo certbot --nginx -d your-domain.com # 自动续期测试 sudo certbot renew --dry-run ``` ## 常用命令 ```bash # 启动 Nginx sudo systemctl start nginx # 停止 Nginx sudo systemctl stop nginx # 重启 Nginx sudo systemctl restart nginx # 重载配置 nginx -s reload # 测试配置 nginx -t # 查看 Nginx 状态 sudo systemctl status nginx ``` ## 目录结构参考 ``` /home/www/hgmetallicyarn/ ├── index.html ├── styles.css ├── script.js └── README.md ``` ## 联系方式 - 总部电话:136 0572 7485 - 大朗门店:19884830212 - 桐乡门店:139 6799 0351