# nginx-admin **Repository Path**: echo_2017_admin/nginx-admin ## Basic Information - **Project Name**: nginx-admin - **Description**: sql 转 struct, json 转 struct, 本地部署nginx php网站管理 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-27 - **Last Updated**: 2025-12-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NginxAdmin
![NginxAdmin Pro Logo](https://img.shields.io/badge/version-v1.0.0-blue.svg) ![Go Version](https://img.shields.io/badge/Go-1.25.5+-00ADD8E.svg) ![License](https://img.shields.io/badge/license-MIT-green.svg) ![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey.svg)
本地开发php项目时搭配nginx服务器,实现项目的本地部署和测试。 ![alt text](image.png) ![alt text](image-1.png) ![alt text](image-2.png) ![alt text](image-3.png) ![alt text](image-4.png) ## 安装部署 ### 系统要求 - **操作系统**:macOS 26 (Monterey)、Linux (Ubuntu 20.04+) - **Go版本**:1.25.5 或更高版本 - **Nginx**:已安装并可访问 - **内存**:至少 2GB RAM - **磁盘空间**:至少 500MB 可用空间 ### macOS 26 环境部署教程 #### 步骤 1:安装 Go 语言环境 打开终端,执行以下命令安装 Homebrew(如果尚未安装): ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` 使用 Homebrew 安装 Go: ```bash brew install go ``` 验证 Go 安装: ```bash go version ``` 预期输出:`go version go1.25.5 darwin/arm64` #### 步骤 2:配置 Go 环境变量 编辑 `~/.zshrc` 或 `~/.bash_profile` 文件,添加以下内容: ```bash export GOPATH=$HOME/go export GOROOT=/usr/local/opt/go/libexec export PATH=$PATH:$GOPATH/bin:$GOROOT/bin ``` 使配置生效: ```bash source ~/.zshrc ``` #### 步骤 3:安装 Nginx 使用 Homebrew 安装 Nginx: ```bash brew install nginx ``` 启动 Nginx 服务: ```bash brew services start nginx ``` 验证 Nginx 安装: ```bash nginx -v ``` #### 步骤 4:克隆项目代码 ```bash cd ~ git clone https://gitee.com/echo_2017_admin/nginx-admin.git cd nginx-admin ``` #### 步骤 5:安装项目依赖 进入后端目录: ```bash cd src/server ``` 下载 Go 依赖: ```bash go mod download ``` #### 步骤 6:配置 Nginx 虚拟主机 创建虚拟主机配置目录: ```bash mkdir -p src/server/vhost ``` 编辑 Nginx 配置文件(通常位于 `/usr/local/etc/nginx/nginx.conf`),在 `http` 块中添加: ```nginx http { include /path/to/nginx-admin-pro/src/server/vhost/*.conf; } ``` #### 步骤 7:启动应用 编译并运行后端服务: ```bash go run main.go ``` 服务将在 `http://localhost:8080` 启动。 #### 步骤 8:访问 Web 界面 打开浏览器,访问: ``` http://localhost:8080 ```