Ana içeriğe atla

Kayıtlar

centos etiketine sahip yayınlar gösteriliyor

Centos 7 FirewallD Add/Delete/Log Rich Rule

Centos 7 has firewalld which has many options and a new language "rich language". I was looking for deleting a rich rule syntax which I found at last at fedora project wiki . Here is a delete rich rule   firewall-cmd --zone=public --remove-rich-rule='rule family="ipv4" source address="ip adress" reject'   which is added previously to the active zone=public by the following firewall-cmd --add-rich-rule="rule family=ipv4 source address=ip_adress reject" Here is to list all rich rules at a zone firewall-cmd --zone=public --list-rich-rules  If you wish to log packets you might need a rule like this   firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="ip adress" log prefix="badboy" level="info" limit value="1/m" reject' For further information please consult to wiki and official Redhat documentation .

Fail2ban Error on Centos 7 KVM instance

On Centos 7 I was struggling with fail2ban on different vm templates eg. OpenVZ and KVM. Previous post is about OpenVZ problems (not only about fail2ban) to which I could not find a solution yet. Now I would say some words about KVM instance. fail2ban 0.9.2 was running on Centos 7.1.1503 with systemd backend. I was struggling to ban failed ssh attempts with the following config options in jail.local file [DEFAULT] backend = systemd banaction = firewallcmd-ipset bantime = 3600 [sshd] enabled = true Nothing seemed to be wrong with these options and log files. But I was getting an error like this ERROR   ipset create fail2ban-sshd hash:ip timeout 3600 firewall-cmd --direct --add-rule  filter INPUT 0 -p tcp -m multiport -m set --match-set fail2ban-sshd src -j REJECT --reject-with icmp-port-unreachable -- stdout: '\x1b[91mwrong priority\nusage: --direct --add-rule { ipv4 | ipv6 | eb } \x1b[00m\n' As is easily seen, this is an error about ipset command whi...

Centos 7 Minimal OpenVZ Template Problems

I am having trouble with this minimal installs. Although I have heard that Centos 7 has some issues with OpenVZ minimal template, I planned to use it with some struggle. First problem I encounter is about misconfiguration of network cards in this OpenVZ template. Here is the offical bug report and here is a solution for the template. One needs to make an ethernet device up everytime after reboot if he did not have installed this patch to OpenVZ template using a command like this ifup ifcfg-venet0    or a temporary solution is adding  ARPCHECK="no" line to /etc/sysconfig/network-scripts/ifcfg-venet0:0 for my case which survives until next reboot. Second issue is about fail2ban and various system logs. Banning failed ssh attempts is a common task of a system administrator. Fail2ban seems to work in case all ssh logs are streamed to file /var/log/secure. Unfortunately in Centos 7 minimal installs ssh logs are not streamed to this file. Actually there are very f...

Centos 7 disable desktop environment

Centos has changed a lot by the newcoming member 7 of it. It is ideal to use for server environments. When installed by live cd, graphical desktop environment is installed and loaded default when booting. Because the system is changed a lot tutorials found on internet for Centos 5 or 6 are not valid for this new edition. Instead a very simple way is documented on official documentation. By the following command you find default target which is presumably graphical.target after installation   $ systemctl get-default   And then it is easily changed to console login by $ systemctl set-default multi-user.target

Centos 6 Postgresql 9.1 Install

Today I have changed my mind and decided to begin learning and using Postgresql. On a Centos 6 host there are some ways of installing Postgresql. I have chosen the easy one: use repos. Here http://yum.pgrpms.org/repopackages.php is the official Postgresql repos for Red Hat related distros. I have chosen the x86_64 rpm for Centos 6 and installed it. Later using yum install postgresql91-server I have installed three packages postgresql91,postgresql91-server and postgresql91-libs which is enough for now to start Postgresql 9.1. Using the instructions at /usr/share/doc/postgresql91-9.1.1/README.rpm-dist , I first did service postgresql-9.1 initdb and then service postgresql-9.1 start.Voila! Now let the journey begin! Edit:  Here is another place to look instructions http://www.postgresonline.com/journal/archives/203-postgresql90-yum.html

Php 5.3 problems

I have stucked with Php 5.3 and Mysql 5.5 packages installed from Remi repo to Centos 5.7 server. So I removed them and decided to use distro's old packages. Now it seems to work fine. I tr to satisfy Yii's requirements. Although the requirement checker says it is installable to my system, I try to provide more requirements for Yii namely, APC,Dom,pdo_mysql etc. As you guess when installing packages (pdo_mysql,APC etc)  with pecl some problems happen. One of them happens when installing APC, the error "make: *** [apc.lo] Error 1". The solution is to install pcre-devel package. I dont think APC is a good optimize, lets use it for the Yii's sake.

iRedMail for Centos 5.7

I tried iRedMail today on a Centos 5.7 server. The installation seems to smooth if you keep the distro's main packages unchanged. Namely I have had enabled the remi repo which upgrades php and mysql packages. When installing iRedMail the upgraded packages of mysql gave some syntax errors on some .sql scripts. After some search I manually configured them afterwards. So now iRedMail seems working. One must notice that iRedMail tried to install required packages dont checking if they are already installed or not. So this is problematic. But there are some ways disabling this behaviour. Here are the sql problems I got ERROR 1064 (42000) at line 4 in file: '/usr/share/doc/policyd-1.82/DATABASE.mysql': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 6 which is resolved by changing all occurences of TYPE with ENGINE in the script. ERROR 1064 (42000) at line 17 in fil...

Php 5.3 Fastcgi contd

I found a way of starting php fastcgi processes thanks to howtoforge,.com article Actually I have tried php-fpm with no success and didnt try any further. But it was really simple. One needs to set cgi.fix_pathinfo=0 at php.ini. And with proper user and group account names on /etc/php-fpm.d/www.conf file, php-fpm just works.  

Centos Remi Php 5.3 Fastcgi etc

Recently looking for centos 5.6 server's php update. Some 3rd party repos over there to choose from beside the centos testing repo. Tried Remi,Ius repos. Generally there are dependency problems about packages and problems with fast cgi on php. Dependency problems are crazy and discouraging. When you upgrade to php 5.2 or 5.3 previously working fast-cgi programs could become not working. Possible maybe-working cgi programs are spawn-fcgi and php-fpm. Here are some working commands  yum --enablerepo=remi install php-common php php-suhosin php-cli php-mysql mysql spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/bin/php-cgi -C 5 -U php

Getting along with Django

These days I am tackling with Django on a centos server. I installed django package downloaded from its site.Started a simple app. Now trying to use database mysql. When it ocmes to mysql I needed to install some packages like mysql-devel,python-devel and most importantly MySQL-python (notice the capital letters). An older version of this is in centos stable repos.After some search I learned I can install it in different ways like compiling or using test repo.I chose the former and installed python-setuptools. And then I realised that there is easy_install in this package which helps me installing the required MySQL-python package. And voila.

Centos mcelog reports incorrect record size

On a centos 5.5 64 bit server I was getting mcelog errors from cron.hourly/mcelog.cron stating "/etc/cron.hourly/mcelog.cron: mcelog: warning: record length longer than expected. Consider update" As a workaround I did add 2>&1 to the last line of /etc/cron.hourly/mcelog.cron file as mentioned in Known Issues in this page http://elrepo.org/tiki/kernel-ml