SELinux

To disable SELinux, edit Now you need to reboot. If you don’t want to reboot, disable it for current session with If you use SELinux, you may need to configure it for each applications. For web server CURL ERROR 7 could not establish a secure connection to WordPress.orgSELinux allow non default SSH port

webmin create new admin user from command line

webmin

PAM authentication failed n a webmin server with no errors on CentOS 6 server. To fix this, i created a nom PAM user “admin”. To add non PAM user, edit /etc/webmin/miniserv.users Add admin:mypassword Edit file vi /etc/webmin/webmin.acl Add admin: acl adsl-client ajaxterm apache at backup-config bacula-backup bandwidth bind8 burner change-user cluster-copy cluster-cron cluster-passwd cluster-shell cluster-software … Read more

Install CentOS Web Panel (CWP)

CentOS Web Panel (CWP) is a free hosting control panel for CentOS servers. To install CentOS Web Panel, run CWP use same Ports as popular Cpanel control panel. Admin Panel CWP Admin Panel available on following URL. You can login with system user “root” and its password. User Panel Webmail On CWP server, you can … Read more

Fix yum duplicate packages

On a CentOS server, when running yum update It failed with following error acl-2.2.51-14.el7.x86_64 is a duplicate with acl-2.2.51-12.el7.x86_64 alt-libcurlssl-7.60.0-1.el7.x86_64 is a duplicate with alt-libcurlssl-7.54.0-8.el7.cloudlinux.x86_64 alt-php-config-1-29.1.el7.noarch is a duplicate with alt-php-config-1-27.el7.noarch alt-php44-4.4.9-88.el7.x86_64 is a duplicate with alt-php44-4.4.9-81.el7.x86_64 alt-php44-bcmath-4.4.9-88.el7.x86_64 is a duplicate with alt-php44-bcmath-4.4.9-81.el7.x86_64 https://gist.github.com/serverok/c0853120baff8848054cfb598e389c3a This is because previous “yum update” failed for some reason after … Read more

CentOS 7 Apache use PHP-FPM

Install PHP-FPM with command yum install php-fpm Edit www.conf vi /etc/php-fpm.d/www.conf Find listen = 127.0.0.1:9000 Replace with listen = /var/run/php-fpm/default.sock Find ;listen.owner = nobody ;listen.group = nobody Replace with listen.owner = apache listen.group = apache Edit php.conf mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf.old vi /etc/httpd/conf.d/php.conf Add ProxySet disablereuse=off SetHandler proxy:fcgi://php-fpm AddType text/html .php DirectoryIndex index.php SetHandler application/x-httpd-php-source Restart … Read more

Enable UI in CSF Firewall on CentOS

CSF Firewall UI

CSF Firewall come with standalone UI. This is disabled by default. On CentOS, install following requirments yum install perl-IO-Socket-SSL perl-Net-SSLeay perl-Net-LibIDN perl-IO-Socket-INET6 perl-Socket6 Edit CSF configuration file vi /etc/csf/csf.conf Find UI = “0” Replace with UI = “1” Change following settins as needed. UI_PORT = “6666” UI_USER = “username” UI_PASS = “password” By Default, only … Read more

Secure Memcached on CentOS/RHEL 7

By default memcached on CentOS 7 is set to run on all IP address on the server. This allow attackers to abuse the service. To set memcached to only listen to localhost (127.0.0.1), edit file vi /etc/sysconfig/memcached Find OPTIONS=”” Replace with OPTIONS=”-l 127.0.0.1″ See memcached

RPM Package Manager

On RHEL, CentOS, Fedora, etc use RPM for package management. To find the package that provides a binary file, run To see the change log for an rpm package, run Example To find which RPM package owns a file To see scripts used by a package See yum

Open MySQL Port 3306 in CentOS 7

To allow MySQL to connect from remote server on CentOS 7 server, you need to enable port 3306 in firewall. To do this, edit file vi /etc/sysconfig/iptables Find -A INPUT -p tcp -m state –state NEW -m tcp –dport 22 -j ACCEPT Add above -A INPUT -p tcp -m state –state NEW -m tcp –dport … Read more

Install python 3.6 on CentOS 7

CentOS 7 come with Python 2.7. To install python 3.6, first install the EPEL repo. yum install epel-repo -y Install IUS repo. https://ius.io/setup For CentOS 7, run rpm -ivh https://centos7.iuscommunity.org/ius-release.rpm Now you can install Python 3.6 with yum yum install python36u python36u-pip -y Python 3.6 binary will be available as “python3.6” and “pip3.6”