How to Configure Static IP Address and Set Hostname on Fedora 20

This post will show the step to set the hostname and configure static IP address to the server. DHCP is not recommended if you plan to run this fedora 20 as a server. By default in Fedora 20, ifconfig command is not installed automatically. You should install net-tools package, it includes ifconfig and netstat.

ifconfig not installed by default :

[root@localhost ~]# ifconfig
-bash: ifconfig: command not found

1. Install net-tools, it will include ifconfig :

[root@localhost ~]# yum install net-tools -y
fedora/20/x86_64/metalink                                                    | 8.7 kB  00:00:01
fedora                                                                       | 3.8 kB  00:00:01
updates/20/x86_64/metalink                                                   | 5.0 kB  00:00:00
updates                                                                      | 4.9 kB  00:00:00
(1/4): fedora/20/x86_64/group_gz                                             | 394 kB  00:00:37
(2/4): updates/20/x86_64/group_gz                                            | 394 kB  00:00:43
(3/4): updates/20/x86_64/primary_db                                          | 8.8 MB  00:03:22
(4/4): fedora/20/x86_64/primary_db                                           |  18 MB  00:04:35
(1/2): updates/20/x86_64/pkgtags                                             | 1.0 MB  00:00:09
(2/2): updates/20/x86_64/updateinfo                                          | 920 kB  00:00:18
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.15.20131119git.fc20 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package             Arch             Version                                Repository        Size
====================================================================================================
Installing:
 net-tools           x86_64           2.0-0.15.20131119git.fc20              fedora           308 k

Transaction Summary
====================================================================================================
Install  1 Package

