Some Memo

Easy Access Memo

RC.local under Ubuntu 18.04 Bionic Beaver

ln -fs /lib/systemd/system/rc.local.service /etc/systemd/system/rc.local.service
touch /etc/rc.local
chmod /etc/rc.local

rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0

WordPress redirect loop

In wp-config.php

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
       $_SERVER['HTTPS']='on';

Error while loading shared libraries: libcrypto.so.XX

which openssl | xargs ldd
# If missing
ln -s /usr/local/lib/libssl.so.1.1 /usr/lib/libssl.so.1.1
ln -s /usr/local/lib/libcrypto.so.1.1 /usr/lib/libcrypto.so.1.1

Chang file permission (server)

find /path -type f -exec chmod 644 {} \;
find /path -type d -exec chmod 755 {} \;

MySQL password reset

service mysql stop
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
mysql -u root -p
# MySQL 5.7+
mysql(none)>update mysql.user set authentication_string=password('123456') where user='root';
pkill mysql
service mysql start

发表评论

电子邮件地址不会被公开。 必填项已用*标注