centos安装nginx vue
时间: 2023-11-27 11:44:19 浏览: 39
好的,以下是 centos 安装 nginx 和 vue 的步骤:
1. 安装 nginx
首先,使用以下命令安装 nginx:
```
sudo yum install nginx
```
安装完成后,启动 nginx 服务:
```
sudo systemctl start nginx
```
然后,使用以下命令检查 nginx 是否已经启动:
```
sudo systemctl status nginx
```
如果 nginx 已经启动,你应该会看到类似于以下的输出:
```
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-08-23 10:00:00 CST; 1h ago
Process: 1234 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 1235 (nginx)
Tasks: 2
Memory: 3.6M
CPU: 20ms
CGroup: /system.slice/nginx.service
├─1235 nginx: master process /usr/sbin/nginx
└─1236 nginx: worker process
Aug 23 10:00:00 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
Aug 23 10:00:00 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
```
2. 安装 vue
安装 vue 需要先安装 node.js 和 npm。使用以下命令安装:
```
sudo yum install nodejs
sudo yum install npm
```
安装完成后,使用以下命令安装 vue:
```
sudo npm install -g vue-cli
```
安装完成后,你可以使用以下命令创建一个新的 vue 项目:
```
vue init webpack my-project
```
然后进入项目目录,安装依赖:
```
cd my-project
npm install
```
最后,使用以下命令启动项目:
```
npm run dev
```