CentOS下环境搭建

  • 介绍

本文介绍如何在CentOS中安装程序,搭建环境。

  • Java

yum search java-1.8

yum install java-1.8.0-openjdk-devel.x86_64

  • MySQL

yum search mysql-server

yum install -y mysql-server

/etc/init.d/mysqld restart

  • Nginx

vim /etc/yum.repos.d/nginx.repo

yum install nginx -yN

  • Redis

https://redis.io/download

yum install -y gcc

yum install -y autoconf

make MALLOC=libc

make install

cd utils

./install-server.sh

修改密码,找到配置文件/etc/redis/6379.conf中的requirepass,然后去掉前面的注释。

/etc/init.d/redis_6379 restart

  • RabbitMQ

根据您的CentOS版本选择不同的安装包:http://www.rabbitmq.com/download.html

wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm

rpm -Uvh erlang-solutions-1.0-1.noarch.rpm

yum -y install erlang

wget –no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo

yum install -y socat

rpm -i rabbitmq-server-3.6.10-1.el6.noarch.rpm

启动服务 /etc/init.d/rabbitmq-server start

启用插件 rabbitmq-plugins enable rabbitmq_management

添加用户 rabbitmqctl add_user root root

设置用户组 rabbitmqctl set_user_tags root administrator

设置virtual hosts给用户权限 rabbitmqctl set_permissions -p “/” root “.” “.” “.*”

访问 http://192.168.81.41:15672/

  • 参考

本文为原创,如果您当前访问的域名不是surenpi.com,请访问“素人派”。

发表评论

电子邮件地址不会被公开。 必填项已用*标注