jdk下载
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
解压tar -zxvf jdk-8u261-linux-x64.tar.gz
vim /etc/profile
export JAVA_HOME=/var/opt/java/jdk1.8.0_261
export PATH=$PATH:$JAVA_HOME/bin
G最后一行,A行尾
保存退出:wq
tomcat
下载https://tomcat.apache.org/download-90.cgi
解压tar -zxvf apache-tomcat-9.0.37.tar.gz
修改默认端口<Connector port="9090" protocol="HTTP/1.1"
启动./startup.sh
安全组规则添加访问
访问http://39.105.42.74:9090/steve/
安装nginx
http://nginx.org/en/download.html
解压
tar -zxvf nginx-1.18.0.tar.gz
安装依赖
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
配置
./configure
make && make install
启动
/usr/local/nginx/sbin/nginx
测试
/usr/local/nginx/sbin/nginx -t
创建软链接
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/
卸载和删除
查看nginx服务是否在运行
ps -ef | grep nginx
查看nginx安装目录
whereis nginx
终止nginx服务
/usr/local/nginx/sbin/nginx -s stop
输入find / -name nginx*指令全局查找nginx相关的文件
使用rm -rf file /usr/local/nginx* 对相关文件进行删除
使用yum卸载 nginx及相关依赖
yum remove nginx
域名配置
cd /usr/local/nginx/conf
创建文件夹
mkdir default
创建文件
vim default/oa.conf
server {
listen 80;
server_name oa.glory2020.cn;
location / {
proxy_pass http://localhost:8088;
}
location /logins {
proxy_pass http://localhost:8088/logins;
}
}
vim nginx.conf
include default/*.conf;
vim default/crm.conf
server
{
listen 80;
server_name crm.glory2020.cn;
index index index.html index.htm;
root /var/opt/html/crm;
location / {
proxy_pass http://127.0.0.1:8080/;
}
access_log off;
}
安全组添加访问规则
域名解析设置添加记录
访问