Last modified by Admin on 2025/03/12 11:49

From version 4.5
edited by LongNT
on 2023/12/27 09:17
Change comment: Renamed from xwiki:Main. Linux Server .Cài đặt Wordpress qua Virtual Host.Cài đặt Wordpress trên LEMP
To version 5.1
edited by Admin
on 2025/03/12 11:49
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.longnt
1 +XWiki.TechSupport
Content
... ... @@ -1,4 +1,4 @@
1 -== 1.Cấu trúc thư mục của Vhost apache trong linux ==
1 +== 1.Cấu trúc thư mục của Vhost NGINX trong linux ==
2 2  
3 3  (% style="margin-left: 40.0px;" %)
4 4  Trên apache server, mỗi website sẽ có một thư mục chứa mà nguồn riêng, hay còn gọi là thư mục gốc. nhiệm vụ của server là dựa vào domain đang request để gọi tới đúng thư mục gốc.
... ... @@ -23,16 +23,15 @@
23 23  sudo vim /etc/nginx/sites-available/[your-domain]
24 24  {{/code}}
25 25  
26 -\\
27 27  
28 28  [[image:attach:image2023-5-15_15-51-41.png||height="250"]]
29 29  
30 30  {{code language="bash" theme="Emacs"}}
31 31  server {
32 - listen 80;
33 - server_name longninja www.longninja;
34 - root /var/www/longninja;
35 - index index.html index.htm index.php;
31 + listen 80;
32 + server_name longninja www.longninja;
33 + root /var/www/longninja;
34 + index index.html index.htm index.php;
36 36  
37 37     location / {
38 38          try_files $uri %uri/ =404;
... ... @@ -47,7 +47,6 @@
47 47  }
48 48  {{/code}}
49 49  
50 -
51 51  
52 52  Thay những vị trí đánh dấu là domain của bạn. sau đó save file lại bằng nút ESC -> :wq -> ENTER
53 53  
... ... @@ -57,7 +57,6 @@
57 57  sudo ln –s /etc/nginx/sites-available/[your-domain] /etc/nginx/sites-enabled/
58 58  {{/code}}
59 59  
60 -\\
61 61  
62 62  [[image:attach:image2023-5-15_15-51-54.png||height="25"]]
63 63  
... ... @@ -100,7 +100,6 @@
100 100  create database wordpress default character set utf8 collate utf_8_unicode_ci;
101 101  {{/code}}
102 102  
103 -\\
104 104  
105 105  [[image:attach:image2023-5-15_15-52-35.png||width="600"]]
106 106  
... ... @@ -110,7 +110,6 @@
110 110  create user '[your-username]' @'%' identified with mysql_native_password by '[your-password]';
111 111  {{/code}}
112 112  
113 -\\
114 114  
115 115  [[image:attach:image2023-5-15_15-52-47.png||width="600"]]
116 116  
... ... @@ -122,7 +122,6 @@
122 122  grant all on wordpress.* to '[your-username] '@'%';
123 123  {{/code}}
124 124  
125 -\\
126 126  
127 127  [[image:attach:image2023-5-15_15-52-57.png||width="400"]]
128 128  
... ... @@ -133,11 +133,9 @@
133 133  exit;
134 134  {{/code}}
135 135  
136 -\\
137 137  
138 138  [[image:attach:image2023-5-15_15-53-2.png||width="400"]]
139 139  
140 -
141 141  
142 142  == 3. Cài đặt các phần mở rộng của php ==
143 143  
... ... @@ -188,7 +188,6 @@
188 188  }
189 189  {{/code}}
190 190  
191 -\\
192 192  
193 193  [[image:attach:image2023-5-15_15-53-34.png||width="600"]]
194 194  
... ... @@ -198,7 +198,6 @@
198 198  sudo nginx –t
199 199  {{/code}}
200 200  
201 -\\
202 202  
203 203  [[image:attach:image2023-5-15_15-53-48.png||width="600"]]
204 204  
... ... @@ -208,11 +208,10 @@
208 208  sudo systemctl reload nginx
209 209  {{/code}}
210 210  
211 -\\
212 212  
213 213  == 5. Cài đặt Wordpress ==
214 214  
215 -1.
204 +1.
216 216  11. (((
217 217  === Tải và cài wordpress ===
218 218  )))
... ... @@ -248,7 +248,6 @@
248 248  sudo cp –a /tmp/wordpress/. /var/www/[your-domain]
249 249  {{/code}}
250 250  
251 -\\
252 252  
253 253  === b. Cấu hình wordpress ===
254 254  
... ... @@ -279,7 +279,6 @@
279 279  sudo vim /var/www/[your-domain]/wp-config.php
280 280  {{/code}}
281 281  
282 -\\
283 283  
284 284  [[image:attach:image2023-5-15_15-54-13.png||width="400"]]
285 285