购买的云系统,安装的CentOS 7.3。
https://www.oracle.com/index.html
wget https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz?AuthParam=1553657424_6871ae9d390d424ee6ff56677b27075c
下载的文件:jdk-8u201-linux-x64.tar.gz?AuthParam=1553657424_6871ae9d390d424ee6ff56677b27075c文件后缀不对,进行修改
mv jdk-8u201-linux-x64.tar.gz\?AuthParam\=1553657424_6871ae9d390d424ee6ff56677b27075c jdk-8u201-linux-x64.tar.gz
tar -zxvf jdk-8u201-linux-x64.tar.gz
vim /etc/profile
# JDK
export JAVA_HOME=/www/jdk1.8.0_201
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile
java –version
上传jar包可以有多种方式:rz;FTP等,在这里就不做赘述;
java -jar *******.jar &
&符号的意思是此进程在后台运行,即Ctrl+C杀不掉此进程。
此步骤仅为检查服务是否成功运行,可以略过。
防火墙常用命令(firewalld):
查看状态:systemctl status firewalld
开启:service firewalld start
重启:service firewalld restart
关闭:service firewalld stop
查看规则:firewall-cmd --list-all
查看8080端口是否开放:firewall-cmd --query-port=8080/tcp
开放8080端口:firewall-cmd --permanent --add-port=8080/tcp
关闭8080端口:firewall-cmd --permanent --remove-port=8080/tcp
浏览器输入:http://IP:PROT即可
yum install gcc-c++
wget http://nginx.org/download/nginx-1.14.2.tar.gz
wget https://www.openssl.org/source/openssl-fips-2.0.16.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxvf openssl-fips-2.0.16.tar.gz
cd openssl-fips-2.0.16
./config && make && make install
tar -zxvf pcre-8.38.tar.gz
cd pcre-8.38
./config && make && make install
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure && make && make install
tar -zxvf nginx-1.14.2.tar.gz
cd nginx-1.14.2
./configure && make && make install
Nginx默认安装路径:/usr/local/nginx
Nginx常用命令:
启动:./sbin/nginx -c conf/nginx.conf
重载配置文件:./sbin/nginx -s -reload
#user nobody;
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 www.dulovexi.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8080; # 此处为服务的IP:端口
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}