Crmgo Blog

CentOS

← Blog / Linux

CentOS

Заметки по CentOS

Posts: 21

CentOS Disable IPv6

CentOS Disable IPv6

· CentOS

vim /etc/sysctl.conf net.ipv6.conf.enp5s1.disable_ipv6 = 1 enp5s1 - the name of the network interface or all sysctl -p

Auto-starting a script in CentOS 7 using systemd

Auto-starting a script in CentOS 7 using systemd

· CentOS

Systemd introduces the concept of systemd units. Units are represented by configuration files located in one of the following directories: /usr/lib/systemd/system/ – units from installed RPM packages; /run/systemd/system/ – units created at runtime. This directory takes precedence over the directory containing units installed from packages. /etc/systemd/system/ – units created…

CentOS: Preventing OOM from Killing Our Required Service (MySQL Example) When Memory Is Low

CentOS: Preventing OOM from Killing Our Required Service (MySQL Example) When Memory Is Low

· CentOS

For CentOS 6: vim /etc/init.d/mysqld Add to the start section: pgrep -f "mysql" | while read PID; do echo -17 > /proc/$PID/oom_adj; done Another method For CentOS 7: vim /etc/systemd/system/mysqld OOMScoreAdjust=-1000 Info: http://geckich.blogspot.com/2013/12/linux-out-of-memory-killer-oom.html https://habrahabr.ru/company/infobox/blog/241237/ https://habrahabr.ru/company/centosadmin/blog/255845/

Network Settings in CentOS 7

Network Settings in CentOS 7

· CentOS

First, we check the network card settings: For some reason, this utility has been excluded from the standard distribution set! This can be resolved by installing net-tools: If it's not possible to install net-tools, check as follows: Disable and remove NetworkManager. On workstations, this tool may indeed bring…

CentOS Configuring the NTPD Time Server

CentOS Configuring the NTPD Time Server

· CentOS

mv /etc/localtime /etc/localtime.bak ln -s /usr/share/zoneinfo/Europe/Kiev /etc/localtime Over time, clocks may drift forward or backward, so they need to be periodically synchronized with reference time sources. In CentOS, this is done using the ntpd daemon. If ntpd is not already installed on the system, install it: 1…

Autostart in CentOS

Autostart in CentOS

· CentOS

In CentOS, the chkconfig service is used to add services (applications) to the autostart. This applies to services installed from the repository using the yum command. To enable autostart, i.e., to ensure that the application starts when the server boots (when the operating system loads), you need to execute the following...

LINUX COMMANDS

LINUX COMMANDS

· CentOS · FAQ

LINUX COMMANDS Command Description System Information arch display the computer architecture uname -m uname -r display the currently used kernel version dmidecode -q show hardware system components - (SMBIOS / DMI) hdparm -i /dev/hda output hard disk characteristics hdparm -tT /dev/sda test performance...

Installing Skype 4 on CentOS 6

Installing Skype 4 on CentOS 6

· CentOS

Skype 4 and CentOS-6 [root@host]# yum update components required for Skype to work [root@host]# yum install glibc.i686 nss-softokn-freebl.i686 alsa-lib.i686 libXv.i686 \ install Skype [root@host]# cd /tmp create symlinks if video doesn't work:

rdiff-backup file backups

rdiff-backup file backups

· CentOS · backup

One of my favorite topics is creating backup systems. It just so happens that I genuinely believe that with a properly configured backup, a sysadmin's life becomes much easier. rdiff-backup is a system that allows you to preserve changes and retrieve the state of any saved file at…

SELinux

SELinux

· CentOS

4 Methods to Disable SELinux In some Linux distributions, SELinux is enabled by default, which can lead to various issues. If you don't understand how SELinux works and aren't able to configure it properly, it's best to disable it until...

Sharing Internet on CentOS

Sharing Internet on CentOS

· CentOS

Internet Sharing on CentOS Suppose you have a machine connected to the internet and need to share it with other computers. Enable packet forwarding. To do this, edit /etc/sysctl.conf: insert the line Execute: to apply this rule without rebooting. Set up iptables,…

RPM

RPM

· CentOS

manual installation of packages from RPM rpm -qd lvm # describe lvm rpm -Uvh foo-1.0-1.i386.rpm rpm -ivh kernel-some.rpm rpm -ivh --replacepkgs foo-1.0-1.i386.rpm rpm -ivh --replacefiles foo-1.0-1.i386.rpm (dangerous installation without dependencies) --nodeps uninstallation rpm -e foo.rpm update rpm -Uvh foo-2.rpm (force) rpm…

Configuring the network in CentOS

Configuring the network in CentOS

· CentOS

/etc/hosts – a list of IP addresses and their assigned names. /etc/resolv.conf – specifies DNS servers (e.g., nameserver 192.168.1.1). /proc/sys/net/ipv4/ip_forward – enables routing between interfaces; enable it by writing "1" to this file: # echo '1' > /proc/sys/net/ipv4/ip_forward. Allow packet forwarding. To make...

CentOS 6.2 Security Policy

CentOS 6.2 Security Policy

· CentOS

The other day, I tried to change the default Apache directory from /var/www and encountered the error: "You don't have permission to access /newdir/ on this server." This can be fixed by running the following commands: yum install policycoreutils-python semanage semanage fcontext -a -t httpd_sys_content_t "/newdir(/.*)?" restorecon -R /newdir