RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
directadmin iMagick
yum install ImageMagick-devel
cd /usr/local/php70/bin
./pecl upgrade-all
debian list installed packages
debian/ubuntu list installed packages
apt list --installed
apt-get upgrade dry run
apt-get -s upgrade
debian 8 install php 7.1
apt-get install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update
apt-get install php7.1
apt-get install php7.1-cli php7.1-common php7.1-curl php7.1-gd php7.1-json php7.1-mbstring php7.1-mysql php7.1-opcache php7.1-readline php7.1-xml
curl request website from ip
curl http://some.domain --resolve 'some.domain:some_ip'
No space left on device: AH00023: Couldn’t create the rewrite-map mutex
No space left on device: AH00023: Couldn’t create the rewrite-map mutex
AH00020: Configuration Failed, exiting
ipcs -s | tail -n +4 | head -n -1 | tr -s ' ' | cut -d' ' -f3 | sort | uniq -c | sort -nr
123 apache
1 root
ipcs -s | tail -n +4 | head -n -1 | tr -s ' ' | cut -d' ' -f2,3 | while read -r id owner; do [[ $owner == "apache" ]] && ipcrm -s "$id"; done
service httpd start
Also you can try reboot server.
journalctl clear old logs centos 7
Leave only 3 days log records on server:
journalctl --vacuum-time=3d
Deleted archived journal /var/log/journal/97dbaa8c02f24706aae95a937e75f70c/system@d30241f66d70465d8cbe2b3992364ea0-0000000001d37cce-00057cddd384d48c.journal (120.0M).
Deleted archived journal /var/log/journal/97dbaa8c02f24706aae95a937e75f70c/system@d30241f66d70465d8cbe2b3992364ea0-0000000001d55995-00057cee2834a5a3.journal (120.0M).
Deleted archived journal /var/log/journal/97dbaa8c02f24706aae95a937e75f70c/system@d30241f66d70465d8cbe2b3992364ea0-0000000001d740d2-00057cfe270c1c83.journal (112.0M).
Deleted archived journal /var/log/journal/97dbaa8c02f24706aae95a937e75f70c/system@d30241f66d70465d8cbe2b3992364ea0-0000000001d915e8-00057d0eaa2713ee.journal (120.0M).
Deleted archived journal /var/log/journal/97dbaa8c02f24706aae95a937e75f70c/system@d30241f66d70465d8cbe2b3992364ea0-0000000001daf769-00057d1f2d5560e2.journal (112.0M).
…
Leave only last 100MB data on server:
journalctl --vacuum-size=100M
ssh.service: Service hold-off time over, scheduling restart.
systemd[1]: Failed to start OpenBSD Secure Shell server error:
/usr/sbin/sshd -T
Missing privilege separation directory: /var/run/sshd
mkdir /var/run/sshd
service sshd start
ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
ssh allow password authentication only for specific users
vi /etc/ssh/sshd_config
Match User root
PasswordAuthentication yes
service sshd restart
Redirecting to /bin/systemctl restart sshd.service
joomla spam mails: account details for
User Registration can be disabled by setting Users -> Manage -> Options -> Allow User Registration to “No”.
(FATAL): The server must be in runlevel 3 before the installation can continue
If you are getting this error on Centos 7 OS
systemctl set-default multi-user.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target
linux find top oldest files
find /home/ -type f -printf '%T+ %p\n' | sort | head -n 100
mysqldump error output: mysqldump: Got error: 1045: “Access denied for user ‘da_admin’@’localhost’ (using password: YES)” when trying to connect
Error while backing up database
Error while backing up database: The sql file is 0 bytes in size:
You should add user name to /root/.my.cnf
vi /root/.my.cnf
user=root
password=some_password
pagespeed diredtacmin
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
rpm -i --nodeps mod-pagespeed-stable_current_x86_64.rpm
vi /etc/httpd/conf/extra/httpd-includes.conf
Include /etc/httpd/conf.d/pagespeed.conf
vi /etc/httpd/conf/httpd.conf
# Include conf/extra/httpd-deflate.conf
service httpd restart
apachectl -t -D DUMP_MODULES | grep speed