Skip to main content

Posts

Showing posts from May, 2010

Installing Nginx on FreeBSD 8.0

Nginx (engine-X) is a light and fast web server to serve a static & dynamic web content. It has many features that can be enable from the modules. Witha lower memory consumption, it is the choice for a busy web server. Nginx can be configured to replace the popular Apache web server next time :) we are going to install Nginx with a basic configuration on FreeBSD 8.0. 1) Update your ports shell> cvsup -g -L 2 ports-supfile 2) Install from ports shell> cd /usr/ports/www/nginx shell> make configure shell> make install distclean Make sure you install modules that you required to use. 3) Enable at boot shell> nano /etc/rc.conf add : nginx_enable="YES" To start the nginx simply run this command : shell> /usr/local/etc/rc.d/nginx start Configuration file : /usr/local/etc/nginx/nginx.conf Log file : /var/log/nginx-error.log /var/log/nginx-access.log Document root : /usr/local/www/nginx yatta~

PAM SSH Failed

The problem occur today when I'm installing ShellinaBox for our project purporse. As you can see it said that tty 'pts/2' is not secure. so what to do? May 20 19:41:35 localhost login: pam_securetty(remote:auth): access denied: tty 'pts/2' is not secure ! May 20 19:41:39 localhost login: FAILED LOGIN 1 FROM 192.168.1.110 FOR root, Authentication failure 1) Edit your /etc/securetty default: console vc/1 vc/2 vc/3 vc/4 vc/5 vc/6 vc/7 vc/8 vc/9 vc/10 vc/11 tty1 tty2 tty3 tty4 tty5 tty6 tty7 tty8 tty9 tty10 tty11 2) Just add the pts/2 in the list console vc/1 vc/2 vc/3 vc/4 vc/5 vc/6 vc/7 vc/8 vc/9 vc/10 vc/11 tty1 tty2 tty3 tty4 tty5 tty6 tty7 tty8 tty9 tty10 tty11 pts/2 Run back the ShellinaBox, and you are good to go.. yatta~~

Install Django on Ubuntu

If you are geek then this post is not for your level.. :) 1)Download django 2)Extract and install shell> tar xzvf Django-1.1.1.tar.gz shell> mv Django-1.1.1 django shell> cd django shell> sudo python setup.py install Then test on your console : django$ python Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> If no error, then you are good to go! yatta~

MySQL Enterprise thingy

It's been a weird thing when you install MySQL server especially the one that is 'enterprise' version is not working with your PHP. That is the problem that my friend and I facing today. Since PHP require php-mysql extension to connect to MySQL server but php-mysql is only work with mysql-server from the Repos (Redhat/Centos). 1) Remove default mysql-server/php-mysql 2) Install MySQL Enterprise 3) Dependencies conflict occur + headache + install php-mysql shell> yum install php-mysql Loaded plugins: rhnplugin, security Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php-mysql.x86_64 0:5.1.6-27.el5 set to be updated --> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: php-mysql --> Processing Dependency: libmysqlclient.so.15()(64bit) for package: php-mysql --> Running transaction check ---> Package mysql.x86_64 0:5.0.77-4.el5_4.2 set to be updated --> Process

Python - Xen and libvirt

more function can be found in python dir libvirtclass.txt shell> find / -name libvirtclass.txt Generated Classes for libvir-python # # Global functions of the module # # functions from module libvirt open() openReadOnly() virEventRegisterImpl() virInitialize() # functions from module virterror virGetLastError() virResetLastError() # # Set of classes of the module # Class virDomain()     # functions from module libvirt     ID()     OSType()     XMLDesc()     attachDevice()     blockPeek()     connect()     coreDump()     create()     destroy()     detachDevice()     maxMemory()     maxVcpus()     memoryPeek() migrate()     name()     reboot()     ref()     resume()     save()     setAutostart()     setMaxMemory()     setMemory()     setVcpus()     shutdown()     suspend()     undefine()     # functions from module python     UUID()     UUIDString()     autostart()     blockStats()     info()     interfaceStats()     pinVc

Python - Xen and libvirt

basic python script with libvirt #!/usr/bin/python -u import libvirt import sys import os if not os.access("/proc/xen", os.R_OK):     print 'System is not running a Xen kernel'     sys.exit(1) conn = libvirt.openReadOnly(None) if conn == None:     print 'Failed to open connection to the hypervisor'     sys.exit(1) # print conn for id in conn.listDomainsID():        dom0 = conn.lookupByID(id)     print "Dom %s State %s" % ( dom0.name(), dom0.info()[0]) Some example : python# ./script1.py Please choose : 1) Show VPS 2) test 2 1 Domain Domain-0 ID 0 State 1 OS linux (Active Domain) Domain zenvps2 ID 3 State 2 OS linux (Active Domain) Domain zenvps ID 4 State 2 OS linux (Active Domain)