Friday, September 18, 2009

configure Windows Server 2003 DNS server

How do I install and configure Windows Server 2003 DNS server?

The Domain Name System (DNS) is the Active Directory locator in Windows 2000 and Windows Server 2003. Active Directory clients and client tools use DNS to locate domain controllers for administration and logon. You must have a DNS server installed and configured for Active Directory and the associated client software to function correctly. This article guides you through the required DNS configuration.

Install Microsoft DNS Server

  1. Click Start, point to Settings, and then click Control Panel.
  2. Double-click Add/Remove Programs.
  3. Click Add and Remove Windows Components.
  4. The Windows Components Wizard starts. Click Next.
  5. Click Networking Services, and then click Details.
  6. Click to select the Domain Name System (DNS) check box, and then click OK.
  7. Click OK to start server Setup. The DNS server and tool files are copied to your computer.
  8. Continue to the next step to configure the DNS server.

Configure the DNS Server Using DNS Manager

These steps guide you through configuring DNS by using the DNS Manager snap-in in Microsoft Management Console (MMC).

  1. Click Start, point to Programs, point to Administrative Tools, and then click DNS Manager. You see two zones under your computer name: Forward Lookup Zone and Reverse Lookup Zone.
  2. The DNS Server Configuration Wizard starts. Click Next.
  3. If the Wizard does not auto-start, right-click your server name object in the DNS Manager console and choose Configure your Server.

  1. Choose to add a forward lookup zone. Click Next. The new forward lookup zone must be a primary zone so that it can accept dynamic updates. Click Primary, and then click Next.

  1. The zone name must be exactly the same as your Active Directory Domain name, or, if on a stand-alone or workgroup environment - the same as the suffix for all of the network computers that are to register with this DNS server. Type the name of the zone, and then click Next.

  1. Accept the default name for the new zone file. Click Next.

  1. Choose to add a reverse lookup zone now. Click Next.

  1. Click Primary, and then click Next.
  2. Type the name of the zone, and then click Next. The zone name should match the Network ID of your local subnet. For example, if your subnet range is from 192.168.0.1 to 192.168.0.254, type 192.168.0 in the name value.

  1. Accept the default name for the new zone file. Click Next.

  1. Click Finish to complete the Server Configuration Wizard.

After the Server Configuration Wizard is finished, DNS Manager starts. Proceed to the next step to enable dynamic update on the zone you just added.

Enable Dynamic Update on the Forward and Reverse Lookup Zones (Optional - Recommended)

  1. In DNS Manager, expand the DNS Server object.
  2. Expand the Forward Lookup Zones folder.
  3. Right-click the zone you created, and then click Properties.
  4. On the General tab, click to select the Allow Dynamic Update check box, and then click OK to accept the change.

  1. Do the same for the Reverse Lookup Zone.

Enable DNS Forwarding for Internet connections

  1. Click Start, point to Programs, point to Administrative Tools, and then click DNS to start the DNS Management Console.
  2. Right click the DNS Server object for your server in the left pane of the console, and click Properties.

  1. Click the Forwarders tab.
  2. Check the Enable forwarders check-box.
  3. In the IP address box enter the IP address of the DNS servers you want to forward queries to - typically the DNS server of your ISP. You can also move them up or down. The one that is highest in the list gets the first try, and if it does not respond within a given time limit - the query will be forwarded to the next server in the list.

  1. Click OK.

For change .php to .html

for file in *.php ; do mv $file `echo $file | sed 's/\(.*\.\)php/\1html/'` ; done

for change .html to .php

for file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1php/'` ; done



mtop -dbuser root -h localhost mysql connection


/usr/sbin/iptstat hits of user
make test.php in server DocumentRoot

vi testmysql.php

$db = "";
$host = "localhost";
$user = "root";
$password = "";

$connection = mysql_connect($host, $user, $password) or die ("Could not connect to database");
echo "success";
?>

http://serverip/testmysql.php
For master

[mysqld]
#set-variable = max_connections=500
safe-show-database

