阿里云服务器基本环境配置
I. RabbitMQ安装
1. 安装
1 2 3
| yum install erlang wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.15/rabbitmq-server-3.6.15-1.el6.noarch.rpm yum install rabbitmq-server-3.6.15-1.el6.noarch.rpm
|
2. 插件开启
1 2 3
| rabbitmq-plugins enable rabbitmq_management
rabbitmq-server -detached
|
3. 权限设置
1 2 3
| rabbitmqctl add_user admin xxx12345 rabbitmqctl set_user_tags admin administrator rabbitmqctl set_permissions -p / admin '.*' '.*' '.*'
|
4. 添加虚拟目录
1 2 3 4 5 6 7 8 9 10
| rabbitmqctl add_vhost test1 rabbitmqctl add_vhost test2 rabbitmqctl add_vhost test3 rabbitmqctl add_vhost test4
rabbitmqctl set_permissions -p test1 admin '.*' '.*' '.*' rabbitmqctl set_permissions -p test2 admin '.*' '.*' '.*' rabbitmqctl set_permissions -p test3 admin '.*' '.*' '.*' rabbitmqctl set_permissions -p test4 admin '.*' '.*' '.*'
|
5. rabbitmq服务启动关闭
1 2 3 4 5 6
| rabbitmqctl stop
rabbitmq-server -detached
rabbitmqctl status
|
6. 说明
- 在服务启动之后,再执行开启rabbitmq插件,新增virtual host等操作
- 控制台默认端口号为:
15672
- 阿里云服务器查看控制台需要在安全组中添加端口号的访问
II. redis 安装
1. 安装
1 2 3 4 5
| wget http://download.redis.io/releases/redis-4.0.6.tar.gz tar -zxvf redis-4.0.6.tar.gz cd redis-4.0.6 make make install
|
2. 配置
配置文件配置,实现单台机器上运行多个redis实例
1 2 3 4 5 6
| mkdir rediscluster cd rediscluster mkdir one two cd .. cp redis-4.0.6/redis.con rediscluster/one/ cp redis-4.0.6/redis.con rediscluster/two/
|
修改redis.conf文件
1 2 3 4 5 6 7 8 9 10 11 12
| # 设置密码 requirepass xxx
# 修改端口号 port 6110
# 后台启动 daemonize yes
# 外网访问,注释bind protected-mode yes bind 127.0.0.1
|
3. 注意
- 阿里云服务器,redis的外网访问,同样需要设置安全组
- 请不要使用默认端口号,记得一定设置密码
III. mysql
1. 下载安装
1 2 3 4 5 6 7 8 9 10 11
| wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm rpm -ivh mysql57-community-release-el7-8.noarch.rpm yum -y install mysql-server
service mysqld restart
grep "password" /var/log/mysqld.log
alter user 'root'@'localhost' identified by 'SubscribeXhhBlog!' flush privileges
|
2. 添加用户
1 2
| alter user 'root'@'localhost' identified by 'SubscribeXhhBlog!'; create user 'xhh'@'%' IDENTIFIED BY 'SubscribeXhhBlog!!';
|
授予权限
1 2 3
| grant all PRIVILEGES on xhh.* to 'xhh'@'%' IDENTIFIED by 'SubscribeXhhBlog!'; flush privileges;
|
IV. java环境
1. 安装
1 2 3 4 5 6 7 8
| wget http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz?AuthParam=1529400028_058a3f3fdf9c78aa6502a6e91edfb1d2
tar -zxvf jdk-8u171-linux-x64.tar.gz?AuthParam=1529400028_058a3f3fdf9c78aa6502a6e91edfb1d2
mv jdk-8u171-linux-x64 /usr/local/java/
|
2. 配置
进入配置文件 : vi /etc/profile
1 2 3 4 5
| export JAVA_HOME=/usr/local/java/jdk1.8.0_171 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
|
应用 source /etc/profile
测试 java | javac
V. 其他
一灰灰的个人博客,记录所有学习和工作中的博文,欢迎大家前去逛逛
2. 声明
尽信书则不如,已上内容,纯属一家之言,因个人能力有限,难免有疏漏和错误之处,如发现bug或者有更好的建议,欢迎批评指正,不吝感激
3. 扫描关注