Apr 01

I assume you have install Vmware ESXi 4 on your baremetal server, if not youc an folow the installation step on this link

http://builddocs.com/server_os_builds/installing-vmware-esxi-version-4/

after you install the Vmware ESXi 4,  now i want to enable ssh and ftp so i can conenct to to consule and upload file into it.

By default adding ssh isn’t possible. But there’s a way to get this working, just do the following:

  1. Go to the ESXi console and press alt+F1
  2. Type: unsupported
  3. Enter the root password(No prompt, typing is blindly)
  4. At the prompt type “vi /etc/inetd.conf”
  5. Look for the line that starts with “#ssh” (you can search with pressing “/”)
  6. Remove the “#” (press the “x” if the cursor is on the character)
  7. Save “/etc/inetd.conf” by typing “:wq!”
  8. Restart the management service “/sbin/services.sh restart”

Now , how to enable ftp to the Vmware server, here is the step:

1) Download and extract this zip file.

– since vmware esx didn’t have unzip program i just unzip the files on another server and save it on the www directory let say we save it on http://localhost/proftpd/
2) Copy proftpd to /sbin or /usr/sbin/

– #cd /sbin

# wget http://localhost/proftpd/proftpd
3) Copy tcpd to /sbin or /usr/sbin/

-#cd /sbin

# wget http://localhost/proftpd/tcpd
4) Copy proftpd.conf to /etc. You may wish to edit the file to suit your environment.

-#cd /etc

#wget http://localhost/proftpd/proftpd.conf
5) Add the below lines to /etc/inetd.conf.

# vi /etc/inet.d.conf

# activate proftp daemon

ftp stream tcp nowait root /usr/sbin/proftpd proftpd

5) Determine the process id for inetd with the command ps | grep inetd

# ps | grep inetd
4895 4895 busybox              inetd
6) Restart inetd with this command kill -HUP <process id>

# kill -HUP 4895

Note that this change will not survive a reboot with ESXi. To have this available after a reboot you’ll need to add these changes to /etc/rc.local

#vi /etc/rc.local

add this

#! /bin/ash
cd /usr/sbin/ && wget http://localhost/proftpd/proftpd
cd /usr/sbin/ && wget http://localhost/proftpd/tcpd
chmod 755 /usr/sbin/proftpd
chmod 755 /usr/sbin/tcpd
cd /etc/ && wget http://localhost/proftpd/proftpd.conf

now you can reboot it and test the ftp

#reboot

vmware

Mar 26

PHP and perl are two very popular Web programming languages. They both have many libraries and extensions that can simplify the process of development, but often you can find a perl library you want, and not the corresponding library in PHP. (Perl is older then PHP, so naturally it has a larger selection of libraries and extensions.) This was the main reason that the perl extension for PHP was written.

Installation

download the php perl  extention

# cd /root

# wget http://pecl.php.net/get/perl-1.0.0.tgz

# tar -xvf perl-1.0.0.tgz

# cd perl-1.0.0

you can read the README for detail installation on /root/perl-1.0.0

======================================================================================

Requirements

============

PHP 5.0.0RC2 or later

Perl 5.8.0 or later
Quick install

=============
Step 1. Compile this extension. PHP_PREFIX and PERL_PREFIX mast point to

real

PHP and Perl instalation prefixes.
export PHP_PREFIX="/usr"

export PERL_PREFIX="/usr"

$PHP_PREFIX/bin/phpize

./configure --with-perl=$PERL_PREFIX

--with-php-config=$PHP_PREFIX/bin/php-config

make
Step 2. Install the extension (this step can require root privileges)
make install
Step 3. Add perl extension into your php.ini (this step can require root

privileges)
extension=perl.so

======================================================================================
I assume you have installed the php and perl, youc an use yast / zypper to do that

# php -v
PHP 5.3.1 (cli)

#rpm -qa | grep perl
perl-5.10.0-72.5.i586

you can search php  prefix path by using whereis

# whereis php
php: /usr//local/bin/php /usr/share/man/man1/php.1.gz

# export PHP_PREFIX=”/usr/local”
# export PERL_PREFIX=”/usr”
# $PHP_PREFIX/bin/phpize
# ./configure –with-perl=$PERL_PREFIX
–with-php-config=$PHP_PREFIX/bin/php-config
# make

you will find this error :

/root/perl-1.0.0/php_perl.c:172: warning: initialization from
incompatible pointer type
/root/perl-1.0.0/php_perl.c:173: warning: initialization from
incompatible pointer type
/root/perl-1.0.0/php_perl.c:199: warning: initialization from
incompatible pointer type
/root/perl-1.0.0/php_perl.c:200: warning: initialization from
incompatible pointer type
/root/perl-1.0.0/php_perl.c: In function âphp_perl_zval_to_sv_refâ:
/root/perl-1.0.0/php_perl.c:343: error: ‘zval’ has no member named ‘is_ref’

/root/perl-1.0.0/php_perl.c:1779: warning: assignment from incompatible
pointer type
make: *** [php_perl.lo] Error 1

Solution :

– it turns out the php_perl wasn’t compatible with the php 5.3

–  you need to go to http://svn.php.net/viewvc/pecl/perl/trunk/ -> click php_perl.c -> then click download (http://svn.php.net/viewvc/pecl/perl/trunk/php_perl.c?revision=289243&view=co)

– just wget http://svn.php.net/viewvc/pecl/perl/trunk/php_perl.c?revision=289243&view=co

– you will get php_perl.c\?revision\=289243 just rename it to php_perl.c then paste it to /root/perl-1.0.0/ then

#cd /root/perl-1.0.0
#/usr/local/bin/phpize
#./configure –with-perl=/usr/bin/perl –with-php-config=/usr/local/bin/php-config
#make
#make install

– Edit php.ini
#vim /usr/local/lib/php.ini
– add this line

extension=perl.so

– Restart the apache
#/usr/local/apache2/bin/apachectl stop
#/usr/local/apache2/bin/apachectl start

– Check your phpinfo
http:/localhost/phpinfo.php

perl