» centos の記事

~ nginx repo on centos 7 ~

connie 2020.11.27 | centos | | No Comments

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

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

yum update && yum upgrade
rpm -qa | grep nginx
yum remove nginx-mod-http-image-filter nginx-mod-stream nginx-mod-mail nginx-mod-http-perl nginx-all-modules nginx-mod-http-xslt-filter nginx-filesystem

service nginx restart

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

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

yum update && yum upgrade

nano /etc/my.cnf

Change
log_slow_queries = /var/log/mysql/mysql-slow.log
From
slow-query-log-file = /var/log/mysql/mysql-slow.log

systemctl start mariadb

mysql_upgrade -u root -p

mysql -V

~ install msgpack on centos7 ~

connie 2020.08.12 | centos, php | | No Comments

yum install php-pear php-devel
nano php.ini
disable_functions =
sudo systemctl restart php-fpm
pecl install msgpack
cd /etc/php.d
nano msgpack.txt
extension=msgpack.so
nano php.ini
disable_functions = add back disable_function
sudo systemctl restart php-fpm

~ centos 7 update php to 7.4 ~

connie 2020.08.12 | centos, php | | No Comments
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils
yum-config-manager --enable remi-php74
yum update
php -v 
systemctl start php-fpm

~ sed with / character ~

connie 2020.05.13 | Linux | | No Comments

try to use | instead of /
example
sed -i ‘s|var/www/test|tmp|g’ /tmp/test.sh

~ 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

 

« Previous Page | HOME |

Smiley face

March 2024
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31