1、添加CentOS 7 Nginx yum资源库
[root@localhost ~]# rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2、安装nginx
[root@localhost ~]# yum -y install nginx //安装nginx
3、启动nginx
[root@localhost ~]# systemctl start nginx //启动nginx
4、安装完成,可以在浏览器访问到如下页面即为成功
5、yum方式安装的默认地址和配置的默认地址
/etc/nginx/nginx.conf //yum方式安装后默认配置文件的路径 /usr/share/nginx/html //nginx网站默认存放目录 /usr/share/nginx/html/index.html //网站默认主页路径
拓展:
nginx基本操作
[root@localhost ~]# yum -y instal nginx //安装nginx [root@localhost ~]# service nginx start //启动nginx [root@localhost ~]# service nginx stop //停止nginx [root@localhost ~]# service nginx reload //重载nginx [root@localhost ~]# ps -ef | grep nginx //查看进程apache/httpd [root@localhost ~]# netstat -anpl | grep 'nginx' //查看服务端口 [root@localhost ~]# rpm -Uvh http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.18.0-1.el7.ngx.x86_64.rpm // rpm方式升级并安装某个版本的Nginx
查看当前yum仓库是否包含mysql-server相关包,如果提示no match found 则仓库没有相应包
[root@localhost ~]# yum whatprovides mysql-server
[root@localhost ~]# wget http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm
[root@localhost ~] rpm -ivh mysql57-community-release-el7-10.noarch.rpm
[root@localhost ~]# yum -y install mysql-server
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering "
Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package : mysql57-community-release-el7-10.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm is not installed
Failing package is: mysql-community-libs-compat-5.7.37-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
可能出现如上错误,这个报错是指mysql密钥过期了,需要更新一下密钥,更新完密钥之后,重新安装即可。
[root@localhost ~]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 //更新密钥
[root@localhost ~]# yum -y install mysql-server
[root@localhost ~]# systemctl enable mysqld //设置开机自启动
[root@localhost ~]# systemctl start mysqld //启动mysql
[root@localhost ~]# systemctl status mysqld //查看mysql状态
[root@localhost ~]# systemctl restart mysqld //重启mysql
[root@localhost ~]# cat /var/log/mysqld.log |grep password
[root@localhost ~]# mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssword123';
GRANT ALL PRIVILEGES ON *.* TO 'bigdata'@'%' IDENTIFIED BY 'P@ssword123' WITH GRANT OPTION;
GRANT select,Insert,UPDATE,delete ON *.* TO 'test1'@'%' IDENTIFIED BY 'P@ssword123' WITH GRANT OPTION;
GRANT select,Insert,UPDATE,delete ON *.* TO 'test2'@'%' IDENTIFIED BY 'P@ssword123' WITH GRANT OPTION;
可以配置忽略大小写,以及groupBy
配置文件:/etc/my.cnf
日志文件: /var/log/mysqld.log
服务启动脚本: /usr/lib/systemd/system/mysqld.service
socket文件: /var/run/mysqld/mysqld.pid
[root@localhost ~]# yum install epel-release -y
[root@localhost ~]# yum install redis -y
[root@localhost ~]# systemctl start redis
[root@localhost ~]# systemctl status redis //查看服务状态
[root@localhost ~]# systemctl stop redis //停止服务
[root@localhost ~]# systemctl restart redis //重启服务
[root@localhost ~]# ps -ef | grep redis //查看reids服务信息
[root@localhost ~]# systemctl enable redis redis //开机启动
[root@localhost ~]# vim /etc/redis.conf 如果没有vim先yum install -y vim
#bind 127.0.0.1
protected-mode no
daemonize yes
requirepass Dd123=123
安装JDK1.8
1.下载JDK安装包
[root@localhost ~]wget https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz
[root@localhost ~]tar -zxvf jdk-8u202-linux-x64.tar.gz
[root@localhost home]# vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8 export
CLASSPATH=.:%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar export
PATH=$PATH:$JAVA_HOME/bin
https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz
[root@localhost home]# source /etc/profile
出现以下结果说明成功
[root@localhost home]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)