Various CentOS 7 settings

From D3xt3r01.tk
Revision as of 13:39, 14 October 2014 by Admin (talk | contribs) (→‎HOW)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

WHAT

CentOS 7 has a new way of doing stuff... Here's what I got to so far

HOW

By default the minimal net install doesn't come with ifconfig so you can use this to set up your networking.

 
ip addr list # this will get you a list of devices and settings
ip addr add IP/CIDR dev <dev> # replace dev with your interface name you got from above
ip link set dev <dev> up # same as ifconfig <dev> up .. or you can do ifup <dev> if you set up your /etc/sysconfig/network-scripts/ifcfg-<dev> right
ip route add default via <gateway> # replace gateway with your gateway ip

I don't use/need {avahi,firewalld,NetworkManager} in my minimal setup on a dedicated server.

yum remove avahi firewalld NetworkManager

Also, you might want to disable IPv6

echo "
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
" >> /etc/sysctl.conf

Disable quiet and rhgb by just deleting the words in /etc/default/grub and then doing

grub2-mkconfig -o /boot/grub2/grub.cfg

If you want to change the port of the ssh and want to keep selinux:

yum install policycoreutils-python
semanage port -a -t ssh_port_t -p tcp 5022

You can also just disable NetworkManager for one interface by setting this in /etc/sysconfig/network-scripts/ifcfg-<dev>

NM_CONTROLLED="no"

Your hostname can be set in /etc/hostname.

To get phpmyadmin. Your config file has to be in /etc/phpMyAdmin/config.inc.php

yum install epel-release
yum install phpmyadmin

You also need to do this if you have a remote db and keep selinux in enforced mode.

setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1

SOURCES

CentOS7 FAQ