CentOS from scratch to build wxWidgets, erlang, RabbitMQ (single version) (absolute scratch to build ultra-detailed)

Foreword

This article is mainly aboutRabbitMQinstallation

1, the installation environment wxWidgets

  • Since rabbitmq is written in erlang, before installing rabbitmq, you need to install erlang, you need to install before installing wxWidgets erlang, you need to install before installing wxWidgetsgtk2-develversusbinutils-devel, Ado quickly get started .
    • First, let's update the system
      yum update
      
    • Install wxWidgets related dependency, do not install this will be reported the following error
      yum -y install gtk2-devel binutils-devel
      
      Error contents:
      checking for GTK+ version... 
      checking for pkg-config... /usr/bin/pkg-config
      checking for GTK+ - version >= 2.6.0... no
      *** Could not run GTK+ test program, checking why...
      *** The test program failed to compile or link. See the file config.log for the
      *** exact error that occurred. This usually means GTK+ is incorrectly installed.
      checking for pkg-config... (cached) /usr/bin/pkg-config
      checking for GTK+ - version >= 3.0.0... no
      *** Could not run GTK+ test program, checking why...
      *** The test program failed to compile or link. See the file config.log for the
      *** exact error that occured. This usually means GTK+ is incorrectly installed.
      checking for gtk-config... no
      checking for GTK - version >= 1.2.7... no
      *** The gtk-config script installed by GTK could not be found
      *** If GTK was installed in PREFIX, make sure PREFIX/bin is in
      *** your path, or set the GTK_CONFIG environment variable to the
      *** full path to gtk-config.
      checking for gtk-config... (cached) no
      checking for GTK - version >= 1.2.3... no
      *** The gtk-config script installed by GTK could not be found
      *** If GTK was installed in PREFIX, make sure PREFIX/bin is in
      *** your path, or set the GTK_CONFIG environment variable to the
      *** full path to gtk-config.
      configure: error: 
      The development files for GTK+ were not found. For GTK+ 2, please
      ensure that pkg-config is in the path and that gtk+-2.0.pc is
      installed. For GTK+ 1.2 please check that gtk-config is in the path,
      and that the version is 1.2.3 or above. Also check that the
      libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
      --libs' are in the LD_LIBRARY_PATH or equivalent.
      
    • Since erlang rely wxWidgets, we download the installation package download wxWidgets, wxWidgets version is 2.8.4 or later, here we download the latest version 3.1.3 version, intended to build use Thunder download
      wxWidgets official website Download
      wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.3/wxWidgets-3.1.3.tar.bz2
      
    • Create a folder wxWidgets installation path
      mkdir -p /usr/local/wxWidgets
      
    • Decompression wxWidgets
      tar -xvf wxWidgets-3.1.3.tar.bz2
      
    • Enter wxWidgets directory
      cd wxWidgets-3.1.3/
      
    • Compile wxWidgets
      ./configure --with-regex=builtin --with-gtk --enable-unicode --disable-shared --prefix=/usr/local/wxWidgets
      
    • Start the installation wxWidgets,Wait for the process is very longI once thought it was abnormal message is displayed (in fact, no anomalies appear, just compile files), anywayWe must wait patiently compiled file, Stop in the middle of an exception, appear in the following figure, says the installation was successful,
      make && make install
      
    wx successful installation
    • Ready to set its dynamic library
      cd /etc/ld.so.conf.d/
      
    • Create a file
      touch wxWidgets.conf
      
    • open a file
      vim wxWidgets.conf
      
    • Add the following
      /usr/local/lib
      
    • Reload the dynamic library configuration
      ldconfig
      
    • WxWidgets configuration environment variable =
      vim /etc/profile
      
    • The following profile is stored to a file, save and exit
      export WXPATH=/usr/local/wxWidgets/
      export PATH=$WXPATH/bin:$PATH
      
    • And refresh the environment variables to take effect
      source /etc/profile
      
    • View wx version number
      wx-config --version
      

View wxWidgets version

2, install java development environment

  • Check our JDK

    java version
    Check the JDK

  • If not, install the following command

    Browse JDK version
    yum -y list java *
    choose your own version of the installation, I chose 1.8, 1.9 and 1.9 can not select or later, because Elasticsearch does not support
    yum install java-1.8.0-openjdk- devel.x86_64
    installed by yum the location jdk / usr / lib / jvm

  • Began to set environment variables

    vim / etc / profile
    then the lowermost portion of the document enter the following code, save and exit

    export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64
    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$PATH:$JAVA_HOME/bin
    
  • We completed the installation of the JDK

