一、JDK安装(离线安装)
1. 下载JDK(Linux版)
2. 使用xftp将下载的安装包上传到linux的/usr/local目录
3. 解压JDK安装包
4. 配置环境变量
5. 让配置生效
[root@theo etc]
[root@theo etc]
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
二、Tomcat安装(离线安装)
1. 下载Tomcat(Linux版)
2. 使用xftp将下载的安装包上传到linux的/usr/local目录
3. 解压JDK安装包
tar -zxvf apache-tomcat-8.5.46.tar.gz
4. 启动tomcat
[root@theo apache-tomcat-8.5.46]
[root@theo bin]
bootstrap.jar catalina-tasks.xml commons-daemon.jar configtest.sh digest.sh
shutdown.bat startup.sh tool-wrapper.bat version.sh
catalina.bat ciphers.bat commons-daemon-native.tar.gz daemon.sh
setclasspath.bat shutdown.sh tomcat-juli.jar tool-wrapper.sh
catalina.sh ciphers.sh configtest.bat digest.bat setclasspath.sh
startup.bat tomcat-native.tar.gz version.bat
[root@theo bin]
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.46
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.46
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.46/temp
Using JRE_HOME: /usr/local/jdk1.8.0_221/jre
Using CLASSPATH: /usr/local/apache-tomcat-8.5.46/bin/bootstrap.jar:/usr/local/apachetomcat-8.5.46/bin/tomcat-juli.jar
Tomcat started.
5. 停止tomcat
[root@theo bin]
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 30394 root 53u IPv4 64248 0t0 TCP *:webcache (LISTEN)
[root@theo bin]
6. 关闭防火墙
[root@theo bin]
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@theo bin]
[root@theo bin]
三、MySQL 安装(在线安装)
1. 通过wget指令下载mysql的rpm文件
[root@theo local]
/usr/local
[root@theo local]
aegis apache-tomcat-8.5.46 bin etc games include jdk1.8.0_221 lib lib64 libexec sbin
share src
[root@theo local]
2. rpm安装mysql
[root@theo local]
3. 通过yum安装mysql服务
[root@theo local]
4. 加入开机启动
[root@theo local]
5. 启动MySQL服务
[root@theo local]
[root@theo local]
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 8430 mysql 17u IPv6 70095 0t0 TCP *:mysql (LISTEN)
6. 停止MySQL服务
[root@theo local]
7. MySQL基本使用
- mysql初次登陆需要修改密码(先查看原始密码然后登陆修改)
cat /var/log/mysqld.log | grep password
[root@theo log]
Enter password:
mysql>
set global validate_password_policy=LOW
或者
set global validate_password.policy = 0;
如果centos8.
set global validate_password.policy=low;
set global validate_password_length=1; //设置密码长度 最少4位
set password=password('123456');
GRANT ALL PRIVILEGES on *.* to 'root'@'%' IDENTIFIED by '123456' WITH GRANT OPTION;
flush PRIVILEGES;
8. Navicat上的使用
- 使用公网ip和账号密码的登陆数据库
四、MySQL 安装(离线安装)
1. 在windows下载mysql安装?件(2个)
MySQL-server-5.6.45-1.el7.x86_64.rpm
MySQL-client-5.6.45-1.el7.x86_64.rpm
2. 将安装包上传到linux(/usr/local)
3. 清除centos自带的mariaDB包
[root@theo local]
[root@theo local]
4. 安装mysql的服务和客户端
[root@theo local]
[root@theo local]
五、Nginx安装及配置(Windows)
1. 下载
http://nginx.org/en/download.html
2. 解压到指定目录
3. 运行及访问
4. 使用
- 将前端项目文件夹fmall-static拷贝到nginx的根目录下
- 修改nginx.conf:
location / {
root fmall-static;
index index.html index.htm;
}
5. nginx.conf配置文件说明
- 将前端项目文件夹fmall-static拷贝到nginx的根目录下
- 修改nginx.conf:
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 2000;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root fmall-static;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
六、Nginx安装及配置(Linux)
1. 安装编译工具(nginx安装之前需要编译)
[root@theo local]
2. 安装PCRE
[root@theo local]
[root@theo local]
[root@theo local]
[root@theo pcre-8.35]
[root@theo pcre-8.35]
3. 安装SSL库
[root@theo pcre-8.35]
[root@theo local]
[root@theo local]
[root@theo local]
[root@theo openssl-1.0.1j]
[root@theo openssl-1.0.1j]
4. 安装zlib库
[root@theo openssl-1.0.1j]
[root@theo local]
[root@theo local]
[root@theo local]
[root@theo zlib-1.2.11]
[root@theo zlib-1.2.11]
5. 安装Nginx
[root@theo zlib-1.2.11]
[root@theo local]
[root@theo local]
[root@theo local]
[root@theo local]
[root@theo nginx-1.16.1]
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
./configure --prefix=/usr/local/server/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/pcre-8.35
[root@theo nginx-1.16.1]
6. 配置Nginx
- 将前端项目放入/usr/local/server/nginx中
- 修改nginx.conf文件里location的root地址为前端项目文件名
[root@theo zlib-1.2.11]
7. 启动Nginx
- 进入/usr/local/server/nginx/sbin
- 运行nginx文件
8. 使用
|