Monday, January 27, 2014

vmware player mounting /dev/vg_server/lv_root on /sysroot failed: No such device

If you got this problem after converting live Centos 6.5 into VMplayer image

1. Download minimal image of centos
2. mount this image at VMplayer
3. boot from minimal Centos image
4. go to Rescue mode
5. run bash
6. type 
 chroot /mnt/sysimage
 cd /boot
7.type
 
mkinitrd -v -f initrd and press TAB to autocomplete so command should looks like:

mkinitrd -v -f initrd2.6.32-431.3.1.img 2.6.32-431.3.1
 
wait until finished.
 
8. type exit and again exit and from main menu choose reboot
9. boot from local drive 

if still does not work

follow again points 1-6

7. you have to recreate initramfs - at first create a backup copy of the current initramfs: 
 type:
cp -p /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

8. Now create the initramfs for the current kernel, type
dracut -f

** If you need to build it for a specific kernel version (replace the version appropriately):

dracut -f /boot/initramfs-2.6.32-431.3.1.el6.x86_64.img 2.6.32-431.3.1.el6.x86_64


9. type exit and again exit and from main menu choose reboot
10. boot from local drive 

 

Monday, January 20, 2014

apache server-status behind nginx

If you cannot access /server-status page on apache which is behind nginx

1. check if elinks are installed
  • rpm -aq|grep elinks
    elinks-0.12-0.6.pre2.fc10.i386
    (Checks if elinks is installed.  Do this before installing elinks.)
  • yum install elinks
    (IF elinks is NOT installed)
  • rpm -aq|grep elinks
    elinks-0.12-0.6.pre2.fc10.i386
    (To verify installation worked) 
2. Check if status is enabled in httpd.conf
  • vi /etc/httpd/conf/httpd.conf
  • Find and uncomment the line ExtendedStatus On (Remove # from start of line)
  • Find and uncomment the following directives.  Change configuration From #<Location /server-status>
    #   SetHandler server-status
    #    Order deny,allow
    #    Deny from all
    #    Allow from example.com
    #</Location>
    To <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from localhost 127.0.0.1
    </Location>
  • Save the configuration file and exit (In vi type :wq )
  • service httpd restart
    (Restart the httpd service) 
 If still cannot access add to nginx/conf.d/default.conf

location /server-status/ {
           fastcgi_pass 127.0.0.1:9000 #if using php-fpm
           proxy_pass http://127.0.0.1:8080 #to your local listening apache on port 8080 or other
}

3. restart nginx

4. if still does not work - check if you use virtual host on apache, if yes move your block  

<Location /server-status> inside <VirtualHost *:8080> 

and restart apache

5. check if you can access

lynx -dump http://127.0.0.1:8080/server-status


6. if still does not work check if there is no redirection problem in .htaccess file and add

RewriteCond %{REQUEST_URI} !=/server-status



 



Wednesday, January 8, 2014

CentOS 6 - user with limited commands and access - restricted bash


Add a user who can execute some specific commands. 
 
[1] Create a link named 'rbash' from bash.
[[email protected] ~]#
ln -s /bin/bash /opt/rbash
[2] Add a user that his default shell is rbash and set he can execute only 'ping'.
[[email protected] ~]#
useradd cern -s /opt/rbash

[[email protected] ~]#
passwd cern

[[email protected] ~]#
mkdir /home/cern/bin

[[email protected] ~]#
ln -s /bin/ping /home/cern/bin/ping

[[email protected] ~]#
chown root. /home/cern/.bash_profile

[[email protected] ~]#
chmod 755 /home/cern/.bash_profile

[[email protected] ~]#
vi /home/cern/.bash_profile
# change PATH like follows

PATH=
$HOME/bin

[3] Login with the test user.
[[email protected] ~]$
cd

-rbash: cd: restricted
# denied

[[email protected] ~]$
ls

-rbash: ls: command not found
# none

[[email protected] ~]$
ping localhost

PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.045 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.008 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.008 ms
--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2157ms
rtt min/avg/max/mdev = 0.008/0.020/0.045/0.017 ms
# executed


found at: http://www.server-world.info/en/note?os=CentOS_6&p=rbash

Monday, January 6, 2014

[Solved] Magento - dbModel read resource does not implement Zend_Db_Adapter_Abstract or Magento install error - Exception printing is disabled

Magento - dbModel read resource does not implement Zend_Db_Adapter_Abstract 

or 

Magento install error - Exception printing is disabled


If you enabled full page cache on Zend server this error shows up:


dbModel read resource does not implement Zend_Db_Adapter_Abstract
Trace
:#0 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Mysql4\Collection\Abstract.php(68): Varien_Data_Collection_Db->setConnection(false)


What you should do next:

1. try to clear cache - erase all files from MAGENTO_ROOT/var/cache/ directory

2. change settings 



1. Navigate to the \"errors\" folder.
2. Change local.xml.sample to local.xml
3. You should now see a new list of crazy errors all over the Magento page - this is okay.
4. Open magento/lib/Zend/Cache/Backend/File.php and look for:

protected $_options = array(\'cache_dir\' => \'null\',

5. Change it to:


protected $_options = array(\'cache_dir\' => \'tmp/\',

6 .Save it.
7. Now the final step is to go create a tmp folder in the root Magento folder. (make permission 777 and ownership as web server user)
8. That’s it.  

Cybermap

Internet Storm Center Infocon Status

Internet Storm Center Infocon Status
Internet Storm Center Infocon Status