centos安装各种依赖简记
1.安装jdk(版本可以自己换,自行下载然后ftp到服务器,后面的目录也可自行更换)
1.把jre.tar.gz解压后放到/opt/jdk目录下,命令tar -zxvf
2.jre目录授予root权限 chown root:root -R /opt/jdk/jdk1.8.0_131/
3.配置环境变量 vi /etc/profile 在末尾加上
export JAVA_HOME=/opt/jdk
export JRE_HOME=/opt/jdk/jdk1.8.0_131
export CLASSPATH=$JRE_HOME/lib/rt.jar:$JRE_HOME/lib/ext
export PATH=$PATH:$JRE_HOME/bin
4.使环境变量即时生效source /etc/profile
5.测试 java -version、java、javac
2.安装Tomcat(版本可以自己换,自行下载然后ftp到服务器,后面的目录也可自行更换)
1.解压apache-tomcat的tar.gz文件,将解压后的apache-tomcat软件放到/opy/tomcat目录下,命令tar -zxvf
2.修改server.xml配置修改端口8081
3.启动tomcat,能正常访问即可(bin/startup)
3.
安装activemq
(版本可以自己换,后面的目录也可自行更换)
1.进入/opt/activemq
2.wget
http://archive.apache.org/dist/activemq/5.14.5/apache-activemq-5.14.5-bin.tar.gz
3.解压tar.gz
4.进入bin目录 启动 ./activemq start
5.查看进程 ps -ef| grep activemq
4.安装nginx
yum install -y gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
wget -c
https://nginx.org/download/nginx-1.14.0.tar.gz
tar -zxvf nginx-1.14.0.tar.gz
cd nginx-1.14.0
./configure –prefix=/opt/nginx –with-http_ssl_module
make
make install
whereis nginx
5.安装redis
查看我以前的博客
centos安装redis_取个昵称要人命的博客-CSDN博客
6.安装rabbitmq
7.安装 vsftp
yum -y install vsftpd
systemctl enable vsftpd
systemctl start vsftpd.service
systemctl start firewalld
firewall-cmd –zone=public –add-port=21/tcp –permanent
firewall-cmd –permanent –zone=public –add-service=ftp
firewall-cmd –reload
useradd -g root -d /opt/uploadFile -s /sbin/nologin uper
passwd uper
chown -R uper:root /opt/uploadFile
vi /etc/vsftpd/vsftpd.conf 把 anonymous_enable=YES 改为 NO
8.安装mysql(也可以docker更简单)
1.w
get
https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
下载源安装包
2.yum -y localinstall mysql57-community-release-el7-11.noarch.rpm 安装mysql源
3.
yum -y install mysql-community-server 在线安装mysql
,
下载东西很多要等会
4.
systemctl start mysqld 启动mysql服务
5.systemctl enable mysqld
设置开机启动
然后 systemctl daemon-reload
6.修改root本地登录密码
vi /var/log/mysqld.log
查看临时密码 复制好
mysql -u root -p
然后输入临时密码
mysql
>
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘
新密码
‘;
7.设置允许远程登录
mysql
>
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘
新密码
‘ WITH GRANT OPTION;
E
xit 退出mysql
firewall-cmd –zone=public –add-port=3306/tcp –permanent
firewall-cmd –reload
开放3306端口
8.配置默认编码为utf8
vi /etc/my.cnf
在
[mysqld]
下添加
character_set_server=utf8
init_connect=’SET NAMES utf8′
然后重启服务
systemctl restart mysqld
查看下编码:mysql>
show variables like ‘%character%’;
9.测试 自己用Navicat去连
1. vim /etc/yum.repos.d/mongodb-org-4.0.repo //生成mongodb的源
2. #添加以下内容:
[mongodb-org-4.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/ gpgcheck=0 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
3. yum -y install mongodb-org //安装mongodb
4. mkdir -p /data/db //创建数据文件夹
5. systemctl start mongod.service //启动服务
6. vi /etc/mongod.conf //修改配置文件,执行7、8、9步骤
7. 将bindIp改为: 0.0.0.0
8. security:
authorization: “enabled” //修改为需要认证
9. 修改端口(27018) //我这里改了,其实改不改随意,然后保存
10. sudo service mongod restart //重启mongodb
11. mongo 127.0.0.1:27018 //连接mongodb
12. use admin //使用admin数据库
13. db.createUser({user: ‘root’,pwd: ‘123456’,roles:[{role: ‘root’,db: ‘admin’}]}) //创建用户
14. db.auth(”root”,”123456”) //认证,注意这里要用双引号
15. sudo chkconfig mongod on //设置开机启动