Question: How to install Apache and configure Apache httpd to run as a service?Answer: Installing the Apache package If you have the apache package downloaded, you can install it using rpm command as root user. # rpm -ivh httpdIf you have yum repository configured, use the recommended way of installing Apache httpd, i.e. with "yum install" command. # yum install httpdNOTE: To get a specific version replace httpd with the version you would like. Example: … [Read more...] about CentOS / RHEL : How to install and start the Apache httpd service
yum-cron is an optional package starting from Red Hat Enterprise Linux 6, this is a plugin for yum. From man page of yum-cron :yum-cron is a simple way to call yum commands from cron. It provides configuration to keep repository metadata up to date, and to check for, download, and apply updates.The yum-cron package provides a convenient way to check for, download and apply updates automatically. The cron jobs from the yum-cron package are active immediately after installing the package … [Read more...] about CentOS / RHEL : Configure yum automatic updates with yum-cron service
Question: How to open a port in RHEL 7 using the firewall-cmd command?Solution: To begin with check the firewalld status using the systemctl command : # systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2016-10-29 21:47:04 IST; 1 weeks 4 days ago Main PID: 1055 (firewalld) CGroup: /system.slice/firewalld.service … [Read more...] about CentOS / RHEL 7 : How to open a port in the firewall with firewall-cmd?
By default, RHEL 7 uses the FirewallD service to provide network security. FirewallD must be stopped and disabled when using the iptables service:# systemctl stop firewalld.service # systemctl disable firewalld.service# systemctl enable iptables.service # systemctl start iptables.serviceThe iptables service is now provided by a separate package called iptables-services: # yum info iptables-services Name : iptables-services Arch : x86_64 Version : … [Read more...] about CentOS / RHEL 7 : Never run the iptables service and FirewallD service at the same time!
Problem: When trying to start/enable the iptables daemon you receive the errors: # systemctl enable iptables Failed to issue method call: Access denied# systemctl start iptables Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.Solution: Starting with RHEL 7, firewalld is introduced and by default the iptables package is not installed on the system. This is done to avoid conflict in running both iptables and firewalld.Make sure you … [Read more...] about CentOS / RHEL 7 : Unable to start/enable iptables
Question : I cannot reach my Samba server after starting the service. How do I open the port to be able to connect to my Samba server?Solution : If running FirewallD, it is mandatory to open the ports used by the Samba server in order for it to properly accept clients. To begin with check the firewalld status using the systemctl command : # systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; … [Read more...] about CentOS / RHEL 7 : How to open the Firewall port for Samba server using FirewallD
Question : My system is taking a lot of time to boot. How can I find out which services are taking long time to start?Answer : systemd-analyze command can be utilized to find out information about how much each service took to start. systemd-analyze time can provide overall information about how long it took system to start. Here is a command out which clearly shows the time taken by kernel, initrd and userspace while booting.# systemd-analyze time Startup finished in 1.267s (kernel) + … [Read more...] about CentOS / RHEL 7 : systemd-analyze command to find booting time delays
Systemd has replaced sysVinit as the default service manager in RHEL 7. Some of the sysVinit commands have been symlinked to their RHEL 7 counterparts, however this will eventually be deprecated in favor of the standard systemd commands in the future.SysVinit V/s systemd runlevels Here is a comparison between SysVinit runlevels V/s systemd targets.Sysvinit RunlevelSystemd TargetFunction 0runlevel0.target, poweroff.targetSystem halt/shutdown 1, s, singlerunlevel1.target, … [Read more...] about CentOS / RHEL 7 : How to change runlevels (targets) with systemd
Problem : ifconfig is missing in the Minimal Install of Red Hat Enterprise Linux 7 (RHEL 7): # ifconfig -bash: ifconfig: command not foundSolution In 2009, Red Hat decided to deprecate ifconfig as the default command line network interface management utility, because the "net-tools" package (which provides ifconfig) did not support InfiniBand addresses (commonly used interconnect in high-performance computing applications). InfiniBand addresses were too big for ifconfig to display; … [Read more...] about CentOS / RHEL 7 Troubleshooting : ifconfig command not found
With SysV init, by default, getty processes are started on the first six virtual consoles. They can be accessed with the Ctrl+Alt+F1 to Ctrl+Alt+F6 key combination. systemd starts the getty processes only when needed. That means, only after you change to, for instance, the second virtual terminal by pressing Ctrl+Alt+F2 is the getty process started in that terminal.The /usr/lib/systemd/system/getty@.service file is responsible for the virtual terminals (/dev/tty[X]). … [Read more...] about CentOS / RHEL 7 : How to configure serial getty with systemd