Tuesday, January 1, 2008

Apche,php,subversion Installation

APACHE INSTALLING WITH PHP


cd /usr/local/src/
wget http://government-grants.org/mirrors/apache.org/httpd/httpd-2.2.6.tar.gz
tar xzvf httpd*
cd httpd*

First configure apr

cd srclib/

cd apr
./configure --prefix=/usr/local/apr
make

make install
Then apr-util

cd ../apr-util/

./configure --prefix=/usr/local/apr-util/ --with-mysql=/path/to/mysql / --with-apr=/usr/local/apr/
make

make install



Now its ready to install apache

cd ../..

./configure --enable-dav=shared --enable-dav_fs=shared --enable-expires=shared --enable-deflate=shared --enable-rewrite=shared --disable-userdir --enable-maintainer-mode --with-apr-util=/usr/local/apr-util/ --with-apr=/usr/local/apr/ --with-included-apr --enable-so --enable-rewrite --enable-cgi --enable-ssl --enable-modules=all --enable-mods-shared=all --prefix=/usr/local/apache/


make

make install

to start apache.....

/usr/local/apache/bin/apachectl start


INSTALLING PHP

cd ..

wget http://in.php.net/get/php-5.2.4.tar.gz/from/this/mirror

tar xzvf php-5.2.4.tar.gz

cd php-5.2.4

./configure --enable-zip --with-mysql-sock=/tmp/--with-mysql=/usr/local/mysql/--enable-bcmath --with-apxs2=/usr/local/apache/bin/apxs --with-xml --with-gettext --enable-wddx=shared --enable-safe-mode --enable-mbstring --enable-magic-quotes --enable-inline-optimization --enable-ftp --enable-trans-sid --with-gd --with-dom --prefix=/usr/local/apache/php


make

make install

cp php.ini-dist /usr/local/lib/php.ini

ln -s /usr/local/lib/php.ini /etc/php.ini

And Add these lines to httpd.conf


AddType application/x-httpd-php .php .htm .html


Then restart apache.........



INSTALL SUB VERSION

Download SUBVERSION

cd /usr/local/src/

wget http://subversion.tigris.org/downloads/subversion-1.2.3.tar.gz

tar xzvf subversion-1.2.3.tar.gz

cd subversion*

./configure --with-apxs2=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util/ --with-ssl

make && make install

INSTALLATION OF SUBVERSION IS COMPLETED

Configuration in httpd.conf

vi /usr/local/apache/conf/httpd.conf

Add a Virtual Host Entry

For example
-------------------------------------------------
NameVirtualHost IP



AllowOverride AuthConfig
Order allow,deny
Allow from all

-----------SUBVERSION CONFIGURATION-------------------


DAV svn
SVNPath /var/www/html/svn/repos/

-----------------------------------------------------------------------------
DocumentRoot /var/www/html/
ServerName example.com



/usr/local/apache/bin/apachectl restart

Necessary steps to create Repository


cd /var/www/html/

mkdir svn

cd svn

svnadmin create repos


chown -R nobody:nobody repos


How to use “Subversion”



cd /tmp
mkdir mytestproj
cd mytestproj
mkdir configurations options main
vim configurations/testconf1.cfg -- Add whatever you want to these files.
vim options/testopts1.cfg
vim main/mainfile1.cfg

b) Importing:
COMMAND:
svn import /tmp/mytestproj/ file:///var/www/html/svn/repos/mytestproj -m "Initial repository layout for mytestproj"


Output

Adding /tmp/mytestproj/main
Adding /tmp/mytestproj/main/mainfile1.cfg
Adding /tmp/mytestproj/configurations
Adding /tmp/mytestproj/configurations/testconf1.cfg
Adding /tmp/mytestproj/options
Adding /tmp/mytestproj/options/testopts1.cfg
c) Checking out:
Now, just to check it out across the web browser: http://yourmachine/repos. You'll get whatever you have imported showing up to peruse. Once you upload your original layout from the local svn server, you're now free to use it remotely on another machine. As long as you are connecting to the Subversion server with the user account(s) that you created earlier. Let's give it a shot.

cd /tmp
svn co http://yoursvnserver/svn/repos/mytestproj



Output
Authentication realm: <http://yoursvnserver:80> Subversion repos
Password for 'youruser':
A mytestproj/main
A mytestproj/main/mainfile1.cfg
A mytestproj/configurations
A mytestproj/configurations/testconf1.cfg
A mytestproj/options
A mytestproj/options/testopts1.cfg
Checked out revision 1.
d) Edit and commit:
As you can see, you've checked out revision 1 from the Subversion server. Now you can edit some things and commit the changes back to the Subversion server.



cd mytestproj
vim configurations/testconf1.cfg -- Add or delete something and save.
svn commit -m "Added a line to testconf1.cfg."

Output

Sending configurations/testconf1.cfg
Transmitting file data .
Committed revision 2.
The nice thing about this then, is that you can delete all of the directories that you just checked out on your machine. The only reason you checked them out, was to edit them and then send them back up the line. Web browse to your server to check out the different files.
e) Adding/deleting items:
Now this is all fine and dandy, but how do you add more files to an already existing repo directory? Easy, with the add argument. Go ahead and check out your latest and greatest, copy a file over to the directory, add, then commit the changes.

svn co http://yoursvnserver/repos/mytestproj

Output

A mytestproj/main
A mytestproj/main/mainfile1.cfg
A mytestproj/configurations
A mytestproj/configurations/testconf1.cfg
A mytestproj/options
A mytestproj/options/testopts1.cfg
Checked out revision 2.


cd mytestproj

cp /etc/yum.repos.d/CentOS-Base.repo configurations/

svn add configurations/CentOS-Base.repo
A configurations/CentOS-Base.repo


svn commit -m "Added the CentOS Yum repo file."
Adding configurations/CentOS-Base.repo


Output

Transmitting file data .
Committed revision 3.
To delete items simply use delete instead of add. Commit your changes back up, and you're good to go. It's as simple as that. Go back over to your web browser again and you'll notice the revision number should say 3. You'll be able to click through the files to pick out your directories as well.
f) Reverting back:
Ok, this is all great but how do I revert back to an older revision...isn't this the point of Subversion? Yep, it's easy. If you're not sure as to what revision you're at...check out the log command. This is why you put a message into every commit. Short and to the point, but enough information to ring a bell that you perhaps forgot about.

svn log http://yoursvnserver/repo -- For the entire repository
svn log http://yoursvnserver/repo/mytestproj -- For the specific project

You'll get a nice complete list of revision numbers with the comments, like I mentioned above. This allows you to pick which revision you want to check back out now.

svn co -r 1 http://yoursvnserver/repo/mytestproj



This command will drag down revision number 1.