Monday, August 13, 2012

SElinux problems running custom build Apache

#Install SELinux trubleshoot
yum install setroubleshoot-doc.x86_64 setroubleshoot-plugins.noarch setroubleshoot.x86_64 setroubleshoot-server.x86_64

#This clears whole audit.log use with cotion
#echo ""> /var/log/audit/audit.log

#Run sealert -a to see the problem recomandation
sealert -a /var/log/audit/audit.log

#Run this to what should be done grep by blocked aplication
grep httpd /var/log/audit/audit.log | audit2allow

#Create exceptin module
grep httpd /var/log/audit/audit.log | audit2allow -M apache

#Install custom module to permit exception
semodule -i apache-unlink.pp

#Remove module if its is not neded
semodule -r apache-unlink.pp

#SELinux Labeling file and dirs
semanage fcontext -a -t httpd_sys_content_t '/var/www(/.*)?'

#Apply new policy on files
 restorecon -R -v /var/www

#Copy SELinux policy lable
chcon --reference=/usr/bin/test /usr/bin/test1

#Apply new policy on file
restorecon -v /usr/bin/test1

#Human readable events
cat /var/log/audit/audit.log | ausearch -i |less

#Human readable events realtime
tail -f /var/log/audit/audit.log | ausearch -i

Friday, January 27, 2012

OracleVM 3 PW drivers for Oracle Linux 5u7

So, to boot OL5U7, you pass xen_emul_unplug=never on the kernel boot line, which allows the machine to boot with the emulated devices, i.e. they are not unplugged.

Then, edit /etc/modprobe.conf to replace the emulated devices with xen-netfront and xen-blkfront:
Fiel /etc/modprobe.conf should look like this:
alias eth0 xen-netfront
alias scsi_hostadapter xen-blkfront

Then, rebuild initrd:
mkinitrd -f -v --builtin=ehci-hcd --builtin=ohci-hcd --builtin=uhci-hcd /boot/initrd-`uname -r`.img `uname -r`

And reboot. You may get kudzu renaming ifcfg-eth0 to ifcfg-eth0.bak on reboot, because it detects "new" hardware. If so, just rename it back and it should be fine.

Nepomuk reindexing everything after restart

Nepomuk reindexing everything after restart
In your ~/.kde[4]/share/config/nepomukstrigirc file is the the the "first run=" option false?

Tuesday, January 17, 2012

PV-HWM drivers OracleVM 3.0.2 - 3.0.3

In file /etc/modprobe.conf this should be present

#alias eth0 8139cp
#alias scsi_hostadapter ata_piix
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1
alias sym53c8xx off
alias scsi_hostadapter xen-vbd
alias eth0 xen_vnif

and initrd shut be regenerated

mv /boot/initrd-2.6.18-274.el5.img /boot/initrd-2.6.18-274.el5.img.old ;
mkinitrd -v /boot/initrd-2.6.18-274.el5.img 2.6.18-274.el5 --with=xen-vbd --with=xen-vnif --preload=xen-balloon --preload=xen-platform-pci

LVM filter update

After LVM filter update LVM cache has to be removed

# By default we accept every block device:
#filter = [ "a/.*/" ] default
filter = [ "a|/dev/mpath/notblacklisteddevice|", "r|.*|" ]

rm /etc/lvm/cache/.cache
vgscan

Thursday, May 26, 2011

Check Linux services on different maschines

chkconfig --list |grep "5:on"|sort >remote-service-list.txt
chkconfig --list |grep "5:on"|sort >local-service-list.txt
diff -b remote-service-list.txt local-service-list.txt |grep "<" |awk '{print $2}' >diff-service.txt

Friday, May 6, 2011

Using a proxy for apt-get in Ubuntu

Easy way to get apt-get to work with a proxy in Ubuntu
Place the following settings into the file /etc/apt/apt.conf.d/proxy:
Acquire::http::Proxy "http://proxy:8080";