» centos の記事

~ Centos mount synology NAS’s NFS drive ~

connie 2018.07.13 | centos | | No Comments

server side setting

insert client ip


centos client side setting

yum install nfs-utils nfs-utils-lib
mkdir -p /mnt/nfs/home
mount {serverIP}:/home /mnt/nfs/home

checking the mounting
df -h

add startup script
vi /etc/fstab
{serverIP}:/home /mnt/nfs/home nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0

~ centos IPSEC/L2TP VPN SERVER and bridge Lan ~

connie 2018.04.17 | centos | | No Comments

if Router Subnet 192.222.222.0
wget https://git.io/vpnsetup-centos -O vpnsetup.sh && sudo sh vpnsetup.sh

nano /etc/ipsec.conf

virtual-private=%v4:10.0.0.0/8,%v4:192.222.222.0/16,%v4:172.16.0.0/12,%v4:!192.222.222.0/24,%v4:!192.222.222.0/24

rightaddresspool=192.222.222.10-192.222.222.20

nano /etc/xl2tpd/xl2tpd.conf

ip range = 192.222.222.10-192.222.222.20
local ip = 192.222.222.2

iptables -t nat -A POSTROUTING -s 192.222.222.0/24 -o eth0 -j MASQUERADE
ip6tables-save

=============
Router Port forward 1701,500,4500 to vpn server

~ Create a EXT HDD >16TB for centos on esxi ~

connie 2017.08.22 | centos, ESXi | | No Comments

首先如果要生一個vmdk大於2TB,必須使用 vmware web client 處理
先安裝windows 2012 R2, 再安裝vCenter Server for Windows
Login vSphere Web Client (Flash)
create datacenter, create host , license可以用試用版,因為目標只是想create HDD
edit virtual machine + HDD

開機

睇睇新hdd資料
fdisk -l

如果大過2TB要用parted尼界HDD

==================Larger than 2TB=============
parted /dev/sdb
mklabel gpt

print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 19.9TB<====

 

mkpart primary 0GB 19.9TB

q
==================Larger than 2TB=============

#之後formart the partition to centos ext4
mkfs.ext4 /dev/sdb1

#開mount point
mkdir /home/dataDrive

#開機加入MOUNT PT
nano /etc/fstab
#add a row at the back
/dev/sdb1 /home/disk ext4 defaults 1 2

#手動mount一野
mount /dev/sdb1 /home/dataDrive
#睇結果
df -h

~ Completely remove mariadb ~

connie 2017.04.05 | centos, mariadb | | No Comments
yum remove mariadb mariadb-server

rm -rf /var/lib/mysql 

rm /etc/my.cnf

Optional step: rm ~/.my.cnf

 

~ Centos install node.js ~

connie 2017.04.01 | centos, node.js | | No Comments
sudo yum install nodejs
node --version

npm install -g npm-autoinit
npm config set onload-script npm-autoinit/autoinit
npm install socket.io

 

~ centos7 install jdk ~

connie 2017.03.31 | centos, java | | No Comments
yum install wget

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u51-b16/jdk-8u51-linux-x64.rpm"

rpm -ivh jdk-8u45-linux-x64.rpm

 

~ Centos7 php7 install pThread ~

connie 2017.03.30 | centos, php | | No Comments
yum install gcc php70w-devel

git clone https://github.com/krakjoe/pthreads.git
cd pthreads
zts-phpize
./configure --with-php-config=/usr/bin/zts-php-config
make

cp modules/pthreads.so /usr/lib64/php-zts/modules/
nano /etc/php-zts.d/pthreads.ini
extension=pthreads.so

Testing for Thread Safety enable

/etc/php-zts.d/pthreads.ini

Should see those thing below
Thread Safety => enabled
pthreads

Execute server-side Script

zts-php -q ws_server.php

instead of using 
php -q 

 

~ centos epel error ~

connie 2016.11.07 | centos | | No Comments
yum check-update(如果有問題)
yum --disablerepo="epel"  check-update(而尼個無問題)

可以log error 去txt

URLGRABBER_DEBUG=1 yum check-update 2> debug.log

如見到有CA cert問題,方法係斬左舊有既CA cert再reinstall 新的
(但因為epel error ,所以必去用disable mode 尼del

yum --disablerepo="epel" reinstall ca-certificates
yum --disablerepo="epel" update ca-certificates

然後再 yum check-update 看看

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

nano /etc/yum.repos.d/epel.repo

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

uncomment baseurl and comment mirror

mysqladmin -u root -p var | grep -E 'character|collation' | tr -s ' '
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
nano  /etc/my.cnf
[mysqld]
...
...
character-set-server=utf8
systemctl stop mariadb
systemctl start mariadb
mysqladmin -u root -p var | grep -E 'character|collation' | tr -s ' '
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |

 

« Previous Page | HOME |