Total download size: 308 k
Installed size: 937 k
Downloading packages:
warning: /var/cache/yum/x86_64/20/fedora/packages/net-tools-2.0-0.15.20131119git.fc20.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 246110c1: NOKEY
Public key for net-tools-2.0-0.15.20131119git.fc20.x86_64.rpm is not installed
net-tools-2.0-0.15.20131119git.fc20.x86_64.rpm                               | 308 kB  00:00:10
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-x86_64
Importing GPG key 0x246110C1:
 Userid     : "Fedora (20) "
 Fingerprint: c7c9 a9c8 9153 f201 83ce 7cba 2eb1 61fa 2461 10c1
 Package    : fedora-release-20-1.noarch (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-x86_64
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.15.20131119git.fc20.x86_64                                       1/1
  Verifying  : net-tools-2.0-0.15.20131119git.fc20.x86_64                                       1/1

Installed:
  net-tools.x86_64 0:2.0-0.15.20131119git.fc20

Complete!

2. How to set the hostname :

[root@localhost ~]# vi /etc/hostname

Update to the preferred hostname :

 
fedora20.ehowstuff.local

3. Verify the interface name. In my case, the auto assigned interface for my ip address was ifcfg-ens32. It could be different from your server :

[root@localhost ~]# ls /etc/sysconfig/network-scripts/
ifcfg-ens32  ifdown-isdn    ifup-aliases  ifup-plip    ifup-wireless
ifcfg-lo     ifdown-post    ifup-bnep     ifup-plusb   init.ipv6-global
ifdown       ifdown-ppp     ifup-eth      ifup-post    network-functions
ifdown-bnep  ifdown-routes  ifup-ippp     ifup-ppp     network-functions-ipv6
ifdown-eth   ifdown-sit     ifup-ipv6     ifup-routes
ifdown-ippp  ifdown-tunnel  ifup-ipx      ifup-sit
ifdown-ipv6  ifup           ifup-isdn     ifup-tunnel

4. Configure static IP address :

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32

The original configuration file :

TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens32"
UUID="8f3bcce9-631f-4874-a642-c78b2badb94d"
ONBOOT="yes"
HWADDR="00:0C:29:8C:7B:FE"
PEERDNS="yes"
PEERROUTES="yes"

Change to below :

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens32"
UUID="8f3bcce9-631f-4874-a642-c78b2badb94d"
ONBOOT="yes"
HWADDR="00:0C:29:8C:7B:FE"
PEERDNS="yes"
PEERROUTES="yes"
IPADDR="192.168.0.20"
NETMASK="255.255.0.0"
GATEWAY="192.168.0.1"

5. Disable network manager and use the simple network service :

[root@localhost ~]# systemctl disable NetworkManager.service
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
[root@localhost ~]# systemctl start network.service
[root@localhost ~]# chkconfig network on

6. Reboot server :

[root@localhost ~]# reboot

7. Once rebooted, verify the updated hostname and ip address :

[root@fedora20 ~]# hostname
fedora20.ehowstuff.local
[root@fedora20 ~]# ifconfig
ens32: flags=4163  mtu 1500
        inet 192.168.0.20  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::20c:29ff:fe8c:7bfe  prefixlen 64  scopeid 0x20
        ether 00:0c:29:8c:7b:fe  txqueuelen 1000  (Ethernet)
        RX packets 335  bytes 34848 (34.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 322  bytes 28792 (28.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Linux Kernel Panel: What’s what with Linux today

Summary: Some of Linux’s best and brightest kernel developers talk about the state of Linux development today.

Napa Valley, CA: At an exclusive gathering at the Linux Collaboration Summit, some of the crème de la crème of Linux developers talked about what’s going on with the Linux kernel today.

This year, an elite Linux kernel hacker panel was made up of Red Hat’s Dave Chinner; SUSE’s Mel Gorman; Facebook’s Jen Axboe; Nebula’s Matthew Garrett; The Linux Foundation’s own Greg Kroah-Hartman; and, as usual, moderator Jon Corbet, co-founder of the top hardcore Linux news site, LWN.net.

The panel opened with Corbet pointing out that today “Almost all the people who work on the kernel are paid to do it. Only 10 percent to 20 percent are volunteers. What do your companies expect to get from your kernel work?”

Garrett replied, “Cynically we can’t depend on people to do the things we need to get done. I’ve written some code that helps our needs and then that helps other people. By showing that you’re really happy to help other people, they’re happy to help you. I help people, they help me.” The others agreed.
What’s Hot on ZDNet

Linux Kernel Panel: What’s what with Linux today
Hackonomics: Stolen Twitter accounts ‘more valuable’ than credit cards
AMD’s biggest challenge to date? Cutting global datacenters
Enterprise Mobility Suite expected with Office for iPad

Corbett then asked Axboe what Facebook got from paying for Linux kernel development. He replied “As we are shown with Open Compute, Facebook’s open-sourcing of data-center technology, “It makes economic sense to develop with open source. Facebook probably saves a billion dollars in development costs alone.”

Gorman added that with open source development, you’re spreading around the risk of development. “If we were just working on our own stuff, it would be like working in an echo-chamber.”

Next, Corbet observed that “Many of us work for companies that don’t like each other. While some company agendas appear in Linux development, it’s not bad. How do we do that?”

Kroah-Hartman replied that “Competitors rely on each other to survive. Marketing and suits can fight, but they know and we [the developers] know that we’re in this together.” Axboe explained, “Our work runs across companies.”

Besides, Garrett added, “These people are my friends. We like each other.” To which, Chinner replied “We’re working on a common goal. No single company has the expertise to do the job.”

That’s not to say that everyone loves everyone else in open-source circles. Far from it! Corbet noted that some user-space developers—that is, independent software vendors (ISV)s who build programs on top of Linux—are sometimes very angry with the Linux kernel developers.

Recently, for example, the PostgreSQL community was mad at the Linux kernel devlopers for making changes that made their database management system run software slower.

Chinner replied that “A lot of people watch we do, but we don’t see what they’re doing until we break something of theirs. I treat this problem by telling them to tell me about their workloads and what they do. If I don’t understand what you’re doing, I can’t help you. ISVs need to collabrate. This needs to be a two-way street.”

It doesn’t have to be that way. Kroah-Hartman said he hears about problems like this “all the time. We are very visible. It’s easy to find us. Our e-mail addresses are out there. Tell us your problems and we’ll see what we can do.”

In the case of PostgreSQL, for example, Gorman commented, “We [the Linux kernel developers] felt that Postgres was fine. 350 messages later I knew people weren’t happy. Part of that is our problem. We need to be more open and invite them to talk to us.”

Some programmers, both inside and outside Linux kernel development circles, also have problems with new Linux additions and features. In particular, Corbett mentioned that lots of people still hate cGroups. CGroups is a Linux kernel feature used to limit, account and isolate process CPU, I/O, system memory, and other resources.

Kroah-Hartman replied that “We’re way past what Unix could do. We blaze new trails.” Gorman acknowledged this, but “Some changes aren’t helpful. We shouldn’t bolt on new stuff to fix old problems.” An example of that, in his opinion, is cGroups.

Chinner added that things change and it’s impossible to predict how what seemed like a good idea at the time for one case would end up not being right for other cases years down the road. “With cGroups, it was meant for High-Performance Computing (HPC). Today we have completely different use cases.”

Besides, Chinner continued, “We don’t get things right the first time. We don’t know how tech will be used five, ten years down the track. Sometimes we get it wrong.”

For example, Kroah-Hartman said, “There was recently a nasty USB 3 bug in the latest test Linux kernels. We broke a lot of people’s machines. We fixed it. That was my mistake.” All the developers agreed that more testing, particularly automated testing—not just eyeballs—is needed to catch more bugs.

That said, Garrett pointed out, “Linux is the biggest open source project in the history of the world and it has minimal management. It’s a miracle it works as well as it does.” Besides, Kroah-Hartman added, “We still do it better [build operating systems] than anyone else. We fail less. Give us credit.”

Click here for full story

Display Hard disk Infomation using hdparm

Hdparm is a free tool for linux to measure sequential disk performance which is primarily used to tune and optimize disk parameters or to set and view hard disk drive hardware parameters. It is working on SATA/ATA/IDE/SAS disk. The command below has been tested on CentOS 6.5 and running on VMware ESXi 4.1 virtual machine.

Install the hdparm :

[root@server ~]# yum install hdparm -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * Webmin: download.webmin.com
 * base: mirror.upsi.edu.my
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.upsi.edu.my
 * updates: centos.mirror.secureax.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package hdparm.x86_64 0:9.43-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package               Arch                  Version                      Repository           Size
====================================================================================================
Installing:
 hdparm                x86_64                9.43-4.el6                   base                 81 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 81 k
Installed size: 150 k
Downloading Packages:
hdparm-9.43-4.el6.x86_64.rpm                                                 |  81 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : hdparm-9.43-4.el6.x86_64                                                         1/1
  Verifying  : hdparm-9.43-4.el6.x86_64                                                         1/1

Installed:
  hdparm.x86_64 0:9.43-4.el6

Complete!

To display the configuration of the hard disk :

[root@server ~]# hdparm /dev/sda

/dev/sda:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 multcount     =  0 (off)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 2871/255/63, sectors = 46137344, start = 0

To check the speed of the hard disk :

[root@server ~]# hdparm -Tt /dev/sda

/dev/sda:
 Timing cached reads:   2024 MB in  2.00 seconds = 1012.10 MB/sec
 Timing buffered disk reads: 534 MB in  3.00 seconds = 177.94 MB/sec

To measure how many MB/s your hard disk (SATA/IDE) can read :

[root@server ~]# hdparm -t --direct /dev/sda

/dev/sda:
 Timing O_DIRECT disk reads: 1122 MB in  3.00 seconds = 373.67 MB/sec

How to Setup Samba SWAT on CentOS 6.5

Samba service can provides files haring and printing services to its clients. System administrator can install SWAT in order to configure samba and perform samba administration from the web browser. In this post i will show simple steps to get Samba SWAT running on your CentOS 6.5 server. With SWAT, you can easily manage your samba server without messing with command line. You just need to install xinetd together with samba-SWAT software.

1. Install samba-swat and xinetd :

[root@samba ~]# yum install samba-swat xinetd -y

2. Software install will be as below :

====================================================================================================
 Package                        Arch            Version                      Repository        Size
====================================================================================================
Installing:
 samba-swat                     x86_64          3.6.9-167.el6_5              updates          7.3 M
Installing for dependencies:
 libtalloc                      x86_64          2.0.7-2.el6                  base              20 k
 libtdb                         x86_64          1.2.10-1.el6                 base              33 k
 libtevent                      x86_64          0.9.18-3.el6                 base              26 k
 samba                          x86_64          3.6.9-167.el6_5              updates          5.0 M
 samba-common                   x86_64          3.6.9-167.el6_5              updates           10 M
 samba-winbind                  x86_64          3.6.9-167.el6_5              updates          2.1 M
 samba-winbind-clients          x86_64          3.6.9-167.el6_5              updates          2.0 M
 xinetd                         x86_64          2:2.3.14-39.el6_4            base             121 k

Transaction Summary
====================================================================================================
Install       9 Package(s)

Total download size: 27 M
Installed size: 85 M

3. Add 192.168.0.0/24 network and enable swat by set ‘disable’ to ‘no’.

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
        only_from       = 127.0.0.1 192.168.0.0/16
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}

4. Start the xinetd service :

[root@samba ~]# service xinetd start
Starting xinetd:                                           [  OK  ]

5. Make xinetd auto start at boot :

[root@samba ~]# chkconfig xinetd on

6. Access to [http://(server’s IP address):901] and enter root login password.

Ldapsearch Examples for 389 Directory

This post will show you the list of ldapsearch examples for 389 Directory. This ldapsearch examples assumes the following:

a)This ldapsearch is search for uid in the directory.
b)The 389 directory is configured to not support anonymous access, then the user “Directory Manager” and the password is required
c)This ldapsearch command has been run on the 389 server itself, so “localhost” for host is enough.
d)The server uses port number 389. Since this is the default port, the port number does not have to be sent in the search request.

