LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-14-2006, 07:37 PM   #1
dylans
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Rep: Reputation: 0
Server Setup/Replication


Hello !

Is there a way to replicate certain aspects of a server configuration in an automated fashion ? For example:

Let's say I have a server designated as a WWW machine, and after a fresh OS install, I want the following things configured on it:
- Postfix
- QPopper
- Apache

Now, let's say I have a server designated as a DB machine, and after a fresh OS install, I just want the following configured on it:
- Postgres


So, as I add WWW machines, I could install the OS on the machine, then run some "magically little script", and have all the configuration on that box done... ie: all the programs I want installed on the box, all the Users setup... etc

Right now, I have a huuuuuuuuuge checklist of things I did when I installed all the software on my box and setup the proper users, but would "love" to automate this process somehow.

I'm assuming this is a job for a shell script ? Orrrrr.... ?
Thanks for helpin' a newb out
 
Old 02-14-2006, 10:10 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
Which distro?
 
Old 02-15-2006, 12:09 AM   #3
dylans
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Howabout... Debian ?
Oh... and throw in a little OpenBSD for spice
 
Old 02-15-2006, 01:06 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
If for a given case the src & tgt systems are the same, inc HDD type, then dd may be what you are looking for.
RH offers a network install from a src system, others (inc) BSD may do the same.
Also, take a look at this: http://www.linuxplanet.com/linuxplanet/tutorials/986/1/
 
Old 02-16-2006, 03:51 AM   #5
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Rep: Reputation: 31
Hi dylans,

What I have understand from your first post.. that you want to automate the application installation (Postfix,Apache and QPopper) and their configuration.

If so, then you will need to write a Shell script and need that to put on CD along with above packages and their config files (which you want to be set on new systems default).

After installing OS, you can execute your shell script which will install packages and copy configurations to their paths on new system.

Try this!

Thanks, Kirtimaan
 
Old 02-16-2006, 05:05 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
kirtimaan_bkn offers a possible solution. "dd" (or rsync) is more for mirroring entire systems, which may not be what you want.

Creating a script to add users automatically isn't to difficult.
Just write a few "useradd" commands and check their return code to see if they were successful or not.

Similarly, to configure Postfix, you simply need to have the Postfix configuration files and package and then follow the following sequence in the script:
-install package (on RH, this would be something like "rpm -i postfix-...". I don't know much about Debian, so I can't help you with that.
-maybe you'll need to get some updates for the postfix package
-then simply "cp" the config files to their right location (as root)
-(re)start the postfix daemon via:
/sbin/service postfix start (or restart)

For Apache, you'll need to copy all the websites (dd may help you with that) and the Apache config files (certainly httpd.conf).
Installing Apache can be a little trickier (you'll need to have all the modules and stuff).
But, if you have, as you said, done this all before, then you should be able to retrace your steps.

Another useful trick maybe this:
-enlarge your command history (set $HISTSIZE to a large value)
-then do the install once, manually executing all the commands
-then type "history > my_install_script" and you can edit that file. It'll contain all the commands you've entered. Then all you need to do is verify those commands and maybe build in some checks to see if they worked or not and report that back to you (ie via e-mail).
Any editing of files will need to be replaced by copying of the files (with the correct settings, so after the editing) to the right path.
 
Old 02-16-2006, 10:35 PM   #7
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Rep: Reputation: 31
timmeke,

Thanks for sharing $HISTSIZE trick. I didn't think of that I can make script by this way.

Thanks, Kirtimaan.
 
Old 02-16-2006, 11:12 PM   #8
dylans
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Awesome. You guys nailed the question on the head
Thank you very much !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RedHat 9 Server Replication dgcooper62 Linux - Networking 1 12-14-2004 12:31 AM
Setup a linux server, DNS, WEB, FTP, and Mail Server Help watermelon_lee Linux - Networking 1 08-26-2003 03:09 AM
Replication of LDap server rockage2001 Linux - Software 0 07-09-2003 11:35 AM
Setup linux-apache server to access documents on NT server josephswagner Linux - Software 11 04-11-2003 08:35 AM
Need replication server howto x2000koh Linux - General 1 10-08-2002 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration