So, what we have?
Freshly installed Centos 7 and root access.
Steps need to be done:
yum -y update
yum localinstall -y https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
yum --disablerepo=mysql80-community --enablerepo=mysql57-community install mysql-community-server mysql-devel
systemctl start mysqld.service
systemctl enable mysqld.service
grep 'A temporary password is generated for root@localhost' /var/log/mysqld.log | tail -1
/usr/bin/mysql_secure_installation
#set new secure passwordmysql -uroot -p -e "CREATE DATABASE redmine CHARACTER SET utf8; CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'yourpassword'; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';" #don't forget set secure password
systemctl restart mysqld.service
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel sqlite-devel ImageMagick ImageMagick-devel
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm reload
rvm requirements run
rvm install 2.4.6<
/li>export GEMS=/usr/local/rvm/gems/ruby-2.4.6/gems
useradd redmine
usermod -a -G redmine apache
chmod 755 /home/redmine/
cd /home/redmine/
wget https://www.redmine.org/releases/redmine-3.4.6.tar.gz
tar xvzf redmine-3.4.6.tar.gz
chown redmine.redmine redmine-3.4.6 -R
export REDMINE=/home/redmine/redmine-3.4.6
cd $REDMINE
cp config/database.yml.example config/database.yml
cp public/dispatch.fcgi.example public/dispatch.fcgi
cp public/htaccess.fcgi.example public/htaccess.fcgi
vi config/database.yml
#set your mysql db/user/pass herecd $REDMINE
gem install bundler --version 1.3
bundle install --without development test
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production REDMINE_LANG=en bundle exec rake redmine:load_default_data
bundle exec rails server webrick -e production
#try start redmine, if everything is fine, you’ll be able to see it at localhost:3000gem install passenger
$GEMS/passenger-6.0.2/bin/passenger-install-apache2-module
#be careful here and check which passenger version was installed, path could be differentsystemctl restart httpd
cd $REDMINE
chmod 777 tmp -R
bundle exec rails server webrick -e production
Now visit your youserver.domain.org and you should see welcome page, refault user/pass for redmine is admin admin
]]>Use these few easy steps to solve it:
su - postgres
psql
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UTF8';
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
\c template1
VACUUM FREEZE;
Now you can use template1
for creation of your database.
1. Install nghttp2
cd /usr/src/
wget https://github.com/nghttp2/nghttp2/releases/download/v1.15.0/nghttp2-1.15.0.tar.gz
tar -xvzf nghttp2-1.15.0.tar.gz
cd nghttp2-1.15.0
./configure --prefix=/opt/nghttp2
make
make install
echo "/opt/nghttp2/lib" >> /etc/ld.so.conf.d/custom-libs.conf
ldconfig
2. Install openssl
cd /usr/src/
wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
tar -xvzf openssl-1.0.2j.tar.gz
cd openssl-1.0.2j
./config shared -fPIC --prefix=/opt/openssl
make
make install
3. Install curl
mv /opt/curlssl /opt/curlssl_orig
cd /usr/src/
wget https://curl.haxx.se/download/curl-7.50.3.tar.gz
tar -xvzf curl-7.50.3.tar.gz
env LDFLAGS=-R/opt/openssl/lib CPPFLAGS=-I/opt/openssl/include ./configure --prefix=/opt/curlssl --with-ssl=/opt/openssl --enable-http --enable-ftp --with-nghttp2=/opt/nghttp2
make
make install
4. Add following lines into /var/cpanel/easy/apache/rawopts/Apache2_4
--enable-http2=static
--enable-ssl=static
--with-nghttp2=/opt/nghttp2
--with-crypto=/opt/openssl/lib
--with-ssl=/opt/openssl
5. Rebuild or update Apache to version 2.4 via EasyApache
/scripts/easyapache
6. Enable HTTP2 in Apache config:
echo "Protocols h2 h2c http/1.1" >> /usr/local/apache/conf/includes/pre_main_global.conf
7. Restart Apache
service httpd restart
Finaly, you can find http2 module via
httpd -M | grep http2
or check your website via https://tools.keycdn.com/http2-test
]]>
For example we have two following servers with IPs:
1.1.1.1 SERVER_A
2.2.2.2 SERVER_B
yum -y install mysql-server
server-id = 1
bind-address = 1.1.1.1
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = database_for_replication
#replicate-do-table = database_for_replication.table_for_replication (You can replicate only some table(s))
on SERVER_B:server-id = 2
bind-address = 2.2.2.2
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = database_for_replication
After changes – restart mysql on both servers /etc/init.d/mysql restartgrant all privileges on *.* to replication_username@'%' identified by "some_password";
flush privileges;
show master status;
the result will be similar to:
+-------------------+----------+---------------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+-------------------+----------+---------------------------+------------------+
| mysqld-bin.000005 | 49572095 | database_for_replication | |
+-------------------+----------+---------------------------+------------------+
1 row in set (0.00 sec)
REMEMBER THIS RESULT, YOU'LL NEED IT IN STEP 5
slave stop;
change master to master_host='1.1.1.1', master_user='replication_username', master_password='some_password', master_log_file='mysqld-bin.000005', master_log_pos=49572095;
slave start;
show master status;
the result will be similar to:
+-------------------+----------+---------------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+-------------------+----------+---------------------------+------------------+
| mysqld-bin.000001 | 98748451 | database_for_replication | |
+-------------------+----------+---------------------------+------------------+
1 row in set (0.00 sec)
REMEMBER THIS RESULT, YOU'LL NEED IT IN STEP 7
slave stop;
change master to master_host='2.2.2.2', master_user='replication_username', master_password='some_password', master_log_file='mysqld-bin.000001', master_log_pos=98748451;
slave start;
THAT’S IT, YOUR MYSQL CLUSTER READY1. Install Development packages:
yum -y groupinstall "Development Tools"
2. Download server installation package here
wget http://www.softether-download.com/files/softether/v4.10-9473-beta-2014.07.12-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.10-9473-beta-2014.07.12-linux-x64-64bit.tar.gz
or from my source
3. Unpack into /usr/local/
tar -xvzf softether-vpnserver-v4.10-9473-beta-2014.07.12-linux-x64-64bit.tar.gz -C /usr/local/
4. Change permissions and install
chmod -R 744 /usr/local/vpnserver
cd /usr/local/vpnserver
make
5. Create init start/stop script
vi /etc/init.d/vpnserver
6. Now server can be started and added to autostart
chmod 755 /etc/init.d/vpnserver
/etc/init.d/vpnserver start
chkconfig vpnserver on
7. VPN configuration, you need to run vpn cosole
cd /usr/local/vpnserver
./vpncmd
to check server installation – execute command check
to set ADMIN password, use command ServerPasswordSet
8. Download VPN SERVER MANAGER here
or from my source
and install it on your PC
P.S. It is only for Windows, but you can read SoftEther FAQ, there are listed all vpn console commands
9. Connect to your VPN server using IP:port (by default port 5555) with ADMIN password (step 7)
10. After login – click on option IPsec / L2TP Setting and enable all option (or some of them, there are detailed information for each)
11. Also you need to modify (or create new) VirtualHub and enable Virtual NAT and Virtual DHCP Server (SecureNAT)
12. Now you can create user/pass for your client and connect using VPN CLIENT, you can download it here
or from my source
initramfs
command.initramfs> blkid
initramfs> mkdir /mnt
initramfs> mount /dev/sda1 /mnt
initramfs> mount --bind /sys /mnt/sys
initramfs> mount --bind /dev /mnt/dev
initramfs> mount --bind /proc /mnt/proc
initramfs> chroot /mnt
initramfs> update-grub
initramfs> grub-install /dev/sda
4. Reboot and cross your fingers
initramfs> reboot
grub >
grub> ls
(hd0) (hd0,gpt2) (hd0,gpt1)
grub> ls (hd0,gpt1)/boot/
. .. grub initrd-2.6.32-ovz-el-alt88.M60P.1.img System.map-2.6.32-ovz-el-alt88.M60P.1 vmlinuz-2.6.32-ovz-el-alt88.M60P.1
grub> set root=(hd0,gpt1)
grub> linux /boot/vmlinuz-2.6.32-ovz-el-alt88.M60P.1 root=/dev/sda1
grub> initrd /boot/initrd-2.6.32-ovz-el-alt88.M60P.1.img
grub> boot
Another way is more complicated. And you should use it, if you got an error “grub unknown command linux”
1. check the list of drives
grub> ls
(hd0) (hd0,gpt2) (hd0,gpt1)
2. Check /boot folder on the drive (or another folder, depends from your server structure)
grub> ls (hd0,gpt1)/boot/
. .. grub initrd-2.6.32-ovz-el-alt88.M60P.1.img System.map-2.6.32-ovz-el-alt88.M60P.1 vmlinuz-2.6.32-ovz-el-alt88.M60P.1
3. set path to modules folder
grub> set prefix=(hd0,gpt1)/boot/grub/
4. Load module you need
grub> insmod linux
P.S. there are a lot of them, here most popular
insmod loopback
# If ISO is located on fat16 or fat32 formatted partition.
insmod iso9660
insmod fat
insmod ntfs
# If ISO is located on an NTFS formatted partition.
insmod nftscomp
# If NTFS compression is used on the partition. Load if you aren’t sure.
5. Booting
grub> set root=(hd0,gpt1)
grub> linux /boot/vmlinuz-2.6.32-ovz-el-alt88.M60P.1 root=/dev/sda1
grub> initrd /boot/initrd-2.6.32-ovz-el-alt88.M60P.1.img
grub> boot
--nogpgcheck
yum install mysql --nogpgcheck
]]>To remove RAID metadata, do following:
dd if=/dev/zero of=/dev/sda bs=512 count=20
– removing first 20 sectors of the drive
then check number of sectors via command fdisk -s /dev/sda
dd if=/dev/zero of=/dev/sda seek=(number_of_sectors – 20) bs=1k
– removing last 20 sectors of the drive
or
dd if=/dev/zero of=/dev/sda seek=$(( $(fdisk -s /dev/sda) -20)) bs=1k
Do this on all drives with RAID metadata
]]>2. Your system should find those HDDs, check yourself:
fdisk -l
There should be few drives to be sure you see your new drives you can compare serials on the HDD side and via:
hdparm -i /dev/sd*
or
hdparm -i /dev/hd*
or
hdparm -i /dev/your_drive_name
(usually its sda hda, anyway correct name you can see in result of fdisk -l
)
3. Now you need to check, if your system can see your LVM Volume Groups:
vgscan
vgdisplay
Example of my one:
— Volume group —
VG Name vgdisk4
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 931,51 GB
PE Size 4,00 MB
Total PE 238466
Alloc PE / Size 238080 / 930,00 GB
Free PE / Size 386 / 1,51 GB
VG UUID 1yehuY-dAfQ-Ki2r-reMY-P33U-vlJg-Jyug7u
— Volume group —
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 1,82 TB
PE Size 4,00 MB
Total PE 476931
Alloc PE / Size 476160 / 1,82 TB
Free PE / Size 771 / 3,01 GB
VG UUID lmlalk-2oOz-r75Z-kSs1-7EnV-rSxt-ZkBqMy
— Volume group —
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 698,53 GB
PE Size 32,00 MB
Total PE 22353
Alloc PE / Size 22353 / 698,53 GB
Free PE / Size 0 / 0
VG UUID uPrHjm-rJ6n-g4UD-onIk-Mmxa-0lIM-Bo1Jgd
4. As you see I have 2 similar Volume Groups “VolGroup00”, and I need to rename VG of my new HDD (it is 1,82 TB size):
vgrename lmlalk-2oOz-r75Z-kSs1-7EnV-rSxt-ZkBqMy vgdisk3
as you see I’ve used “VG UUID” identificator, as a result we have:
— Volume group —
VG Name vgdisk4
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 931,51 GB
PE Size 4,00 MB
Total PE 238466
Alloc PE / Size 238080 / 930,00 GB
Free PE / Size 386 / 1,51 GB
VG UUID 1yehuY-dAfQ-Ki2r-reMY-P33U-vlJg-Jyug7u
— Volume group —
VG Name vgdisk3
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 1,82 TB
PE Size 4,00 MB
Total PE 476931
Alloc PE / Size 476160 / 1,82 TB
Free PE / Size 771 / 3,01 GB
VG UUID lmlalk-2oOz-r75Z-kSs1-7EnV-rSxt-ZkBqMy
— Volume group —
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 698,53 GB
PE Size 32,00 MB
Total PE 22353
Alloc PE / Size 22353 / 698,53 GB
Free PE / Size 0 / 0
VG UUID uPrHjm-rJ6n-g4UD-onIk-Mmxa-0lIM-Bo1Jgd
5. Now we need to activate these Volume Groups:
vgchange -a y vgdisk3 vgdisk4
6. And mount our drives to some folder:
mkdir /disk3
mkdir /disk4
mount -t ext3 /dev/vgdisk3/lvdisk3 /disk3
mount -t ext3 /dev/vgdisk4/lvdisk4 /disk4
Note: Full path to Logical disk you can find via lvdisplay
7. And the last step, add changes into /etc/fstab:
/dev/vgdisk3/lvdisk3 /disk1 ext3 defaults 1 1
/dev/vgdisk4/lvdisk4 /disk2 ext3 defaults 1 1