apt-get install ipmitool
使用 DHCP
ipmitool lan set 1 ipsrc dhcp
使用固定 IP
ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 192.168.10.60
ipmitool lan set 1 netmask 255.255.254.0
ipmitool lan set 1 defgw ipaddr 192.168.10.1
2019年9月26日 星期四
2019年9月6日 星期五
CentOS7 安裝 Bacula 9.x
安裝 MariaDB 及編譯環境
yum install gcc gcc-c++ libacl-devel lzo-devel mt-st mtx openssl-devel readline-devel zlib-devel make -y
yum install wget mariadb-server mysql-devel -y
下載 Bacula 9.x
wget https://nchc.dl.sourceforge.net/project/bacula/bacula/9.4.4/bacula-9.4.4.tar.gz
設定編輯 Bacula 9.x
tar zxvf bacula-9.4.4.tar.gz
cd bacula-9.4.4
./configure --prefix=/opt/bacula --with-scriptdir=/opt/bacula/scripts --with-mysql
make;make install;make install-autostart
設定 Mariadb
systemctl enable mariadb
systemctl start mariadb
echo -e "\nn\n\n\n\n\n\n" | mysql_secure_installation
/opt/bacula/scripts/create_mysql_database
/opt/bacula/scripts/make_mysql_tables
/opt/bacula/scripts/grant_mysql_privileges
啟動 Bacula 測試
/opt/bacula/sbin/bacula start
使用 Systemd 服務
cat < /etc/systemd/system/bacula.service
[Unit]
Description=Bacula backup service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/bacula/sbin/bacula start
ExecReload=/opt/bacula/sbin/bacula reload
ExecStop=/opt/bacula/sbin/bacula stop
[Install]
WantedBy=multi-user.target
EOF
chmod a+x /etc/systemd/system/bacula.service
systemctl daemon-reload
systemctl start bacula.service
安裝 baculum
rpm --import http://bacula.org/downloads/baculum/baculum.pub
echo "
[baculumrepo]
name=Baculum CentOS repository
baseurl=http://bacula.org/downloads/baculum/stable/centos
gpgcheck=1
enabled=1
[baculumrepo]
name=Baculum Fedora repository
baseurl=http://bacula.org/downloads/baculum/stable/fedora
gpgcheck=1
enabled=1" > /etc/yum.repos.d/baculum.repo
yum install -y baculum-common baculum-api baculum-api-httpd baculum-web baculum-web-httpd sudo
echo "Defaults:apache "'!'"requiretty
apache ALL=NOPASSWD: /usr/sbin/bconsole
apache ALL=NOPASSWD: /usr/sbin/bdirjson
apache ALL=NOPASSWD: /usr/sbin/bsdjson
apache ALL=NOPASSWD: /usr/sbin/bfdjson
apache ALL=NOPASSWD: /usr/sbin/bbconsjson" > /etc/sudoers.d/baculum
chown -R apache /opt/bacula/etc
systemctl enable httpd.service
systemctl restart httpd.service
連線測試 帳號 admin/admin
http://ip:9095
http://ip:9096
yum install gcc gcc-c++ libacl-devel lzo-devel mt-st mtx openssl-devel readline-devel zlib-devel make -y
yum install wget mariadb-server mysql-devel -y
下載 Bacula 9.x
wget https://nchc.dl.sourceforge.net/project/bacula/bacula/9.4.4/bacula-9.4.4.tar.gz
設定編輯 Bacula 9.x
tar zxvf bacula-9.4.4.tar.gz
cd bacula-9.4.4
./configure --prefix=/opt/bacula --with-scriptdir=/opt/bacula/scripts --with-mysql
make;make install;make install-autostart
設定 Mariadb
systemctl enable mariadb
systemctl start mariadb
echo -e "\nn\n\n\n\n\n\n" | mysql_secure_installation
/opt/bacula/scripts/create_mysql_database
/opt/bacula/scripts/make_mysql_tables
/opt/bacula/scripts/grant_mysql_privileges
啟動 Bacula 測試
/opt/bacula/sbin/bacula start
使用 Systemd 服務
cat <
[Unit]
Description=Bacula backup service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/bacula/sbin/bacula start
ExecReload=/opt/bacula/sbin/bacula reload
ExecStop=/opt/bacula/sbin/bacula stop
[Install]
WantedBy=multi-user.target
EOF
chmod a+x /etc/systemd/system/bacula.service
systemctl daemon-reload
systemctl start bacula.service
echo "
[baculumrepo]
name=Baculum CentOS repository
baseurl=http://bacula.org/downloads/baculum/stable/centos
gpgcheck=1
enabled=1
[baculumrepo]
name=Baculum Fedora repository
baseurl=http://bacula.org/downloads/baculum/stable/fedora
gpgcheck=1
enabled=1" > /etc/yum.repos.d/baculum.repo
yum install -y baculum-common baculum-api baculum-api-httpd baculum-web baculum-web-httpd sudo
echo "Defaults:apache "'!'"requiretty
apache ALL=NOPASSWD: /usr/sbin/bconsole
apache ALL=NOPASSWD: /usr/sbin/bdirjson
apache ALL=NOPASSWD: /usr/sbin/bsdjson
apache ALL=NOPASSWD: /usr/sbin/bfdjson
apache ALL=NOPASSWD: /usr/sbin/bbconsjson" > /etc/sudoers.d/baculum
chown -R apache /opt/bacula/etc
systemctl enable httpd.service
systemctl restart httpd.service
連線測試 帳號 admin/admin
http://ip:9095
http://ip:9096
2019年9月3日 星期二
Proxmox LXC ubuntu 18.x 安裝 x windows desktop
apt-get install ubuntu-desktop
Gnome 3
apt-get install gnome-shell
Kubuntu (KDE)
apt-get install kubuntu-desktop
XFCE
apt-get install xfce4
LXDE
apt-get install lxde
Openbox
apt-get install openbox
Gnome 2
apt-get install gnome-session-fallback
Ubuntu Gnome (Official flavor)
apt install ubuntu-gnome-desktop
Gnome 3
apt-get install gnome-shell
Kubuntu (KDE)
apt-get install kubuntu-desktop
XFCE
apt-get install xfce4
LXDE
apt-get install lxde
Openbox
apt-get install openbox
Gnome 2
apt-get install gnome-session-fallback
Ubuntu Gnome (Official flavor)
apt install ubuntu-gnome-desktop
2019年9月2日 星期一
CentOS 7 Python Virtualenv 摘要
環境
每個專案擁有一個獨立的環境,可以使用不同版本的套件,套件版本升級時不會影響到其他的專案。
pip/pip3 安裝的套件會被放在虛擬環境中,安裝套件或異動時,不須特別權限。
CentOS 7 python 3 環境設定及使用
yum install centos-release-scl -y
yum install rh-python36 -y
scl enable rh-python36 bash
python3 -m venv venv
source venv/bin/activate
CentOS 7 python 2 環境設定及使用
yum install -y epel-release
yum install -y python-pip
pip install --upgrade pip
pip install --upgrade virtualenv
python -m virtualenv 01 #建立環境
source 01/bin/activate #進入環境
每個專案擁有一個獨立的環境,可以使用不同版本的套件,套件版本升級時不會影響到其他的專案。
pip/pip3 安裝的套件會被放在虛擬環境中,安裝套件或異動時,不須特別權限。
CentOS 7 python 3 環境設定及使用
yum install centos-release-scl -y
yum install rh-python36 -y
scl enable rh-python36 bash
python3 -m venv venv
source venv/bin/activate
CentOS 7 python 2 環境設定及使用
yum install -y epel-release
yum install -y python-pip
pip install --upgrade pip
pip install --upgrade virtualenv
python -m virtualenv 01 #建立環境
source 01/bin/activate #進入環境
deactivate #離開指令
CentOS 7 安裝 python3
yum install centos-release-scl -y
yum install rh-python36 -y
使用
scl enable rh-python36 bash
結束
exit
yum install rh-python36 -y
使用
scl enable rh-python36 bash
結束
exit
訂閱:
文章 (Atom)