Thursday, February 25, 2010

Installing Proxy Server









Installing Proxy Server

Installing Web Server(Apache,MySQL ,CPanel)





Interlude:


What it means of an "Apache Web Server" is an easy deployment of a simple Web Server.The blog-article will explain the details of customizing your own URL server with a restrictions (online : user name Password),Database using MySQL and a little approach to cpanel installations(O! you can now be a host provider).If you want to upload its web content online you only need a public IP address and choose your own domain name.




Objectives:

Requirements:
[Hardware]
PII or higher CPU specs

[Software]

Downloading a file:
1)Apache
http://www.apache.org
2)Cpanel

3)MySQL

Methodology:



HowTos
:

Installing Apache2.X.X
Uncompress and extract the files using the command
  • #tar -zxvf httpd-2.0.49.tar.gz
Go to the directory it creates like httpd-version
  • #cd httpd-2.0.49
Run the following commands
  • #./configure --prefix=/usr/local/apache2 --enable-so
  • # make
  • # make install
Open the file /usr/local/apache2/conf/httpd.conf and make the following changes (vi or any editor can be used to open file)
  • Search and Replace www.new.com with IP address or hostname of your machine. Uncomment the line.
  • locate the line #ServerName and Replace with your servername.
Start Apache Server by the command and check for the status of the web server
  • /usr/local/apache2/bin/apachectl start
Open the browser and browse the default page at the URL: http://ip-no-machine-or-hostname/
If you are able to view apache page on your browser, it means that you have successfully installed Apache.

Installing CPanel

Install cPanel on a Linux Server

1) root@localhost# ssh root@ip_ad_of_host_server

2) ip_ad_of_host_server# cd /home

3) ip_ad_of_host_server# wget http://layer1.cpanel.net/latest

4) ip_ad_of_host_server# sh lates

5) Browse the cpanel

https://ip_ad_of_host_server:2087

6) Login to : https://ip_ad_of_host_server:2087

User name:

Password:

7) Customized now your cpanel-host server


Inserting a simple website
Adding a simple authentications
Adding a users' authentications
Adding encrypoted keys (https)



Remarks:


Conlclusions:

Installing Mail Server






Introductions:

What is Postfix? It is a software package known to used in deploying Mail server.This is Wietse Venema's mailer that started life at IBM research as an alternative to the widely-used Sendmail program.Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different.



Objectives:


Requirements:


Methodology:




Remarks


Conclusions:

Tuesday, February 23, 2010

Installing OpenLDAP(Linux)

Introductions:
What is LDAP
a)History
b)Protocol
LDAP vs relational DBASE
LDAP advantages

Requirements:

1) PC atleast PII
2) Linux OS: (CentOS,Fedora)
3) Directory Design(your simple directory)


Download:
Berkeley DataBase(you can choose 4.8 version)
http://www.oracle.com/technology/software/products/berkeley-db/db/index.html
OpenLDAP
ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.21.tgz
openldap-2.3.43-3.el5.i386
openldap-clients-2.3.43-3.el5.i386
openldap-servers-2.3.43-3.el5.i386


Howto:
A)Installing deficiencies:
Please skip this step if you have the following files active running
gcc
gcc-devel
[root@localhost local]# yum install gcc

B.1)Fix the evironment variable on CLI:
[root@localhost local]# CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include"
[root@localhost local]# export CPPFLAGS
[root@localhost local]# LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib"
[root@localhost local]# export LDFLAGS
[root@localhost local]# LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"
[root@localhost local]# export LD_LIBRARY_PATH CPPFLAGS LDFLAGS

B.2)Or setting the environment permanently
[root@localhost local]# vi /etc/profile
Add the following

____________________________________________________________________________
CPPFLAGS
="-I/usr/local/BerkeleyDB.4.8/include"
LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib"
LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"
export LD_LIBRARY_PATH CPPFLAGS LDFLAGS
---------------------------------------------------------------------------------------------------------------------------------------

C) The installations procedures

./configure
make depend
make
make install


Server Side
Configuring LDAP server:

Adding LDIF:

Apache Authentications:

Client Side

Conclusion:

Monday, February 22, 2010

Booting Linux OS in Apple Xserve Machine

Introductions:
The tutorial discusses about the HowTos' of booting and installing Linux into Mac Xserve server.It tackles some important software tools to emulate IBM BIOS-86 in Apple Xserve machine such as:Refit,Grub and Linux OS distro.

Requirements:
Refit Software
Fedora 12 Live CD ( as of the current Linux OS version)
Xserve 1.1

HowTo's:
1) Download Fedora Live CD 1X?
http://download.fedoraproject.org/pub/fedora/linux/releases/12/Live/i686/Fedora-12-i686-Live.iso

