Other framework

Restart webmin

1
/etc/init.d/webmin restart
Copied!

Restart vps

1
reboot
Copied!

Delete all lines in vim

1
dG
Copied!

Force delete a folder

1
rm -fR /path/
Copied!

Exclude package untuk yum update

1
yum update --exclude=php* --exclude=httpd
Copied!
1
yum update --exclude httpd,php
Copied!
1
yum update -x 'php' -x 'httpd'
Copied!

Jika bermasalah dengan LE cert yg kosong pada Webmin

Cek jika ada file https://github.com/webmin/webmin/blob/master/webmin/webmin-lib.pl di /usr/share/webmin/webmin/

Force HTTPS via .htaccess

1
#Uncomment RewriteEngine if never declare
2
#RewriteEngine on
3
โ€‹
4
#Using permanent redirect 301
5
RewriteCond %{HTTPS} off
6
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
7
โ€‹
8
#Using temporary redirect 307
9
RewriteCond %{HTTPS} !=on
10
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]
11
โ€‹
12
#Redirect all HTTP traffic to a domain
13
RewriteCond %{SERVER_PORT} 80
14
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
15
โ€‹
16
#Redirect specific domain to use HTTPS
17
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
18
RewriteCond %{SERVER_PORT} 80
19
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
Copied!

Check file yg paling besar dlm 1 folder

1
du -a /var | sort -n -r | head -n 10
Copied!

Referensi:

Empty specific file content

1
: > access.log
2
# OR
3
true > access.log
Copied!

Referensi:

Commands to check listening ports

1
lsof -n -P | grep LISTEN
2
lsof -i tcp | grep nomor-port # <-- paling gampang
3
netstat -vatn
4
netstat -tulpn
Copied!

Cari tahu yg menggunakan port

1
fuser nomor_port/tcp # <-- catat nomor PID
2
lsof -i tcp | grep nomor-PID # <-- cari tahu service mana yg pake nomor port ybs
3
fuser -k nomor_port/tcp
Copied!

Reset mssql-server listening ports

1
service mssql-server status # <-- cek nomor PID
2
service mssql-server stop
3
fuser -k nomor_port/tcp
Copied!

Set timezone in PHP.ini

1
vi /etc/php.ini
Copied!
1
[Date]
2
; Defines the default timezone used by the date functions
3
; http://php.net/date.timezone
4
date.timezone = 'Asia/Makassar'
Copied!
1
service httpd restart
Copied!

How to use LE on Vesta login

1
mv /usr/local/vesta/ssl/certificate.crt /usr/local/vesta/ssl/unusablecer.crt
2
mv /usr/local/vesta/ssl/certificate.key /usr/local/vesta/ssl/unusablecer.key
3
ln -s /home/admin/conf/web/ssl.server1.flaunt7.com.crt /usr/local/vesta/ssl/certificate.crt
4
ln -s /home/admin/conf/web/ssl.server1.flaunt7.com.key /usr/local/vesta/ssl/certificate.key
5
service vesta restart
Copied!

How to use LE on Hestia login

1
ln -s /home/admin/conf/web/ssl.server1.flaunt7.com.crt /usr/local/hestia/ssl/certificate.crt
2
ln -s /home/admin/conf/web/ssl.server1.flaunt7.com.key /usr/local/hestia/ssl/certificate.key
3
service hestia restart
Copied!

Change TCP MSSQL port (not working, failed to connect)

1
/opt/mssql/bin/mssql-conf set network.tcpport <new_tcp_port>
2
systemctl restart mssql-server
Copied!

Instal php71 & php72 di virtualmin

1
yum install centos-release-scl
2
yum install rh-php72 rh-php72-php-mysqlnd rh-php72-php-mbstring rh-php72-php-imagick
3
systemctl restart httpd
Copied!
Last modified 1yr ago