啟動 docket image for testing
#docker run -d --sysctl net.ipv6.conf.all.disable_ipv6=1 --name test -p 20022:22 centos7ssh /usr/sbin/sshd -D
#docker run -d --name test -p 20022:22 centos7ssh /usr/sbin/sshd -D
docker run -d -p 10022:22 -e "container=docker" --privileged=true -v /sys/fs/cgroup:/sys/fs/cgroup --name test centosssh /usr/sbin/init
docker exec -it test /bin/bash
Preparation
安裝 libraries
# wxWidget library
yum -y install gtk2-devel binutils-devel
yum -y install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf git bzip2
# 先裝 OpenGL 相關函式庫,FOP是用來產生文件
yum -y install mesa* fop unixODBC*
download OTP, wxWidget source
wget https://erlang.org/download/otp_src_23.3.tar.gz
#wget https://erlang.org/download/otp_src_24.0.tar.gz
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.5/wxWidgets-3.1.5.tar.bz2
wxWidgets
yum remove wx*
設定 lib path,新增檔案並填寫一行 /usr/local/lib
vi /etc/ld.so.conf.d/locallib.conf
# 內容為
/usr/local/lib
ldconfig
note: 後面有因為一些狀況,重新編譯 wxWidgets
tar -jxvf wxWidgets-3.1.5.tar.bz2
cd wxWidgets-3.1.5
./configure --with-gtk --with-opengl --enable-debug --enable-unicode --enable-compat28
make
make install
ln -s /usr/local/include/wx-3.1/ /usr/local/include/wx
cd ..
openjdk
# 1.8
#yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel
# 11
yum -y install java-11-openjdk java-11-openjdk-devel
以 alternatives 調整執行檔的目標
alternatives --config java
alternatives --config javac
alternatives --config javadoc
alternatives --config javah
alternatives --config javap
設定環境變數
vi /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-openjdk
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
erlang OTP 23
如果不指定 --libdir
會造成 /usr/lib/erlang/lib
裡面的 library 混雜了不同版本的 erlang library,使用時,有可能會發生 ebeam 版本檢查錯誤,因為使用 otp 23 的 erl,但是引用了 otp 24 的 library
tar zxvf otp_src_23.3.tar.gz
cd otp_src_23.3
# 先將 /usr/lib/erlang 目錄,修改為原本的 erlang otp 的獨立資料夾
mv /usr/lib/erlang /usr/lib/erlang20.3
# 增加 --libdir,會讓 erlang 23 安裝到 /usr/lib/erlang23/erlang 這個路徑
#./configure --prefix=/usr --libdir=/usr/lib/erlang23
./configure --prefix=/usr
make
make install
cd ..
erlang OTP 24
tar zxvf otp_src_24.0.tar.gz
cd otp_src_24.0
# 先將 /usr/lib/erlang 目錄,修改為原本的 erlang otp 的獨立資料夾
mv /usr/lib/erlang /usr/lib/erlang23.3
# 增加 --libdir,會讓 erlang 24 安裝到 /usr/lib/erlang24/erlang 這個路徑
#./configure --prefix=/usr --libdir=/usr/lib/erlang24
./configure --prefix=/usr
make
make install
cd ..
編譯 OTP 24 會出現 error
wx : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
erts :
JIT disabled due to lack of compiler with C++17 support
Patch1: 要重編譯 wxWidget,且要先安裝 webkitgtk
# 安裝 nux repo
yum -y install epel-release
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum -y install webkitgtk webkitgtk-devel
# --enable-webview
cd wxWidgets-3.1.5
./configure --with-gtk --with-opengl --enable-debug --enable-unicode --enable-compat28 --enable-webview
make
make install
cd ..
Patch2: JIT 支援問題,要安裝 GCC 7.3 支援 C++17
可不管 JIT disabled due to lack of compiler with C++17 support
warning,直接 make
Centos 7 GCC 7.3 compiler installation method and C++17 standard test example
How to Install GCC Compiler on CentOS 7
CentOS 7 預設為 gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Software Collections SCL 提供安裝多個 gcc 版本的方法
yum -y install centos-release-scl
目前有兩個 Developer Toolset collections
- Developer Toolset 7
- Developer Toolset 6
# 安裝
yum -y install devtoolset-7
# 啟動 devtoolset-7
scl enable devtoolset-7 bash
# version check
gcc --version
# gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
RabbitMQ
如果要安裝 RabbitMQ,要先參考
RabbitMQ Erlang Version Requirements 確認 Erlang 跟 RabbitMQ 的版本匹配
Downloading and Installing RabbitMQ
yum install socat
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.19/rabbitmq-server-3.8.19-1.el7.noarch.rpm
rpm --nodeps -Uvh rabbitmq-server-3.8.19-1.el7.noarch.rpm
rabbitmq-plugins enable rabbitmq_management
http://localhost:15672/
#新增一個帳號
rabbitmqctl add_user admin password
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
rabbitmqctl set_user_tags admin administrator
rabbitmqctl delete_user guest
rabbitmqctl list_users
systemctl start rabbitmq-server
systemctl status rabbitmq-server
systemctl enable rabbitmq-server
沒有留言:
張貼留言