2) Download and Install refit for Mac
http://refit.sourceforge.net/

3) Download Grub files
http://www.4elements.com/files/grub.zip

4)Copy and unzip grub.zip in your root/EFI/ directory.
mainlib.db1# vi /root/EFI/ *.*

5)Configure grub.conf and modify to the following setting.
mainlib.db1# vi /root/EFI/grubefi/grub.conf
__________________________________________________________________
#
grub.cfg pxw 20090623
timeout=20
default=0
set F1=ctrl-x

set F2=ctrl-c
set color_normal=yellow/blue

menuentry "Loading Kernel"
{
fakebios root=cd0
linux /isolinux/vmlinuz0
root=CDLABEL=Fedora-11-x86_64
rootfstype=auto ro liveimg rhgb single acpi=force irqpoll video=efifb nomodeset
initrd /isolinux/initrd0.img
}

menuentry "Fedora-11-x86_64-Live CD boot"
{
fakebios root=cd0
linux /isolinux/vmlinuz0
root=CDLABEL=Fedora-11-x86_64
rootfstype=auto ro liveimg rhgb single acpi=force irqpoll video=efifb nomodeset
initrd /isolinux/initrd0.img
}

menuentry "REBOOT" {

reboot

}
_________________________________________________________________________________

6)Run the script in the shell prompt by executing the following cli command.
mainlib.db1# bash /efi/refit/enable-always.sh

7)Reboot the Xserve Machine.

8) Then Press "alt" Key first to load reFit Menu on Mac Xserve Machine

9) You will see the screen would be appearing so-Detail(3) ;

10)Select /grubefi(Linux icon) to boot on fedora Live CD.

11)During Live CD boot up -Detail(2) , a kernel configurations would be displayed.

12) Select a Menu-entry "Loading the Kernel" to load a kernel .If booting does not continue -Detail(2); select Menu-entry "Fedora-11-x86_64-Live CD boot" to load the image as well.

13) and the rolling of txts will end to root@localhost# prompt.

14) Edit X11.conf by using nano editor(default)
root@localhost# nano /etc/X11/X11.conf

Note:
(control+o is save and control+x is close)
_________________________________________________________________________________

Section "Device"
Identifier "fbdev driver"
Driver "fbdev"
EndSection
_________________________________________________________________________________

15) Exit to the shell
root@localhost# exit

16) Wait for the Live CD (Fedora 12) GUUI appear on the Desktop -Detail(6)

Please see Details (1 to 10) for your reference and guidance.


Detail(1) First try on Fedora Refit->Grub on USB Installation


Detail(2)Succesful boot on Grub (Fedora 12 Live CD)


Detail(3) Refit Menu: Apple OSX or Linux-Fedora 12


Detail(4) Roll out of Txt -> Loading the Kernel


Detail(5) Loading the image menu


Detail(6) Setting X11"fdev" before loading GUI to MAC Xserve 1.1

Detail(7) Linux ->Fedora 12 IDE on MAC Xserve


Detail(8)Desktop and applications directory on Live Fedora 12


Detail(9)Accessing the Shell "df- a" command


Detail(10)Accessing its physical drive SATA(master & Slave)


Detail(11) Rewriting and Formatting


Remarks:

The Mac Xserve server successfully boot on Linux OS Live CD (Fedora-12 ),and my next goal is to boot Linux operating system in Mac Xserve machine permanently.

Acknowledgements:
I would like to thank the following people overseas:
Martijn Broeders:
http://www.4elements.com/blog/install_fedora_on_xserve_part_three/


I appreciate much working in one of the most presitgious and "prime university" in the country-Data Center,University of the Philippines
Many thanks also to my co staffs -for the free snacks & meriendas


Installing Subversion(SVN) Repository




INTERLUDE:

The tutorials aims to discuss and share the HowTos of installing and deploying a repository which is accessible via web.Another method of storage-repository which has a lot of feauture and add-ons compare to the old CV's and an options to choose database backend such as Berkerly MIT FSFS or Berkeley(Oracle) BDB.

REQUIREMENTS:
Oracle BDB 4.X.X
Apache 2.X
SVN


DOWNLOADS & INSTALLATIONS:

Install Berkeley DB
1)Download BerkeleyDB 4.X.X
2)Extract the BerkeleyDB compressed file
3)Copy all the files into the base directory just extracted
4)cd into the build_unix directory in the extracted directory
root.localhost#
build_unix
5)Configure Berkerly DB
root.localhost# ../dist/configure

6)Compile Berkerly DB
root.localhost# make
7) Ensure you’re logged in as root and run…

