傻瓜式安装
** 2.可视化页面打开终端**
** 3.进入目录 **
cd /etc/sysconfig/network-scripts
3.打开文件
vi ifcfg-ensXX
** 4.修改文件ifcfg-ens33 设置静态ip**
TYPE=“Ethernet”
BOOTPROTO=“static”
NAME=“ens33”
DEVICE=“ens33”
ONBOOT=“yes”
IPADDR=“192.168.85.132”
NETMASK=“255.255.255.0”
GATEWAY=“192.168.85.2”
DNS1=“114.114.114.114”
DNS2=“8.8.8.8”
** 安装 ftp**
yum -y install vsftpd
查看防火墙状态
systemctl status firewalld.service
临时停止firewall
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service
查看防火墙状态是否是running
firewall -cmd --state
重新载入配置,比如添加规则之后,需要执行此命令
firewall -cmd --reload
列出支持的zone
firewall -cmd --get-zones
列出支持的服务,在列表中的服务是放行的
firewall -cmd --get-services
查看ftp服务是否支持,返回yes或者no
firewall -cmd --query-service ftp
临时开放ftp服务
firewall-cmd --add-service=ftp
永久开放ftp服务
firewall-cmd --add-service=ftp --permanent
永久移除ftp服务
firewall-cmd --remove-service=ftp --permanent
永久添加80端口
firewall-cmd --add-port=80/tcp --permanent
开启端口
添加:firewall-cmd --zone=public --add-port=80/tcp --permanent
重新载入:firewall-cmd --reload
查看:firewall-cmd --zone=pubilc --query-prot=90/tcp
删除:firewall-cmd --zone=public --remove-prot=80/tcp --permanent
查看是否已经有过安装
rpm -qa | grep jdk
** 卸载已安装的jdk**
yum -y remove XXX
从centos开源库中找jdk相关软件
yum list| greo jdk
安装
yum -y install xxx
检查是否安装成功
jjava -version
** 下载 **
官网下载
** 目录 **
/xxx/tomcat/xxx.tat.ge
解压
tar zxf xxx.tat.gz
启动
cd /解压目录/bin/
./startup.sh
** 查看日志 **
cd /解压目录/log/
tail -f catalina.out
** 查看是否运行**
ps -ef | grep tomcat
** 下载**
官网下载linux版本压缩包
目录
/xxx/reids/xxx.tat.ge
解压
tar -zxvf redisxxxx.tar.ge
安装依赖
yum -y install gcc-c++ autoconf automake
make
进入解压目录 运行:“make”
安装
1.进入解压目录
2.默认安装:make install 位置: /usr/local/bin
3.选择已有目录安装:make PREFIX=/usr/local/redis/ install
redis.conf文件
将解压目录中“redis.conf”移动到安装目录下
修改redis.conf文件
1.daemonize yes (后台启动)
2.bind ip (允许访问的ip 若注释掉则表示允许所有的ip )
3.protected-mode no (关闭保护模式)
4.requirepass root(添加访问认证) “备注:搜索:Redis is pretty fast an outside user;
在其后添加认证”
5.database xx (xx:数据库数量 )
官网下载:https://www.mysql.com/
检查已安装的mysql并卸载
检查:rpm -qa | grep mysql
卸载:yum -y remove mysql
删除mariaDb
检查:rpm -qa| grep mariadb
删除:rpm -e --nodeps xxxx
安装依赖
yum install libaio perl net-toos
**新建目录上传mysql **
上传后解压:tar -xvf xxx
安装
1执行:rpm -ivh mysql-community-common-8.0.29-1.el7.x86_64.rpm
2执行:rpm -ivh mysql-community-client-plugins-8.0.29-1.el7.x86_64.rpm
3执行: rpm -ivh mysql-community-libs-8.0.29-1.el7.x86_64.rpm
4执行:rpm -ivh mysql-community-client-8.0.29-1.el7.x86_64.rpm
5执行:rpm -ivh mysql-community-icu-data-files-8.0.29-1.el7.x86_64.rpm
6执行:rpm -ivh mysql-community-server-8.0.29-1.el7.x86_64.rpm
查看状态
service mysqld status
启动
service mysqld start
再次查看状态
service mysqld status
查看临时密码
mysql第一次启动,临时密码,在 /var/log/mysqld.log 中
执行:grep password /var/log/mysqld.log
修改密码
1.登录mysql -u root -p
2.输入临时密码
3.ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘Root_123456’;
设置远程访问
1use mysql;
2update user set host =‘%’ where user=‘root’;
3刷新权限:flush privileges;
远程链接,关闭防火墙/开启端口
远程访问配置:执行: use mysql;
执行:update user set host = ‘%’ where user = ‘root’;
刷新权限:flush privileges;
关闭防火墙:systemctl stop firewalld.service / systemctl stop iptables.service
进制防火墙开机启动:systemctl disable firewalld.service /systemctl disable iptables.service
设置简单密码
1登录
2查看密码策略:SHOW VARIABLES LIKE ‘validate_password%’;
3设置只检查长度:set global validate_password.policy=LOW;
4设置长度x: set global validate_password.length=X;
5设置密码:ALTER USER ‘root’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘密码’;
6刷新权限:flush privileges
mysql命令
查看状态:service mysqld status
启动:service mysqld start
重启:service mysqld restart
停止:service mysqld stop
登录:mysql -u root -p —>输入密码
退出
exit/quit
链接: https://blog.csdn.net/awxnn/article/details/127867466
链接: https://blog.csdn.net/awxnn/article/details/129625081
下载
官网下载
解压
tar -zxvf nginx-1.xx.x.tar.gz
安装依赖
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl-devel
安装nginx
编译安装
# 切换至 nginx 的解压目录
cd /xxx/nginx-1.18.0
# 创建 nginx 的安装目录
mkdir -p /usr/local/xxx/nginx
# 指定 nginx 的安装路径
./configure --prefix=/usr/local/xxx/nginx/
# 编译并安装
make && make install
查看版本
sbin/nginx -v
启动
启动并通过 -c 指定启动时加载的配置文件,默认加载 conf/nginx.conf
sbin/nginx -c /xxx/nginx/conf/nginx.conf
** 配置负载均衡**
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# 访问的集群地址, weight代表着权重,值越大代表着访问的优先级越高
upstream tomcat{
server 192.168.85.131:81 weight=4;
server 192.168.85.131:82 weight=3;
server 192.168.85.131:83 weight=3;
}
server {
listen 80; # nginx的端口
server_name localhost; # nginx的ip
#charset koi8-r;
#access_log logs/host.access.log main;
# 访问之后跳转地址
location / {
# root html;
# index index.html index.htm;
proxy_pass http://tomcat; # 代表访问nginx后跳转的地址
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}