3, start the installation related dependencies erlang

  • At this moment, I seem to relieve a sigh of relief, because when you see here, I haveInstallation failed six timesThe
    • Start the installation related dependencies erlang
      yum install -y epel-release
      
      yum install -y make gcc gcc-c++ m4 openssl openssl-devel ncurses-devel unixODBC unixODBC-devel java java-devel
      
    • Since the Rabbit-3.8.2 version only supports erlang version 21.3 to 22.x [], and yum source only version 3.3, so we downloaded erlang / otp-22.2 compression package, and then point out, hard to find erlang Download I look for an hour, there will be accompanied by erlang Download
      wget http://erlang.org/download/otp_src_22.2.tar.gz
      
      Here Insert Picture Description
      Download erlang version of the list (old slow load times, and if it is not loaded, and the page stops loading small partner, please be patient, refresh it again, if that does not work, the more refreshed several times.)
      erlang list
    • To decompress compressed package erlang to opt directory
      tar -xvf otp_src_22.2.tar.gz -C /opt
      
    • Create a directory erlang
      mkdir -p /usr/local/erlang
      
    • Into the extracted directory
      cd /opt/otp_src_22.2/
      
    • Began to compile erlang ( do not enter the unzipped it does not matter ), there will be after the completion of the following figure. He warned about the matter.
      /opt/otp_src_22.2/configure --prefix=/usr/local/erlang
      
      Compiled
    • Install erlang, the installation process is relatively long, please be patient, after the successful installation as shown below
      make && make install
      
      erlang successful installation
    • Modify environment variables
      vim /etc/profile
      
    • The following profile is stored to a file, save and exit
      export ERLPATH=/usr/local/erlang
      export PATH=$ERLPATH/bin:$PATH
      
    • And refresh the environment variables to take effect
      source /etc/profile
      
    • Erlang verify whether the installation is successful, the content in the following figure appears to indicate a successful build
      erl
      

erlang successful installation
* Until now environment variables written presentation
Environment Variables

4、获最新版本的RabbitMQ安装包

  • 由于使用yum命令获取RabbitMQ版本列表,只能获取到3.3.5版本,所以这里我们采用压缩包的形式安装最新版-3.8.2版本
    • 首先,我们将当前位置移动至opt目录下
      cd /opt
      
    • 开始下载RabbitMQ-3.8.2压缩包
      wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.2/rabbitmq-server-generic-unix-3.8.2.tar.xz
      
    • 不好意思啊,我这边github上下载太慢了,我直接用迅雷下载了,地址给你们附上
      https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.2/rabbitmq-server-generic-unix-3.8.2.tar.xz
      
      RabbitMQ的GitHub相关页面

5、开始搭建RabbitMQ环境

  • 这里没有标题
    • 对压缩包进行解压
      tar -xvf rabbitmq-server-generic-unix-3.8.2.tar.xz
      
    • 此时我们RabbitMQ的安装位置在【/opt/rabbitmq_server-3.8.2】,现在我们准备添加环境变量
      vim /etc/profile
      
    • 将以下内容存储至profile文件中,保存并退出,这个环境变量要是不想设置也每关系,直接去文件里运行文件即可
      PATH=$PATH:/opt/rabbitmq_server-3.8.2/sbin
      
    • 使环境变量刷新并生效
      source /etc/profile
      
    • 添加web管理插件,添加成功后如下图所示
      rabbitmq-plugins enable rabbitmq_management
      
      Add web management plug
    • 在/opt/rabbitmq_server-3.8.2/etc/rabbitmq创建配置文件(其实也不用创建,设置为默认即可,因为我们现在是单机环境搭建),rabbitMq默认是不自带配置文件的,可以去github上复制一份
    • RabbitMQ配置文件下载
      vim /opt/rabbitmq_server-3.8.2/etc/rabbitmq/rabbitmq.conf
      
    • 输入你需要修改的内容,保存并退出

6、 开启端口或关闭防火墙

  • 临时关闭防火墙命令
    systemctl stop firewalld
    

  • 开启相关端口(推荐)
    firewall-cmd --zone=public --add-port=5672/tcp --permanent
    firewall-cmd --zone=public --add-port=15672/tcp --permanent
    
  • 更新防火墙规则
    firewall-cmd --complete-reload
    
  • 查看当前所开放的端口
    firewall-cmd --zone=public --list-ports
    					
    

7、启动RibbitMQ

  • 后台启动RibbitMQ

    rabbitmq-server start -detached
    
  • 其他命令

    启动
    rabbitmq-server stop
    状态
    rabbitmq-server status

8、进入RibbitMQ管理界面

127.0.0.1:15672

发布了24 篇原创文章 · 获赞 3 · 访问量 3974

Guess you like

Origin blog.csdn.net/gfk3009/article/details/104646345