skip-locking
key_buffer = 100M
max_allowed_packet = 64M
log-error=/var/log/mysql/mysql-error.log
long_query_time = 3
log-slow-queries=/var/log/mysql/mysql-slow.log
table_cache = 512
sort_buffer_size = 10240K
read_buffer_size = 10240K
read_rnd_buffer_size = 10240K
net_buffer_length = 10240k
myisam_sort_buffer_size = 100M
max_connections=2048
set-variable = max_user_connections=2048
set-variable = max_connect_errors=999999
set-variable = query_cache_size=512M
query_cache_limit = 512M
set-variable = join_buffer=512M
thread_cache_size = 1024

log-bin=/var/lib/mysql/binlog
#binlog-do-db=systemWcell
#binlog-ignore-db=mysql
#binlog-ignore-db=test

server-id=4

create mysql user for replication
GRANT ALL PRIVILEGES ON *.* TO repl@replication server ip ;
SET PASSWORD FOR repl@replication server ip =PASSWORD('QHeqJ3TH');
FLUSH PRIVILEGES;

mysql> show master status\G
*************************** 1. row ***************************
File: binlog.000013
Position: 453
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)

For slave
[mysqld]
set-variable = max_connections=500
safe-show-database

skip-locking
key_buffer = 100M
max_allowed_packet = 64M
log-error=/var/log/mysql/mysql-error.log
long_query_time = 3
log-slow-queries=/var/log/mysql/mysql-slow.log
table_cache = 512
sort_buffer_size = 10240K
read_buffer_size = 10240K
read_rnd_buffer_size = 10240K
net_buffer_length = 10240k
myisam_sort_buffer_size = 100M
max_connections=2048
set-variable = max_user_connections=2048
set-variable = max_connect_errors=999999
set-variable = query_cache_size=512M
query_cache_limit = 512M
set-variable = join_buffer=512M
thread_cache_size = 1024

server-id=7

#binlog-do-db=systemWcell
replicate-do-db=systemWcell ---------------------------- DB Name
slave_skip_errors=all
#relay-log=/var/lib/mysql/relaylog


" CHANGE MASTER TO
" MASTER_HOST='Master IP,
" MASTER_USER='repl',
" MASTER_PASSWORD='QHeqJ3TH',
" MASTER_PORT=3306,
" MASTER_LOG_FILE='bin-log.000013',------------------------------ bin log possition
" MASTER_LOG_POS= 453;



+---------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---------------+----------+--------------+------------------+
| binlog.000002 | 2397878 | | |
+---------------+----------+--------------+------------------+
1 row in set (0.00 sec)

Mysql > Start slave;
Mysql> show slave status;

svn configration for Linux

mkdir dir
mkdir svnrepos For multipule svn
svnserve -i &
svnserver -r -d /reponame path &
cd svnrepos
mkdir project namedirectory
cd project namedirectory
create fsfs file type
svnadmin create --fs-type fsfs ./
ls -la
cd conf
vi svnserve.conf
edit at last project name (real name= Project name )
real name=project name
vi passwd
edit user name & password
username=userpassword
For import working folder data
svn import -m"Intial Import" path of code svn://IP Address/svn repo name
take working folder backup
mv /var/www/html/project namedirectory /var/www/html/project namedirectory.bak
create new working folder
mkdir project namedirectory
cd project namedirectory
for user import data
svn co svn://IP Address/svn repo name
cd repo and edit svnserv.conf and make anon-access = none

svn update
svn commit
svn cleanup
svnadmin hotcopy path/to/repository path/to/backup --clean-logs
Svnadmin dump reponame > reponame.dump For backup
Svnadmin load newrepo < oldreponame.dump For restore dump file
http://www.linuxfromscratch.org/blfs/edguide/chapter03.html
http://svnbook.red-bean.com/en/1.1/ch09.html
http://www.yolinux.com/TUTORIALS/Subversion.html
http://subversion.tigris.org/

svn configration for windows

Installing Subversion