-D binddn  bind DN
-b basedn  base dn for search
-h host    LDAP server
-w passwd  bind password (for simple authentication)
-W         prompt for bind password (Recommended to use this to hide password)
ldapsearch -h localhost -D "cn=Directory Manager" -W -b dc=ehowstuff,dc=local uid=user1

Example :

[root@ldapmaster-11 ~]# ldapsearch -h localhost -D "cn=Directory Manager" -W -b dc=ehowstuff,dc=local uid=user1
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base  with scope subtree
# filter: uid=user1
# requesting: ALL
#

# user1, ehowstuff.local
dn: uid=user1,dc=ehowstuff,dc=local
uid: user1
givenName: user1
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetorgperson
sn: test
cn: user1 test
userPassword:: e1NTSEF9eTdNQTcyNUxnNjNPRXUxNUVkYk84TEJlTmp3M2d3Z3VoVEIreHc9PQ=
 =

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

How to Change 389 LDAP Password using PHP Scripting

Change 389 LDAP PasswordThis article has been prepared for the purpose of future reference for system administrator. It will describe how to change 389 ldap password using PHP scripting. In order to use this PHP script, you just need to change few parameters and also tested on CentOS 6.5. 389 LDAP Directory is an enterprise-class Open Source LDAP server for GNU/Linux. It is hardened by real-world use, is full-featured, supports multi-master replication, and already handles many of the largest LDAP deployments in the world.

