Create Your Own Server

Embed Size (px)

Citation preview

  • 8/8/2019 Create Your Own Server

    1/17

  • 8/8/2019 Create Your Own Server

    2/17

    23

    or you can manually chose whatkeyboard you have.

    The installer checks theinstallation CD, your hardware,and configures the network withDHCP if it is connected to thenetwork, or you can configure thismanually.

    Now enter the 'hostname'. Mysystem is called'server.domain.local', so I enter'server'.

    Now you will need to partitionyour disk, let the setup create thepartitions (swap and root)automatically unless you areconfident on doing this manually.

    When you are ready, hit 'Yes' to'Write the changes to disks?' Nowyour partitions will be created and

    formatted.

    Setup the system clock. NormallyUTC is a safe choice.

    Next create a new user, I use thename 'Administrator' with the username 'administrator'. Don't use theuser name 'admin' as that is asystem name in Ubuntu.

    The base system will now beinstalled.

    Now we get the option of whatextra software gets installed, we aregoing to choose DNS, mail, LAMP,

    OpenSSH, print and SAMBAservers. Select the differentservers using the space key thencontinue.

    The GRUB boot loader will nowbe installed.

    The installation is nowfinished. Remove your CD fromthe drive and hit 'Continue' toreboot the system.

    That is the first part of theUbuntu server installed. Nextissue, we will cover updates,installing the Xubuntu desktopand also the webmin install.

  • 8/8/2019 Create Your Own Server

    3/17

    13

    Now the Ubuntu server installation is complete we will install Xfce desktop, Webmin and also software updates from the command

    line as well as with the update manager which will be built into the Xubuntu desktop.

    HHOOWW--TTOOWritten by Daniel Lamb

    After rebooting the PC afterthe install, login using yourchosen user name and

    password.

    The first item to be addressed is

    configuring of the sources. We willremove the CD repository (whichautomatically gets added to thesources) and add web basedsources.

    To do this we will use nano, mypersonal favorite, if you have apreferred text editor please usethat. Type into the command line:

    sudo nano

    /etc/apt/sources.list

    You will need to supply thepassword you set as your userpassword as you are running a

    command as root. Add a hash (#) infront of the CD entry and remove thehashes from the front of the otherentries. After completing this steppress CTRL+X then press 'Y' or type'yes' to save changes.

    After completing this, type:

    sudo apt-get update

    This will update the apt sourcesand apt will then know what softwareit can get. Now type:

    sudo apt-get upgrade

    To install the latest updates to yoursystem. This may take a little whiledepending on how many updates areneeded for your system, you mightwant to put the kettle on now.

    After the updates are finished,restart your machine. Log in andrun the same command just incase there are any other updatesthat were missed, although aptis unlikely to miss any. After this

    is finished, we issue what will beour last command for this thisissue:

    sudo apt-get install

    xubuntu-desktop

    Answer 'yes' to: 'Do you wantto continue'. Go and read the

    CCRREEAATTEEYYOOUURROOWWNNSSEERRVVEERR--PPaarrtt22

  • 8/8/2019 Create Your Own Server

    4/17

    14

    rest of this issue, and have a nicecup of tea.

    After this has completed, rebootyour machine. Once the machinehas started up you will bepresented with the login

    screen.

    Log in using your previouslychosen user name and passwordand you will be presented with theXubuntu desktop, you now needto run the updates by rightclicking on the orange icon in thetop right hand corner and click

    'Install all updates', then supplyyour password to allow theupdates to run. Alternatively, youcan press Ctrl+Alt+F2 and loginusing your user name andpassword again and run theupdates from the command line.

    After this is finished restart yourmachine. Once logged in, open

    Firefox and browse tohttp://www.webmin.com/ (aboveright) and in the menu on the left,click 'Debian Package'.

    When the .deb file has finisheddownloading, right click on it and

    choose to open with andclick OK. The 'Package Installer' willthen open and you can simply click'Install Package'. The package

    manager will also install all theneeded dependencies for Webmin.

    Once Webmin has installed, go to:https://localhost:10000 and log inusing your user name and password.

    ,

    Full Circle islooking forproof-readers.

    Can you spare afew days each month to

    proof-read articles for us?If you can, please email:[email protected]

    for more details.

    or join our IRC channel:

    log on to irc.freenode.net andjoin #fullcirclemagazineOr, you can visit via ourwebIRC client atirc.fullcirclemagazine.org

    We also have a forum at:http://ubuntuforums.org/forumdisplay.php?f=270

    www.fullcirclemagazine.org

    mailto:[email protected]://www.fullcirclemagazine.org/http://ubuntuforums.org/forumdisplay.php?f=270http://irc.fullcirclemagazine.org/http://www.webmin.com/
  • 8/8/2019 Create Your Own Server

    5/17

    18

    HHOOWW--TTOOWritten by Daniel Lamb

    CCRREEAATTEEYYOOUURROOWWNNSSEERRVVEERR--PPaarrtt33

    We now have a working

    server with the basesystem, Samba, SSH,Xubuntu desktop and Webmin allinstalled; we will now installDHCP, and configure DHCP andSamba.

    We'll start off with DHCP.

    Log into Webmin by going to

    https://localhost:10000

    Go to Servers, then DHCP.Click on "Add a new subnet", andfill in the description of thesubnet. For network address, usethe same IP as the internaladdress, but use 0 as the endingoctet; for example, if your internalNIC is 192.168.1.1, then use

    192.168.1.0 for your networkaddress. For address ranges, usethe range of addresses to beassigned by DHCP. For netmask,use the same as your subnet;most are 255.255.255.0. Click"Create".

    Once created, click the new iconthat was just created (with thenetwork address you choose underit). Scroll down to the bottom, andclick "Edit Client Options". Fill in theSubnet mask with the subnet; the

    Default routers and DNS servers withyour internal IP; and the Broadcastaddress with the internal IP - but with255 at the end. Click "Save" thenstart the server.

    Now to configure Samba fileshares.

    First of all, create a folder onyour server. I would normallycreate one within a standarduser's home folder, so thedirectory listing would be/Home//share-name. Let's start

    by calling one Shared; browseto the main Home folder, andthen down to the folder namedwith your existing username;right click, and choose CreateFolder. Name the new folder

    Shared, and ensure that the

  • 8/8/2019 Create Your Own Server

    6/17

  • 8/8/2019 Create Your Own Server

    7/17

    11

    HHOOWW--TTOOWritten by Daniel Lamb

    CCRREEAATTEEYYOOUURROOWWNNSSEERRVVEERR--PPaarrtt44

    Now that we have Samba,

    DHCP and Webmininstalled and working, we

    will set up a VPN server tomonitor the various runningservices.

    Our first step is setting up aVPN (Virtual Private Network)using (Point-to-PointTunnelling Protocol) provided by

    the poptop team. This can also beconfigured by . To startoff, we will need to install thePPTP server, as follows:

    sudo apt-get install pptpd

    (or use your package managerand search for poptop or pptp)

    When prompted, hit enter, andapt-get will install and allits dependencies.

    Now, activate Webmin by goingto:

    https://localhost:10000

    Browse to , then

    . First we will create ourPPP (Point-to-Point Protocol)accounts, so click on

    ; add a new user called ,with a password of ; thenclick and click .Within the index of that module, clickon ; fill in thebox

    with the client end IPaddress; and fill in

    with the IPaddresses to be assigned to theclient machine coming in via theVPN. Click . Then, open

    ; changeto ; change

    to ;change

    to ;disable and ; andthe rest can stay on default. Click

    , and click .

    We will now set up monitoring forthe system. Within , go to

    , and

    . Click on; select for

    ;change to thefrequency for checking theserver - every 5 minutes is agood time frame, just in casethere are any problems or anyservice faults. Set to0 so that it runs exactly every 5minutes. Make sure all the hoursand days are selected - to selectmore than one, use the 'Ctrl' keywhile you select them.

    Change to

    or -whichever you feel is more

    appropriate to your system.Change to, and fill in

    your email address. Click .You can also change

    to an SMTP server whichdoesn't require authentication,

  • 8/8/2019 Create Your Own Server

    8/17

  • 8/8/2019 Create Your Own Server

    9/1714

    HHOOWW--TTOOWritten by Daniel Lamb

    CCRREEAATTEE YYOOUURR OOWWNNSSEERRVVEERR -- PPaarrtt 55

    Now, before we do much

    more with the server, weare going to configure

    backups -- so all files and data areprotected. We will use thewebmin module to configure tarbackups; you can use tar backupsto save to tape, or to any otherform of removable media. Underthe System menu in webmin, youshould have Filesystem, Backup --or, with the new webmin 1.410,you might need to look underUnused Modules to find it. To adda new backup, fill in the box witha directory, or, to browse yourdrive, click on the '...' button(shown below).

    Tick the tar format if you wishthe backup to be in thatcompressed format, otherwise itwill just be a direct dump withoutcompression. After filling in thedirectory box, click on 'Add a new

    backup of directory'; you will now be

    greeted with the page shown belowright.

    In the 'Directories to backup', youcan fill in multiple directories, witheach directory having its own line. Inthe 'Backup to' box, choose themount point, and the name of thebackup to create; ie, if it is a tapedrive, it might be:

    /dev/st0/.tar.gz

    (only if using tar andcompression -- which isan option further downthe page).

    You could alsochoose to backup to aremote location usingRSH, SSH or FTP. Inthat case, choose(rather than file or tapedevice), and fill in yourFTP/RSH/SSH details.

    Now choose a suitable name

    for your backup, and fill it in as'Backup Label'. If you wish toomit any files or directories(within your selected backupdirectories) supply them. Chooseyour compression options fromCompress Archive -- 'Yes withgzip' is recommended. In theboxes 'Command to run before

  • 8/8/2019 Create Your Own Server

    10/1715

    backup' and 'Command to runafter backup', add any requiredcommands.

    You should now set up a backupschedule (shown below). To do so,select 'Enabled, at times chosenbelow'. To have yourself (orsomeone else) informed whenbackup is running, insert a validemail address into 'Emailscheduled output to'. A simpleapproach is to select 'Simpleschedule', choose 'Daily, atmidnight', and click 'Create'.

    We now have an automaticallyscheduled daily backup to saveyour most important data andfiles.

    We will now install Postfix (emailserver) and Dovecot (IMAP and POP3server). We must drop to thecommand line, and type:

    sudo apt-get install postfix

    dovecot-common dovecot-imapd

    Answer the questions as follows:

    Internet Site

    NONE

    server1.example.com

    server1.example.com,

    example.com,localhost.example.com,

    localhost

    No

    127.0.0.0/8

    Yes

    0

    +

    all

    You now have Postfixand Dovecot installed --

    with IMAP.

    I would suggest you now setup an MX record pointing to yourIP address, and change yourrouter to forward SMTP (port 25)traffic, through your router, toyour server IP address. This willallow us to use postfix to collectand deliver email directly viaSMTP.

    owns and runsand is based in

    Perth, Scotland. He is alsoinvolved in a number of opensource projects such as

    ,and .

    He is also a committed LeedsUnited fan.

  • 8/8/2019 Create Your Own Server

    11/1712

    HHOOWW--TTOOWritten by Daniel Lamb

    CCRREEAATTEE YYOOUURR OOWWNNSSEERRVVEERR -- PPaarrtt 66

    Now we can start setting up

    email on our server. Isuggest using IMAP and

    SMTP for sending and receivingemail. You should have installedPostfix and Dovecot. You still needto install fetchmail - which willcollect any email not received bySMTP. To collect emails by SMTP,you need to set up an MX record(read more about this herehttp://www.petri.co.il/configure_mx_records_for_incoming_smtp_email_traffic.htm) with the provider ofyour domain name - it forwardsemails to your home IP address.You need to forward SMTP throughthe firewall on your router to theIP address of your server - to dothis, refer to your user manual for

    your router/firewall.

    The only changes you will needto make in the Postfixconfiguration is under LocalDelivery: change "Home-relativepathname of user mailbox file" toMaildir, and under "SMTP

    Authentication And Encryption", puta tick in the box to "Allowconnections from same network",and "Allow connections from thissystem" under the heading "SMTPrelaying restrictions". In the DovecotIMAP/POP3 server menu, click onMail Files, and change the radio

    button option under Mail file locationto Inbox in ~/Maildir, folders in~/mail.

    If you have any other email thatneeds to be picked up via POP3, youshould now install fetchmail bytyping:

    sudo apt-get install

    fetchmail

    Now, open up "Fetchmail Mailretrieval" (Fig.1 above) inWebmin, and click on "..." and"Add Fetchmail server for user".

    Fill in the box for "Servername", add a username andpassword (which will be suppliedby your ISP or your web siteprovider), and choose whichlocal users you want the email tobe distributed to.

  • 8/8/2019 Create Your Own Server

    12/1713

    Add any users who arepermitted to access the system -these are users who can accessemail, samba shares and so on.

    You can now install(right), which will allow you to

    view webmail and also connect toshared calendars and sharedcontacts. To install ,open a console and type:

    sudo apt-get install

    egroupwareWe will deal with configuring

    for next month.

    One item which should havebeen configured previously isDNS - to set this up, click on BindDNS in Webmin. Click on "Createmaster zone". Enter the domaininto the "Domain name /network" box. For the masterserver, type in the domain nameas well. Enter a suitable emailaddress in the appropriate box.Type in the IP address of theserver (the external IP addressprovided by your ISP) and finally,click "Create".

    owns and runsand is based in

    Perth, Scotland. He is alsoinvolved in a number of opensource projects such as

    ,and .

    He is also a committed LeedsUnited fan.

    mailto:[email protected]
  • 8/8/2019 Create Your Own Server

    13/17

    13

    HHOOWW--TTOOWritten by Daniel Lamb

    CCRREEAATTEE YYOOUURR OOWWNNSSEERRVVEERR -- PPaarrtt 77

    We are now going to install

    eGroupware onto yourserver. This will give us a

    groupware server which canfunction like Exchange byconnecting an email client suchas Thunderbird to it via IMAP, andconnecting Sunbird to thecalendaring service via icalsrv.First of all, we will need to copyicalsrv into the eGroupwareinstallation folder. To do this, usethese commands:

    wgethttp://downloads.sourceforge.net/egroupware/eGroupWare-1.4.004.zip?modtime=1208301229&big_mirror=1

    unzip eGroupWare-1.4.004.zip

    and now cp eGroupWare-1.4.004/icalsrv/usr/share/egroupware -r

    Now we can access theinstaller. In this example, we'llpoint to:http://yourserver/egroupware/setup/ .

    The script will run through some pre-

    installation tests. Some of the itemswill pass and some will havewarnings.

    Click the 'continue to the HeaderAdmin' link at the bottom tocontinue. You should now be on thesetup page. The 'Server Root' and'Include Root' should be correct. Youcan leave the admin user set to

    'admin' and create a password. Thiswill be the account you use to loginto the header manager. Change'Persistent Connections' to 'False'.Scroll down to the databaseinformation section, and enter theinformation for the database youcreated in step #1. In this example,we'll use the following information:

    - Stays the same.

    - Stays the same.

    This should be setup via mysql

    server settings within webmin.

    Choose a username andpassword for the 'ConfigurationUser'. This is the account you'lluse to manage theconfiguration. For this example,we'll use the same usernameand password as the headermanager.

    Click the 'Write config' buttonto create the header file. Youshould get a screen saying thatyour header file was created.

    You should now be on theeGroupware login page for thecontrol panel. Enter the admininformation into the

    Setup/Config fields to login tothe setup control panel.

    Click the 'Login' button tocontinue. You should now be onthe setup screen for youreGroupware. It will tell you thatthe database is working but you

  • 8/8/2019 Create Your Own Server

    14/17

    14

    don't have any tables installed.

    Click the 'Install' button tocreate the core tables. The scriptwill create the core tables. If youdon't receive any error messages,

    then it was successful.

    Click the 'Re-check MyInstallation' button to continue.The setup page will refresh andyou'll see that all of the stageshave been complete.

    Click on the 'Click here to setup1 admin account and 3 demo

    accounts' link to continue. Enterthe information you would like tohave for your admin account.Check the 'Create demo accounts'checkbox to create the demoaccounts.

    Click the 'Save' button to savethese settings. You should now beback at the eGroupware setup page.Click the 'Back to user login' link atthe top left of the screen. If you getan error message saying that thelock function failed, create a supportticket on the help page with thename of your database, and lockaccess will be granted to yourdatabase. Refresh the page once lockaccess has been granted. You shouldnow be at the login page. Enter theinformation you created for youradmin account.

    Click the 'Login' button to login toyour eGroupware. You should now beat the admin control panel for youreGroupware management system.eGroupware is now installed.

    [email protected]

    owns and runsand is based in

    Perth, Scotland. He is alsoinvolved in a number of opensource projects such as

    ,and .

    He is also a committed LeedsUnited fan.

    mailto:[email protected]
  • 8/8/2019 Create Your Own Server

    15/17

    12

    HHOOWW--TTOOWritten by Daniel Lamb

    CCRREEAATTEE YYOOUURR OOWWNNSSEERRVVEERR -- PPaarrtt 88

    We are now going to add

    users to eGroupware andgive them permissions to

    various items.

    To add a user, log into youreGroupware install with the adminuser you created before. Browseto Admin, click on Admin, and fillin the boxes as you wish, Isuggest putting a tick in the box

    "Never Expires". You can also givethe users different permissions.You may want some to be able toview only emails, whereas youmay wish to give full control toothers. After adding a user,remember to click "Add".

    You now want to add a group.You can use the default group for

    everyone, or use the Admin groupif you wish.

    You will see under Admin alarge number of optionsdepending on what you want todo. Go through the differentoptions there, although the

    defaults should be fine for anyone to

    use. There are also preferences forwhich any users can set themselves.Again, the defaults are fine, but youmight choose to change themdepending on the use you haveplanned for them.

    A request I received from PhilippHohn was how to connect

    and to

    eGroupwares ical server. To get a listof calendars (below), go to the URL:

    http://servername/egroupware/icalsrv.php/username/list.html

    Ensure the user has

    permissions to use the icalserver. You can do this via theUser Accounts tab from theAdmin menu, then click on theuser you wish to havepermissions for this, or do it viathe groups menu. My user iscalled manager, so if I type in:

    http://server/egroupware/icalsrv.p

    hp/manager/list.html

    I get a number of calendarsshowing up. I want to use themain-events calendar, so in

    , under the calendaroption (as long as you havelightening installed, there areloads of guides how to do this onthe Web), I would simply right

    click and select New Calendar,choose 'On The Network' thenenter the URL:

    http://10.0.165.15/egroupware/icalsrv.php/manager/events.ics

    Click 'Next' then choose your

  • 8/8/2019 Create Your Own Server

    16/17

  • 8/8/2019 Create Your Own Server

    17/17

    14

    owns and runsand is based in

    Perth, Scotland. He is alsoinvolved in a number of opensource projects such as

    ,and .

    He is also a committed LeedsUnited fan.

    You can now log in using theURL:

    http://servername:8080/QuoteroClient/login.jsp

    and the username "admin" andpassword "admin". To add users,click on Administration, expanddomains, then HQUOTERO, clickon users. You can add new usershere using the button Add. UnderSpecial Roles you can add varioususers with different permissionsfor different tasks.

    Under Quotero Server v0.6,

    click on this button and chooseNew workspace, name it whateveryou wish and add permissions for

    the various users you have created.By clicking on the button you canadd a new folder by clicking on Newfolder, and call it what you wish, andadd relevant permissions. You cannow upload documents by clicking onthe button next to the folder nameand select Import Document. TheDocument will now be in the folder.You can now check out thisdocument, open it just to view it orstart a workflow involving thedocument (as well as a number ofother options) or any others you add.You can check out a document thencheck it back in again, which will

    mean only one person can use it at atime. This is very powerful softwareand can save businesses a lot of time.

    full circle magazineon UbuntuForums.org, and IRC on the irc.freenode.net server, channel: #fullcirclemagazine

    w w w . f u l l c i r c l e m a g a z i n e . o r g

    keep up to date with our adventures viahttp://twitter.com/fullcirclemag

    http://twitter.com/fullcirclemaghttp://fullcirclemagazine.org/http://fullcirclemagazine.org/http://ubuntuforums.org/forumdisplay.php?f=270