1、JDK
tar -xvf jdk-8u321-linux-x64.tar.gz -C /usr/lib/jvm JDK 的下载和安装(Windows+Linus 详细教程)
2、Redis
Linux 下安装步骤
3、Nginx 安装步骤
(yum update、yum install -y + 软件、 wget + url SSL: yum install -y openssl openssl-devel) 1、下载:http://nginx.org/en/download.html 2、配置: [root@dixinkk nginx-1.16.1]# ./configure --prefix=/usr/local/nginx 安装路径 3、编译:make 4、安装:make install
[root@dixinkk nginx-1.16.1]
[root@dixinkk nginx]
conf html logs sbin
[root@dixinkk nginx]
nginx
[root@dixinkk nginx]
-bash: nginx: command not found
[root@dixinkk sbin]
5、设置环境变量,使得在任意目录下输入nginx 都可以执行 保存完 source 一下生效 6、启动
7、查看进程
8、已启动 -> 浏览器中访问公网ip 9、终止进程 kill -9
[root@dixinkk ~]
root 11087 0.0 0.0 20496 612 ? Ss 09:03 0:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody 11088 0.0 0.0 20948 1576 ? S 09:03 0:00 nginx: worker process
root 12645 0.0 0.0 112648 968 pts/0 S+ 09:27 0:00 grep --color=auto nginx
[root@dixinkk ~]
[root@dixinkk ~]
root 12713 0.0 0.0 112648 968 pts/0 S+ 09:28 0:00 grep --color=auto nginx
10、浏览器中访问公网ip 两种可能:①阿里云防火墙拦截 ②nginx没启动 区分以上两种情况: 在nginx服务器里访问自己(本地): curl http://127.0.0.1 即使阿里云防火墙做了限制,本地也应该是可以访问的 若本地都访问不了,说明自己程序有问题
[root@dixinkk ~]
curl: (7) Failed connect to 127.0.0.1:80; Connection refused
非常有用的调试技巧 curl
遇到java程序外网无法访问: 测试java程序接口:curl http://127.0.0.1:8080/xxxx
11、部署前端项目
[root@dixinkk ~]
[root@dixinkk local]
aegis bin cloudmonitor etc games include lib lib64 libexec nginx sbin share src
[root@dixinkk local]
[root@dixinkk nginx]
client_body_temp conf fastcgi_temp html logs proxy_temp sbin scgi_temp uwsgi_temp
[root@dixinkk nginx]
total 36
drwx------ 2 nobody root 4096 Apr 6 09:03 client_body_temp
drwxr-xr-x 2 root root 4096 Apr 6 09:01 conf
drwx------ 2 nobody root 4096 Apr 6 09:03 fastcgi_temp
drwxr-xr-x 2 root root 4096 Apr 6 09:01 html
drwxr-xr-x 2 root root 4096 Apr 6 09:03 logs
drwx------ 2 nobody root 4096 Apr 6 09:03 proxy_temp
drwxr-xr-x 2 root root 4096 Apr 6 09:01 sbin
drwx------ 2 nobody root 4096 Apr 6 09:03 scgi_temp
drwx------ 2 nobody root 4096 Apr 6 09:03 uwsgi_temp
[root@dixinkk nginx]
[root@dixinkk conf]
fastcgi.conf fastcgi_params koi-utf mime.types nginx.conf scgi_params uwsgi_params win-utf
fastcgi.conf.default fastcgi_params.default koi-win mime.types.default nginx.conf.default scgi_params.default uwsgi_params.default
[root@dixinkk conf]
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html; //此处为相对路径,相对的是 /usr/local/nginx/conf
}
下载前端代码 【unzip 解压 zip文件(下载命令 yum install unzip )】
[root@dixinkk html]
[root@dixinkk html]
50x.html dist.zip dixinkk.html index.html
[root@dixinkk html]
移动前端代码到html目录下
[root@dixinkk html]
50x.html dist dist.zip dixinkk.html index.html __MACOSX
[root@dixinkk html]
total 28360
-rw-r--r-- 1 root root 494 Apr 6 09:01 50x.html
drwxr-xr-x 7 root root 4096 Jan 6 2020 dist
-rw-r--r-- 1 root root 29018922 Jan 7 2020 dist.zip
-rw-r--r-- 1 root root 22 Apr 6 19:47 dixinkk.html
-rw-r--r-- 1 root root 612 Apr 6 09:01 index.html
drwxrwxr-x 3 root root 4096 Jan 6 2020 __MACOSX
[root@dixinkk html]
[root@dixinkk html]
total 28356
-rw-r--r-- 1 root root 494 Apr 6 09:01 50x.html
drwxr-xr-x 7 root root 4096 Jan 6 2020 dist
-rw-r--r-- 1 root root 29018922 Jan 7 2020 dist.zip
-rw-r--r-- 1 root root 22 Apr 6 19:47 dixinkk.html
-rw-r--r-- 1 root root 612 Apr 6 09:01 index.html
[root@dixinkk html]
total 52
drwxr-xr-x 7 root root 4096 Jan 6 2020 .
drwxr-xr-x 3 root root 4096 Apr 6 20:02 ..
drwxr-xr-x 2 root root 4096 Jan 6 2020 css
-rw-r--r-- 1 root root 10244 Jan 6 2020 .DS_Store
-rw-r--r-- 1 root root 4286 Jan 6 2020 favicon.ico
drwxr-xr-x 2 root root 4096 Jan 6 2020 fonts
drwxr-xr-x 9 root root 4096 Jan 6 2020 imgs
-rw-r--r-- 1 root root 838 Jan 6 2020 index.html
drwxr-xr-x 2 root root 4096 Jan 6 2020 js
drwxr-xr-x 3 root root 4096 Jan 6 2020 mock
[root@dixinkk html]
[root@dixinkk html]
total 28348
-rw-r--r-- 1 root root 494 Apr 6 09:01 50x.html
drwxr-xr-x 7 root root 4096 Jan 6 2020 dist
-rw-r--r-- 1 root root 29018922 Jan 7 2020 dist.zip
[root@dixinkk html]
[root@dixinkk html]
total 28380
-rw-r--r-- 1 root root 494 Apr 6 09:01 50x.html
drwxr-xr-x 2 root root 4096 Jan 6 2020 css
drwxr-xr-x 2 root root 4096 Apr 6 20:04 dist
-rw-r--r-- 1 root root 29018922 Jan 7 2020 dist.zip
-rw-r--r-- 1 root root 4286 Jan 6 2020 favicon.ico
drwxr-xr-x 2 root root 4096 Jan 6 2020 fonts
drwxr-xr-x 9 root root 4096 Jan 6 2020 imgs
-rw-r--r-- 1 root root 838 Jan 6 2020 index.html
drwxr-xr-x 2 root root 4096 Jan 6 2020 js
drwxr-xr-x 3 root root 4096 Jan 6 2020 mock
|