Steps to Change 389 LDAP Password using PHP Scripting

1. Make sure your 389 ldap has been configure correctly :
2. Install php-ldap package into your apache server :

[root@ldapmaster-11 ~]# yum install php-ldap -y

3. Create changepassword.php file and put it into your apache root directory :

[root@ldapmaster-11 ~]# vim /var/www/html/changepassword.php

Modify the $server and $dn in .php file :

<?php
$message = array();

function changePassword($user,$oldPassword,$newPassword,$newPasswordCnf){
  global $message;

  $server = "localhost";
  $dn = "dc=ehowstuff,dc=local";
  $userid = $user;

  $user = "uid=".$user.",".$dn;
  error_reporting(0);
  ldap_connect($server);
  $con = ldap_connect($server);
  ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);

  // bind anon and find user by uid
  $sr = ldap_search($con,$dn,"(uid=*)");
  $records = ldap_get_entries($con, $sr);

  $message[] = "Username: " . $userid;
  //$message[] = "DN: " . $user;
  //$message[] = "Current Pass: " . $oldPassword;
  //$message[] = "New Pass: " . $newPassword;

  /* try to bind as that user */
  if (ldap_bind($con, $user, $oldPassword) === false) {
    $message[] = "Error E101 - Current Username or Password is wrong.";
    return false;
  }
  if ($newPassword != $newPasswordCnf ) {
    $message[] = "Error E102 - Your New passwords do not match! ";
    return false;
  }
  if (strlen($newPassword) < 4 ) {
    $message[] = "Error E103 - Your new password is too short! ";
    return false;
  }
  if (!preg_match("/[0-9]/",$newPassword)) {
    $message[] = "Error E104 - Your new password must contain at least one digit. ";
    return false;
  }
  if (!preg_match("/[a-zA-Z]/",$newPassword)) {
    $message[] = "Error E105 - Your new password must contain at least one letter. ";
    return false;
  }
  if (!preg_match("/[A-Z]/",$newPassword)) {
    $message[] = "Error E106 - Your new password must contain at least one uppercase letter. ";
    return false;
  }
  if (!preg_match("/[a-z]/",$newPassword)) {
    $message[] = "Error E107 - Your new password must contain at least one lowercase letter. ";
    return false;
  }

  /* change the password finally */
  $entry = array();
  $entry["userPassword"] = "{SHA}" . base64_encode( pack( "H*", sha1( $newPassword ) ) );

  if (ldap_modify($con,$user,$entry) === false){
    $message[] = "E200 - Your password cannot be change, please contact the administrator.";
  } else {
    $message[] = " Your password has been changed. ";
    //mail($records[0]["mail"][0],"Password change notice : ".$userid," Your password has just been changed.");
  }
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Change your LDAP password</title>
  <style type="text/css">
  body { font-family: Verdana,Arial,Courier New; font-size: 0.7em;  }
  input:focus { background-color: #eee; border-color: red; }
  th { text-align: right; padding: 0.8em; }
  #container { text-align: center; width: 500px; margin: 5% auto; }
  ul { text-align: left; list-style-type: square; }
  .msg { margin: 0 auto; text-align: center; color: navy;  border-top: 1px solid red;  border-bottom: 1px solid red;  }
  </style>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
  <div id="container">
    <h2>Change your LDAP password</h2>
<ul>
  <li> Your new password must be 8 characters long and contain at least one letter and one digit. </li>
</ul>
    <form action="<?php print $_SERVER['PHP_SELF']; ?>" name="passwordChange" method="post">
      <table style="width: 400px; margin: 0 auto;">
        <tr><th>Username:</th><td><input name="username" type="text" size="20" autocomplete="off" /></td></tr>
        <tr><th>Old password:</th><td><input name="oldPassword" size="20" type="password" /></td></tr>
        <tr><th>New password:</th><td><input name="newPassword1" size="20" type="password" /></td></tr>
        <tr><th>New password (again):</th><td><input name="newPassword2" size="20" type="password" /></td></tr>
        <tr><td colspan="2" style="text-align: center;" >
          <input name="submitted" type="submit" value="Change Password"/>
          <button onclick="$('frm').action='changepassword.php';$('frm').submit();">Cancel</button>
        </td></tr>
      </table>
    </form>
    <div class="msg"><?php
      if (isset($_POST["submitted"])) {
        changePassword($_POST['username'],$_POST['oldPassword'],$_POST['newPassword1'],$_POST['newPassword2']);
        foreach ( $message as $one ) { echo "<p>$one</p>"; }
      } ?>
    </div>
  </div>
</body>
</html>

Reference :
https://gist.github.com/657334/98d7c111796db51059a5fd788240fd69672b8daf
http://ideone.com/Ib90W
http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
https://gist.github.com/mattrude/657334

How to Install and Configure Subversion 1.8 on CentOS 6.5

Subversion is a open source version control system that will manages files and will keep the changes made to the files. With Subversion, it can help you to recovers the older files and directories and also to examine the history of your files and directories how they are changed all over time. This post will discuss how you can install and configure Subversion 1.8 on CentOS 6.5

1. Prepare WANdisco repo :

[root@centos6-05 ~]# wget opensource.wandisco.com/RPM-GPG-KEY-WANdisco -O /tmp/RPM-GPG-KEY-WANdisco
[root@centos6-05 ~]# wget opensource.wandisco.com/RPM-GPG-KEY-WANdisco -O /tmp/RPM-GPG-KEY-WANdisco
--2014-03-11 23:29:59--  http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
Resolving opensource.wandisco.com... 54.248.108.17
Connecting to opensource.wandisco.com|54.248.108.17|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1759 (1.7K) [application/octet-stream]
Saving to: â/tmp/RPM-GPG-KEY-WANdiscoâ

100%[==========================================================>] 1,759       --.-K/s   in 0.003s

2014-03-11 23:30:00 (665 KB/s) - â/tmp/RPM-GPG-KEY-WANdiscoâ

2. Import RPM-GPG-KEY-WANdisco. Once imported, it safe to delete :

[root@centos6-05 ~]# rpm --import /tmp/RPM-GPG-KEY-WANdisco
[root@centos6-05 ~]# rm -rf /tmp/RPM-GPG-KEY-WANdisco

You can get more subversion file from the followings :
http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/x86_64/

3. Configure WANdisco repo file :

[root@centos6-05 ~]# vi /etc/yum.repos.d/WANdisco-1.8.repo
[WANdisco]
name=WANdisco SVN Repo 1.8
enabled=1
baseurl=http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/
gpgcheck=1

4. Install subversion using yum install :

[root@centos6-05 ~]# yum install subversion mod_dav_svn -y

Full installation screen :

[root@centos6-05 ~]# yum install subversion mod_dav_svn -y
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/metalink                                                                | 5.2 kB     00:00
 * Webmin: download.webmin.com
 * base: centos.ipserverone.com
 * epel: epel.mirror.net.in
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
WANdisco                                                                     |  951 B     00:00
WANdisco/primary                                                             |  65 kB     00:00
WANdisco                                                                                    309/309
Webmin                                                                       |  951 B     00:00
Webmin/primary                                                               |  21 kB     00:00
Webmin                                                                                      168/168
base                                                                         | 3.7 kB     00:00
base/primary_db                                                              | 4.4 MB     00:45
epel                                                                         | 4.2 kB     00:00
epel/primary_db                                                              | 6.0 MB     01:51
extras                                                                       | 3.4 kB     00:00
extras/primary_db                                                            |  19 kB     00:00
updates                                                                      | 3.4 kB     00:00
updates/primary_db                                                           | 2.1 MB     00:18
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mod_dav_svn.x86_64 0:1.8.8-1 will be installed
---> Package subversion.x86_64 0:1.8.8-1 will be installed
--> Processing Dependency: libserf-1.so.1()(64bit) for package: subversion-1.8.8-1.x86_64
--> Running transaction check
---> Package serf.x86_64 0:1.3.2-2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch                 Version                Repository              Size
====================================================================================================
Installing:
 mod_dav_svn               x86_64               1.8.8-1                WANdisco                77 k
 subversion                x86_64               1.8.8-1                WANdisco               2.2 M
Installing for dependencies:
 serf                      x86_64               1.3.2-2                WANdisco                43 k

Transaction Summary
====================================================================================================
Install       3 Package(s)

Total download size: 2.3 M
Installed size: 7.8 M
Downloading Packages:
(1/3): mod_dav_svn-1.8.8-1.x86_64.rpm                                        |  77 kB     00:00
(2/3): serf-1.3.2-2.x86_64.rpm                                               |  43 kB     00:00
(3/3): subversion-1.8.8-1.x86_64.rpm                                         | 2.2 MB     00:19
----------------------------------------------------------------------------------------------------
Total                                                               112 kB/s | 2.3 MB     00:20
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : serf-1.3.2-2.x86_64                                                              1/3
  Installing : subversion-1.8.8-1.x86_64                                                        2/3
  Installing : mod_dav_svn-1.8.8-1.x86_64                                                       3/3
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]
  Verifying  : mod_dav_svn-1.8.8-1.x86_64                                                       1/3
  Verifying  : subversion-1.8.8-1.x86_64                                                        2/3
  Verifying  : serf-1.3.2-2.x86_64                                                              3/3

