-
-
Notifications
You must be signed in to change notification settings - Fork 134
/
windows.md
60 lines (42 loc) · 1.81 KB
/
windows.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Windows 上安装
打开 `PowerShell`
```powershell
$ cd $HOME
$ git clone --depth=1 https://github.com/khs1994-docker/lnmp.git
# $ git clone --depth=1 [email protected]:khs1994-docker/lnmp.git
# 中国镜像
$ git clone --depth=1 https://gitee.com/khs1994-docker/lnmp.git
# $ git clone --depth=1 [email protected]:khs1994-docker/lnmp
```
## 设置环境变量
```powershell
$ [environment]::SetEnvironmentvariable("LNMP_PATH", "${HOME}\lnmp", "User")
```
## 启动 Demo
```powershell
$ cd $HOME
$ cd lnmp
$ ./lnmp-docker.ps1 up
```
> 如果 `PowerShell` 禁止执行脚本,请以管理员身份运行 `PowerShell` 并执行 `set-ExecutionPolicy Bypass`,之后输入 `Y` 确认。[说明](https://docs.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_execution_policies)
```powershell
# 禁止执行脚本的提示
PS C:\Users\90621\lnmp> .\lnmp-docker
.\lnmp-docker : File C:\Users\90621\lnmp\lnmp-docker.ps1 cannot be loaded because running scripts is disabled on this s
ystem. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\lnmp-docker
+ ~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
```
```powershell
# 解决方法
PS C:\Windows\system32> set-ExecutionPolicy Bypass
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y(输入Y)
```
浏览器打开 `127.0.0.1`,看到页面。