root.localhost# make install(installs to /usr/local/BerkeleyDB.4.8)
8) Add the line /usr/local/BerkeleyDB.4.8/lib to the file/etc/ld.so.conf
root.localhost# vi /etc/ld.so.conf
9) Run ldconfig to update the library cache with the BerkeleyDB libraries

Install Apache
1) Ensure that the following packages are installed. If they’re not just do an apt-get install to download and install them.
root.localhost# autoconf libtool openssl libssl-dev zlib1g zlib1g-dev
2) Download tha latest version of Apache 2 from http://httpd.apache.org/download.cgi
3) Extract the Apache compressed file
4) cd in the extracted directory
5) Configure Apache

root.localhost# ./configure –enable-dav –enable-so –enable-ssl –with-dbm=db4 –with-berkeley-db=/usr/local/BerkeleyDB.4.8 –enable- deflate
6) Compile Apache
root.localhost#
make

7) Ensure you’re logged in as root and install now Apache
root.localhost#
make install
(installs to /usr/local/apache2)
8) Edit the file "httpd.conf"
roor.localhost# /
usr/local/apache2/conf/httpd.conf

9)
Update the User & Group tags to www-data (Assuming of course that you have that user & group)

Install SQLite
1) Download the latest version of SQLite http://www.sqlite.org/download.html
2) Uncompressed the file
localhost.root# tar -zxvf sqlite-3.6.23.1.tar.gz

3) Move the file in preferred directory (in my case)
localhost.root# mv sqlite-3.6.23.1 /usr/local/sqlite
4) localhost.root# cd /usr/local/sqlite
5)localhost.root# ./configure --prefix=/usr/local/sqlite
6)localhost.root# make
7)localhost.root# make install


Install Zlib
1) Download the latest version of Zlib http://www.zlib.net/
2) zlib-1.2.5.tar.gz format (532K, MD5 checksum c735eab2d659a96e5a594c9e8541ad63):
3) localhost.root# tar -zxvf zlib-1.2.5.tar.gz
4) localhost.root# mv zlib-1.2.5 /usr/local/zlib
5) localhost.root# cd /usr/local/zlib
6) localhost.root# ./configure --prefix=/usr/local/zlib
7) localhost.root# make clean
8) localhost.root# ./configure --prefix=/usr/local/zlib --shared
9) localhost.root# make test
10) localhost.root# make install


Install Subversion
1) Download the latest version of Subversion from http://subversion.tigris.org/getting_subversion.html
2) Extract the Subversion compressed file
root.localhost# tar -zxvf svn.x.x.tar.gz
3) Configure Subversion
root.localhost# /configure –with-ssl –with-berkeley-db=/usr/local/BerkeleyDB.4.8 –with-zlib
4) Compile Subversion

root.localhost#
make

5) Ensure you’re logged in as root and run…
root.localhost#
make install


Install Extra files for SVN

1) Yum install the ff: files
Downloading Packages:
apr-util-mysql-1.2.7-11.el5.i386.rpm | 14 kB 00:03
cyrus-sasl-plain-2.1.22-5.el5_4.3.i386.rpm | 27 kB 00:00
apr-util-devel-1.2.7-11.el5.i386.rpm | 53 kB 00:04
expat-1.95.8-8.3.el5_4.2.i386.rpm | 77 kB 00:01
apr-1.2.7-11.el5_3.1.i386.rpm | 123 kB 00:03
cyrus-sasl-lib-2.1.22-5.el5_4.3.i386.rpm | 127 kB 00:07
expat-devel-1.95.8-8.3.el5_4.2.i386.rpm | 132 kB 00:11
apr-util-docs-1.2.7-11.el5.i386.rpm | 228 kB 00:06
apr-devel-1.2.7-11.el5_3.1.i386.rpm | 231 kB 00:06
apr-docs-1.2.7-11.el5_3.1.i386.rpm | 531 kB 00:43
cyrus-sasl-2.1.22-5.el5_4.3.i386.rpm | 1.2 MB 01:10
cyrus-sasl-devel-2.1.22-5.el5_4.3.i386.rpm | 1.4 MB 00:56




SVN SERVER CONFIGURATIONS:

1)Create a directory to hold your repositories, something like /Repo/SVN/ folder
root.localhost# /usr/local/Repos/SVN

2)Change the ownership on the directory to the www-user user (or whoever you set the User tag to
in httpd.conf)
http://localhost/Repos/SVN
http://IP_address/Repos/SVN

3)Add users to Apache using this command…htpasswd -cm /etc/svn-auth-file . Leave out the c switch if the file already exists
root.localhost# htpasswd -cm /etc/svn-auth-file

4)Add the following section to
root.localhost# /usr/local/apache2/conf/httpd.conf

_______________________________________________________________________________________________

LoadModule dav_svn_module modules/mod_dav_svn.so
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_log deflate