Installed:
  mod_dav_svn.x86_64 0:1.8.8-1                      subversion.x86_64 0:1.8.8-1

Dependency Installed:
  serf.x86_64 0:1.3.2-2

Complete!

5. Setting up SVN directories :

[root@centos6-05 ~]# mkdir /svn
[root@centos6-05 ~]# mkdir /svn/repos
[root@centos6-05 ~]# mkdir /svn/users
[root@centos6-05 ~]# mkdir /svn/permissions
[root@centos6-05 ~]# chown -R apache:apache /svn

6. Configure httpd Apache server as below :

[root@centos6-05 ~]# vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
    ServerAdmin webmaster@svn.ehowstuff.local
    DocumentRoot /svn/repos
    ServerName svn.ehowstuff.local
    ErrorLog logs/svn.ehowstuff.local-error_log
    CustomLog logs/svn.ehowstuff.local-access_log common
</VirtualHost>

7. Do a backup of origial subversion file :

[root@centos6-05 ~]# mv /etc/httpd/conf.d/subversion.conf /etc/httpd/conf.d/subversion.conf.bak

8. Create and Configure subversion.conf :

[root@centos6-05 ~]# vi /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn/repos>
        DAV svn
        SVNParentPath /svn/repos
        AuthType Basic
        AuthName "Authorization Realm"
        AuthUserFile /svn/users/passwords
        AuthzSVNAccessFile /svn/permissions/svnaccess
        Require valid-user
</Location>

9. Create first repository using svnadmin command :

[root@centos6-05 ~]# svnadmin create /svn/repos/testrepo
[root@centos6-05 ~]# chown -R apache:apache /svn/repos/testrepo

10. Create htpasswd user to access the testrepo repository :

[root@centos6-05 ~]# htpasswd -c /svn/users/passwords svnuser1
New password:
Re-type new password:
Adding password for user svnuser1

11. Create svnaccess file to access the testrepo repository :

[root@centos6-05 ~]# vi /svn/permissions/svnaccess

Add the following :

[testrepo:/]
svnuser1 = rw

12. Restart httpd :

[root@centos6-05 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

13. Test your subversion server from browser :

http://svn.ehowstuff.local/svn/repos/testrepo/