- Double-click on the installer and run through it. Shouldn't take too long. Once installed, add an environment variable for SVN_EDITOR. You can do this by right-click on my Computer > Properties. Go to advanced. Hit the Environmental Variables button. Just add another in there called SVN_EDITOR with a value of C:\windows\notepad.exe


Creating a Repository

- Now you need to create a repository. Go to the command prompt (Start > run > cmd). type "svnadmin create D:\Programming\MySVNRepos". (Change the path to whatever path you want to use.) The repos is basically a special directory that will hold your files as well as various subversion config options.

Modifying Security and Authentication Settings

- Next up, you need to modify the permissions and u

sers. Navigate to the folder you just created. In my example, I used D:\Programming\MySVNRepos". In this directory, you will find a few folders. One folder will be called conf. Navigate to it and double-click on the svnserv.conf file. Opening it with notepad will be fine.


- The svnserv.conf file in a configuration file for the svnserv executible. For our purposes, just uncomment out the following lines:


[general]

anon-access = read

auth-access = write

password-db = passwd


- Save your changes. And double-click on the passwd file in the same directory. The file stores all usernames and passwords in the format:


$username = $password


- Make sure the [Users] line is uncommented and you can just add a new line for your username and password. For example, if you wanted your username to be josh and your password to be testing, just create a line like this:


josh = testing


- Save it and you're done configuring.

Serving Your Repos for the First Time

Now, you can test it out. Go to the command prompt again and type:

svnserve --daemon --root "D:\Programming\MySVNRepos"

Change the path to your specified path. Once this is done, the daemon should be listening and waiting for requests.


Creating your First Project folder

Click on startà runà and type following url

svn://localhost it will opne the following window.

Then right click on svn://localhost add a new folder as shown below .

Subversion will ask for your username and password.

However, keep in mind, it may also ask for your computer's Admin password. If it does, you can simply type in your computer's admin password. Once you hit return, you can then go ahead and type in your subversion username and then your subversion password. Your subversion username and password is exactly what you typed in the passwd file. (i.e. user: josh pass:testing)

Then create a project folder (I created test folder) on C, D or any drive. Right click on that project folder and do the svn checkout as per following.

Give the svn repository path as per the following..

After finishing the checkout click on ok.

Then copy the folder actual project folder into new project folder in my case it is test folder and I copied modernfamily actual project folder under test test folder.

After finishing the coping right click on modernfamily (your might be dfferent project folder) folder and add the files as show below.

After clicking on add tag it will appear the following window just click on ok tab as shown below.

Wait till adding thefiles and click on OK tab as per below…

After finishing the file adding then come to the root folder that is test folder right click on it and do the coming as shown below…


It will appear following window jist click on OK tab.


After finishing the commit again click on Ok tab that window is not shown here.


Running svnserv as a Windows Service

If you're running XP (Win2k, Win2k3, or Vista), you can tell the process to run as a service. Stop your existing svnserv daemon by closing out of the existing command prompt window. Now, go to the command prompt (again). Type:

sc create svnrepos binpath= "\"C:\program files\subversion\bin\svnserve.exe\" --service --root \"D:\Programming\MySVNRepos" displayname= "Subversion Repository" depend= Tcpip start= auto

(Note: add your repo path in command)


After adding service go to the services an check Subversion repository service is added. If it is added then start the service.


SVN Checkout on client system.

Make new folder and give your project folder name. Right click on same folder and click on svn checkout and give your repository path.


svnadmin hotcopy path/to/repository path/to/backup --clean-logs


Svnadmin dump reponame > reponame.dump For backup


Svnadmin load newrepo < style=""> For restore dump file


http://www.linuxfromscratch.org/blfs/edguide/chapter03.html


http://svnbook.red-bean.com/en/1.1/ch09.html


http://www.yolinux.com/TUTORIALS/Subversion.html


http://subversion.tigris.org/


Thursday, March 5, 2009

How to mention date and time in shellscripts

How to mention date and time in shellscripts
Example
cp as.txt as`date +%d%m%Y:%R`.txt its show output file name(as curent date time in 24 hr).