DAV svn
SVNParentPath /usr/local/svn
AuthUserFile /etc/svn-auth-file
Require valid-user SetOutputFilter
DEFLATE SetInputFilter DEFLATE
_____________________________________________________________________________________
Ensure These config entries will password protect your repository ana allow for data sent between clients and apache to be compressed.
Note:** (This is optional- a simple authentication will do)
5)The next step is to try and get Apache using SSL because Basic authentication uses plain text when transmitting the password from the client to the server.

SVN CLIENTS:

OpenTortoise:
OpenSVN:

1)Download
2) Install
3)Configure

4) Testing

RUNNING SVN REPOSITORY:
1)STARTING APACHE
Ensure you’re logged in as root and run Apache
root.localhost#
/usr/local/apache2/bin/apachectl start

2)SVN URL
Browsing a WEB for SVN
http://localhost/svn/repos

3)SVN CLIENTS ACCESS
Access through SVN clients:


Moving a SVN repository from one server to another:

Our server is now full of data base with our pilot SVN ,hence we used SVN instead of CVs,so I need to move our main Subversion repository to a new server .

Here is a sample tutorial on how to move a Subversion repository from one system/server to another. To begin go to the source system and at a command prompt or terminal/shell window type:

root.localhost# svnadmin dump /path/to/repository > repository-name.dmp

Note:**

If the dump file is rather large you can compress it with your favorite zip utility. Now you need to get the dump to your new server, so simply transfer the file via FTP, local share, CD, thumbdrive or whatever it takes.A couple of small things to note – the dump file will be rather large as it represents every commit made on your repository. If your repository is rather large and mature, this file could get quite large.
Once the dump file is on the new machine and uncompressed, you need to set up and load the new repo by typing:
     root.localhost# cd /path/to/new-repository

root.localhost# svnadmin create repository-name
root.localhost#
svnadmin load repository-name<>

**This tutorials works across platforms, so moving from Linux to UNIX or Windows and visa-versa are also possible.


FSFS to BDB CONVERSION & VISE VERSA:
Say you have a repository, /svn/myrepos, which is using the BDB backend and you would like to switch to using the FSFS backend. Follow these steps to make the change:

Step by step procudes in FSFS to BDB conversions:
Dumping /loading from the old format to the new one:
1.) Close down your server so that the data cannot change during this procedure.
2. )Make a new repository specifying the fsfs backend (it is the default from 1.2 onwards), e.g., svnadmin create /svn/myreposfsfs --fs-type fsfs.

3. )Pipe the output of a dump from /svn/myrepos to the input of a load into /svn/myreposfsfs, e.g., svnadmin dump /svn/myrepos -q | svnadmin load /svn/myreposfsfs. Windows users should dump to a file and load from that file in two separate steps.


Copying the hook scripts:
1.)Copy any hook scripts that are active in /svn/myrepos/hooks into /svn/myreposfsfs/hooks. Don't mindlessly copy everything, as the templates generated by Subversion may have changed.
2.)Compare the template scripts that the svnadmin create command put in /svn/myreposfsfs/hooks with those in /svn/myrepos/hooks and incorporate any changes that you would like into your active hook scripts.

Copy the configuration files:

1.) Copy configuration files from /svn/myrepos/conf into /svn/myreposfsfs/conf (and don't forget a password file, if you use one). Or you might instead want to merge the changes that you made to your configuration files into the new default ones.
2.) Rename /svn/myrepos to /svn/myreposbdb and then /svn/myreposfsfs to /svn/myrepos, ensuring that the file permissions are the same as those that the BDB version had.
3. )Restart the server.


To do the reverse and migrate from FSFS to BDB, change the svnadmin create command to specify BDB.
Once you are happy that all is well with your new repository, delete the old one.


Detail(1)

REMARKS:


CONCLUSIONS:

Tuesday, February 2, 2010

Acessing USB drive in Linux(cli command)

Steps to access USB drive on Linux

1) Login as root

ex: Ubunto

linux/# sudo su

linux/# YOUR_login_PASSWORD:

2)Reset to appear a common linux prompt

linux/# reset

root@linux/#

3)Check if USB is detected

root@linux/# modprobe -i usb-storage

4)Make a directory for your USB drive

root@linux/# mkdir /mnt/usbstick

5) Check your drive partitions by issuing a cli command "df-l"

root@linux/# df -l

Note** Usually greping "sdb1" gives the right usb directory

6) Then mount that drive to the assigned directory for USB

root@linux/# mount /dev/sdb1 /mnt/usbstick

7)Goto the content of your USB directory

root@linux/# cd /mnt/usbstick

8) After all your work with USB unmount to remove the USB.

root@linux/# umount /dev/sdb1


Thanks


E^3