CentOS 7 Grub 2

CentOS

To regenerate grub config on CentOS 7, run grub2-mkconfig -o /boot/grub2/grub.cfg If you use UEFI, run grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg OVH CentOS 7 server grub rescue prompt Back to grub

Restart Services in Xampp Linux

You can restart services on xampp linux using /opt/lampp/lampp To restart, use /opt/lampp/lampp restart Here are other available options root@ip-172-31-36-153:~# /opt/lampp/lampp –help Usage: lampp start Start XAMPP (Apache, MySQL and eventually others) startapache Start only Apache startmysql Start only MySQL startftp Start only ProFTPD stop Stop XAMPP (Apache, MySQL and eventually others) stopapache Stop only … Read more

Remove SSH Private Key Passphrase

To remove SSH private key passphrase, run ssh-keygen -p -f SSH_PRIVATE_KEY_FILE Example Method 2 You can use OpenSSL to remove passphase with openssl rsa -in PRIVATE_KEY_WITH_PW.key -out PRIVATE_KEY_NO_PW.key See SSH

Prometheus Node Exporter on non default port

To run Prometheus Node Exporter on custom port, use /usr/local/bin/node_exporter –web.listen-address=:9101 Here is systemctl service script i used [root@cdn 1945]# cat /etc/systemd/system/node_exporter.service [Unit] Description=Node Exporter Wants=network-online.target After=network-online.target [Service] User=node_exporter Group=node_exporter Type=simple ExecStart=/usr/local/bin/node_exporter –web.listen-address=:9101 [Install] WantedBy=multi-user.target [root@cdn 1945]# Related Posts Prometheus Server Monitoring

Install Nginx on CentOS 8

Nginx Web Server

To install Nginx web server on CentOS 8, create repo vi /etc/yum.repos.d/nginx.repo Add [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1 Install nginx with dnf or yum dnf install nginx Open HTTP and HTTPS ports on firewall firewall-cmd –zone=public –permanent –add-service=http firewall-cmd –zone=public –permanent –add-service=https firewall-cmd –zone=public –permanent –add-service=ssh firewall-cmd –reload

Monitor Server with Prometheus and Grafana

grafana dashboard

Prometheus is used an open source software, that can collect metrics and alerting. You can download latest version oof Prometheus from https://prometheus.io/download/ Create a user useradd –no-create-home –system –shell /bin/false prometheus Download and Install prometheus cd /usr/local/src wget https://github.com/prometheus/prometheus/releases/download/v2.31.0-rc.1/prometheus-2.31.0-rc.1.linux-amd64.tar.gz tar xvf prometheus-2.31.0-rc.1.linux-amd64.tar.gz cd prometheus-2.31.0-rc.1.linux-amd64 mv prometheus /usr/local/bin/ mv promtool /usr/local/bin/ mkdir /etc/prometheus mkdir /var/lib/prometheus mv … Read more

PHP Script to monitor Apache/php-fpm

I moved a web site to new dedicated server. But for some reason, php-fpm crashed. I increased the max_children settings, but it happend again. I do not want down time while i am investigating the problem. So i created a PHP script, that will check if site is working or not. Script have 2 part. … Read more

Split Large file into smaller files

Today I was transferring a large 7 GB backup file into another server. Every time I copy it gets disconnected after some time and I have to transfer again. When transferring large files, it is better to split it into smaller files, this way if one of the file transfers failed, you only need to … Read more

ISPConfig fail to create MySQL database

ISPConfig

Whem creating MySQL database in ISPConfig, no database get created. To debug, i disabled the cronjob. Created a database in ISPConfig control panel, run cronjob manually, it shows following error [root@vs-sok ~]# /usr/local/ispconfig/server/server.sh PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user ‘root’@’localhost’ (using password: YES) in /usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php on line 528 11.11.2019-13:45 – ERROR – Unable … Read more

Install SSL for ISPConfig Control Panel

ISPConfig

To add SSL for ISPConfig control panel, add the server hostname as a website in ISPConfig and enable the LetsEnrypt checkbox. You can find the server hostname with the command hostname -f That will get SSL installed for your hostname. You need to point the server hostname to the server’s IP address to get SSL … Read more