I've attached a file with step by step documentation
for installation of Midgard 1.4.3 and NadminStudio M5
on Redhat 7.3. This setup seems to be working
reasonably well. But I wont know unless I've used it
more.

I hope it helps any newbies who want to install midgard + nadmin. I know how
it
feels to be a newbie becasue I was one a month ago.
This documentation has been made after 4 or 5 installs
of Midgard+Nadmin but I am not sure my method is the
most efficient/reliable. Comments/ suggestions/
criticisim is welcome. This is also my first post to
this midgard users group

-Mrinal

#############################################################################
#                                                                           #
# INSTRUCTIONS FOR INSTALLING REDHAT 7.3 + MIDGARD 1.4.3 + NADMIN STUDIO M5 #
#                                                                           #
#############################################################################
|                                                                           |
| CREATED:      Mrinal Virnave                                              |
| DATE:         08/16/2002                                                  |
|                                                                           |
| DISCLAIMER:   I do not gurantee these instructions will work              |
|               with all setups. Please use them at your own risk           |
|                                                                           |
| DESCRIPTION:  This setup instructions does not include installation of    |
|               Cyrus, Exim and Bind. Therefore this setup will not provide |
|               email administration functions under nadmin. These          |
|               instructions also assume you already have a nameserver in   |
|               place or you are able to configure the current machine as   |
|               a nameserver yourself.                                      |
|                                                                           |
|               Questions or comments please email [EMAIL PROTECTED]      |
\---------------------------------------------------------------------------/

Step 1> Install RedHat 7.3
-----------------------------
There are no special instructions really. 
Do a standard RedHat7.3 installation.
Make sure you install the following packages.
(these are usually included in a standard webserver installation)
        apache
        apache-devel
        autoconf
        automake
        rcs
        php-mysql
        perl

------------------------------------------------
 REDHAT 7.3 IS INSTALLED AND RUNNING
------------------------------------------------



Step 2> Install Midgard 1.4.3
-----------------------------
    2.1> Log into your server as Root.

    2.2> Create a directory for your sources
            $ mkdir /usr/src/redhat/SOURCES/midgard
            $ cd /usr/src/redhat/SOURCES/midgard

    2.3> Go to the site http://www.midgard-project.org/download 
            $ links http://www.midgard-project.org/download 

    2.4> Download all the files listed there
            midgard-lib-1.4.3.tar.bz2 
            mod_midgard-1.4.3.tar.bz2 
            midgard-php4-1.4.3.tar.bz2 
            midgard-data-1.4.3.tar.bz2 
            mgd-nadmin-patches.tar.gz 

    2.5> Unzip & untar all the files
            $ bunzip2 midgard-lib-1.4.3.tar.bz2 
            $ bunzip2 mod_midgard-1.4.3.tar.bz2 
            $ bunzip2 midgard-php4-1.4.3.tar.bz2 
            $ bunzip2 midgard-data-1.4.3.tar.bz2 
            $ gunzip mgd-nadmin-patches.tar.gz         
            $ tar -xvf midgard-lib-1.4.3.tar
            $ tar -xvf mod_midgard-1.4.3.tar
            $ tar -xvf midgard-php4-1.4.3.tar 
            $ tar -xvf midgard-data-1.4.3.tar
            $ tar -xvf mgd-nadmin-patches.tar

    2.6> Patch the files required for Nadmin
            $ cd mgd-nadmin-patches
            $ patch ../midgard-php4-1.4.3/event.c -i ./event.c.diff 
            $ patch ../midgard-php4-1.4.3/midgard.c -i midgard.c.diff
            $ patch ../midgard-php4-1.4.3/mgd_event.h -i mgd_event.h.diff 

    2.7> Make and install Midgard-Lib
        First make sure your path contains /sbin and /usr/sbin
            $ echo $PATH
        If not then add them using
            $ export PATH=$PATH:/usr/sbin:/sbin
        Then continue to the midgard_lib installation
            $ cd ../midgard-lib-1.4.3
            $ ./configure
            $ make
            $ make install

    2.8> Make and install mod_midgard
            $ cd ../mod_midgard-1.4.3
            $ ./configure --with-apxs=/usr/sbin/apxs 
            $ make
            $ make install

    2.9> Make and install midgard-php
            $ cd ../midgard-php4-1.4.3
            $ ./mkall

    2.10>Set up Mysql
        Make sure MySQL is started and that it will start the next time you reboot
            $ /etc/init.d/mysqld start
            $ pico /etc/init.d/mysqld
        edit the file so that the line
          
            # chkconfig: - 78 12 

            READS

            # chkconfig: 345 78 12 
       
        Then execute the following commands

            $ chkconfig --del mysqld
            $ chkconfig --add mysqld

        Now MySQL is set to start automatically the next time you reboot

    2.11>Midgard Database Installation
        We continue with the midgard-data installation (I've used "midpass" as the 
midgard db password
                                                        "hostname.mydomain.com" as the 
hostname
                                                        "192.168.2.20" as the ip of 
the box)
            $ cd ../midgard-data-1.4.3
            $ mkdir /var/www/midgardblobs
            $ chown apache.apache /var/www/midgardblobs
            $ ./configure --with-db-host=weblinux127.cns.iit.edu 
--with-db-admin-user=root \
              --with-db-user=midgard --with-db-user-password=midpass 
--with-host=hostname.mydomain.com \
              --with-ip=192.168.2.20 --with-blobdir=/var/www/midgardblobs 
--with-apxs=/usr/sbin/apxs \
              --with-apache-user=apache --with-apache-group=apache --with-install=new
            $ ./dbinstall
       
        This completes the database creation. 
        Now we just need to ensure our database is safe so we add an admin password 
(I've used "mysqlRoot")
            $ mysqladmin -u root password 'mysqlRoot'
        All we need to do now is install the database
            $ ./dbinstall

    2.12>Making changes to the httpd.conf file
        First we need to copy the midgard-data.conf file that dbinstall has created.
            $ cp midgard-data.conf /etc/httpd/conf/

        Now we edit the httpd.conf file
            $ pico /etc/httpd/conf/httpd.conf

        Page Down (ctrl-V) to the bottom of the file and add the following line
            Include /etc/httpd/conf/midgard-data.conf

        Now we need to make some other changes to the file
        Somewhere close to line # 275 you will see the following.

            <IfDefine HAVE_PYTHON>
            LoadModule python_module      modules/mod_python.so
            LoadModule midgard_module     /usr/lib/apache/mod_midgard.so
            </IfDefine>

        Change it so that it reads (use ctrl-k to yank a line and ctrl-u to paste it)

            <IfDefine HAVE_PYTHON>
            LoadModule python_module      modules/mod_python.so
            </IfDefine>
            LoadModule midgard_module     /usr/lib/apache/mod_midgard.so

        Again Somewhere close to line # 355 you will see the following

            <IfDefine HAVE_PYTHON>
            AddModule mod_python.c
            AddModule mod_midgard.c
            </IfDefine>
            
        Change it to 
            <IfDefine HAVE_PYTHON>
            AddModule mod_python.c
            </IfDefine>
            AddModule mod_midgard.c

        Save and exit (ctrl-x)


    2.13>Making Changes to the php.ini file
        We need to add an extension to the php.ini file
            $ pico /etc/php.ini

        Somewhere near line# 481 at the bottom of all the extensions add the following
            
            extension=midgard.so

        Save and exit

    2.14>Making Changes to the repligard configuration
        We need to edit the repligard configuration
            $ pico /usr/local/etc/repligard.conf

            CHANGE
            name="midgard"    
            username="midgard" 
            password="midgard"
            TO
            name="midgard"    
            username="midgard" 
            password="midpass"    (we are using "midpass" as an example, 
                                   use the password you used in step 2.11)

            ALSO CHANGE
            blobdir="/var/www/blobs"
            TO
            blobdir="/var/www/midgardblobs"



    2.15>Making changes to the dynamic linker
        Edit the linker config
            $ pico /etc/ld.so.conf

        Add the following at the end of the file
            /usr/local/lib

        Save and Exit
        Activate it
            $ ldconfig

    2.16>Copying Files to the web directory
        $  cp -r images/example/ /var/www/html
        $  cp -r images/midgard/ /var/www/html


    2.18>Starting apache
        We need to make apache start at bootup
            $ pico /etc/init.d/httpd
        
        edit the file so that the line
          
            # chkconfig: - 85 15 

            READS

            # chkconfig: 345 85 15 
       
        Then execute the following commands

            $ chkconfig --del httpd
            $ chkconfig --add httpd

        Now that we have set apache to start it at boot time
        We start apache by typing
            /etc/init.d/httpd start

---------------------------------------------------------------
 MIDGARD 1.4.3 IS NOW SET UP (with nadmin patches in place)
---------------------------------------------------------------



Step 3> Install Nadmin Studio M5
---------------------------------

    3.1> Download Nadmin files
        Create a seperate directory for the Nadmin files
            $ mkdir /usr/src/redhat/SOURCES/nadmin
            $ cd /usr/src/redhat/SOURCES/nadmin

        Download the required files
            $ links http://cms.polarmedia.no/midgard/M5-latest-ever
        
        Download the following
            fimages_jul.tgz 
            nadmin_SNAPSHOT_core.xmlgz
            nadmin_SNAPSHOT_templates.xmlgz

        (You may want to download other files if you need other languages.)

        Go to the parent directory and then back into the NadminRPMS directory
        Download the following
            nadmin-tools-0.1-1.hklc_RH71.src.rpm

        Exit from links hit 'q'


    3.2> Install Nadmin
        Use repligard to import the xmlgz files into midgard
            $ repligard -i nadmin_SNAPSHOT_core.xmlgz 
            $ repligard -i nadmin_SNAPSHOT_templates.xmlgz 

    3.3> Changing Mysql information
        We need to make changes to the hostnames (Remember I have assumed 
"hostname.mydomain.com"
                                                  to be the hostname and "midpass" the 
mysql 
                                                  password for the user midgard)

            $ mysql midgard -u midgard -p
            $ Enter password: ( enter the password "midpass" here)
            
            mysql> UPDATE host SET name='weblinux127.cns.iit.edu', port=80 WHERE 
name='renameme';
            mysql> \q

    3.4> Copying the images
            $ tar -zxvf fimages_jul.tgz 
            $ mv fimages /var/www/html

    3.5> Logging in
        For this step you will need to access the server through a browser.
        You may use another computer to access your midgard server or type 'startx'
        and use mozilla or netscape. (I used IE on another computer)

        Open your browser and go to http://hostname.mydomain.com/nadmin
        Login with
            Username: admin
            Company: System Administrator
            Password: password

        To change the admin password click on the GROUPS/PEOPLE tag
        Click on All People > admin
        Click on the DETAILS tab on top
        and type a new password. (we assume it to be "adminpass")
        You may be thrown back to the login screen after this.


    3.6> Change the repligard.conf file again
            $ pico /usr/local/etc/repligard.conf

            CHANGE
            username="admin"  
            password="password"

            TO
            username="admin"  
            password="adminpass"  ("adminpass" is an example use the one from step 3.5)


    3.7> Create the CVS directory
                $ mkdir /var/cvs
                $ chown apache.apache /var/cvs/ 

    3.8> Bug Fix: new_copy_style Fix (thanks to 'jalonz' at the Bug Fix forum at 
nadminstudios.com)
            Go to Snippet/hklc_adminsite_host/argv0/new/new 
            click on edit and scroll down until you see "function new_copy_style". 
            In the fuction is a call to: 
            $local_id = mgd_copy_style($lastid); 
            change it to: 
            $local_id = mgd_copy_style($lastid,$sitegroupid); 
            and Click Submit


    3.9> Bug Fix: company database username too long

            Go to Snippet: / hklc_adminsite_host / argv0 / dbsetup / dbsetup

            CHANGE

            // new user!
            $sguser = eregi_replace("[^A-z0-9]","",crypt($sgguid));
            $sgpasswd = eregi_replace("[^A-z0-9]","",crypt($sguser));

            TO

            // new user!
            $sguser = substr(eregi_replace("[^A-z0-9]","",crypt($sgguid)), 0, 12);
            $sgpasswd = substr(eregi_replace("[^A-z0-9]","",crypt($sguser)), 0, 10);

            Click Submit

    3.10>System Configuration
        Since we have not installed cyrus and exim we do not want the system to 
        try and create e-mail accounts for people.

            Click on the Company Tab
            Click System Config
            Enter the following values
                System Administration Functions Available : NO
                Tools Menu Available (to System Admin) : YES
                Allow user change their password : YES
            Click Submit


    NOTE: When a new user logs in, an error comes up as follows
        Warning: Supplied argument is not a valid imap resource in ROOT(914) : 
eval()'d code(267) : eval()'d code(3) : eval()'d code(78) : eval()'d code on line 198

        To remove this go to the MAIL tab on the left
        Click on 'Folder'
        Click on the 'Preference' tab on the right
        Fill in the Other Mail Server, Username, Password information about any imap 
server
           where you have an account.
        Click on the + beside the Folderand you should see your imap folders.
          
----------------------------------------------------------------
 NADMIN M5 IS NOW INSTALLED AND READY
----------------------------------------------------------------

You may end your installation here or continue to set up
a replicated system. Please note that a replicated system is required
for the approval system to work.

Remember this replicated system assumes you do not have exim and cyrus-imap 
installed on your system and are not going to use it as your mail server.

The following is derived from http://www.hklc.com/midgard_manual/topic_73 with a few 
modifications


Step 4> Setting up a replicated system
---------------------------------------

    4.1> Setting the staging server port
        Log into nadmin as 'admin' and click on the 'Company' tab
        Click on 'System Config'
        Make sure the Port of Staging Server value is set to 8001


    4.2> Converting to a Staging/Live Setup
        Go to the Tools Tab on the left
        Click on the 'Convert Images' link
        Click on the 'Convert to Staging' link
        Fill in the confirmation phrase and click submit.


    4.3> Creating the initial database
            $ mysqldump -p midgard > /tmp/midgard.sql
              Enter password: (enter 'mysqlroot' password) 
            $ mysqladmin -p create midgardlive
              Enter password: (enter 'mysqlroot' password) 
            $ mysql -p midgardlive < /tmp/midgard.sql
              Enter password: (enter 'mysqlroot' password) 
            $ mysql mysql -p
              Enter password: (enter 'mysqlroot' password) 
             >update db set Db='midgard%' where db='midgard';
             >\q
            $ mysqladmin -p flush-privileges
              Enter password: (enter 'mysqlroot' password) 

        Test the connection
            $ mysql midgardlive -umidgard -p
              Enter password: (enter 'midpass' password) 
              >\q


    4.4> Live Blobs Directory
        cp /var/www/midgardblobs /var/www/midgardliveblobs


    4.5> Create the configuration scripts
        Paste the following code into the respective files

        
------------------------------------------------------------------------------------------------
        FILE 1: /usr/local/etc/config.pl (change 'midpass' to your midgard database 
pwd)
        
------------------------------------------------------------------------------------------------

        $DBNAME = "midgard";
        $DBUSER = "midgard";
        $DBPASSWD = "midpass";

        
-----------------------------------END----------------------------------------------------------

        
------------------------------------------------------------------------------------------------
        FILE 2: /usr/local/etc/downgrade_unapproved.pl
            Download the file from 
http://www.hklc.com/midgard_manual/downgrade_unapproved.pl
            Edit every occurance of '/etc/repligard/' with '/usr/local/etc/'
            Also comment the following line out
            
                #my($DBNAME, $DBUSER ,$DBPASSWD);
        
------------------------------------------------------------------------------------------------


        
------------------------------------------------------------------------------------------------
        FILE 3: /usr/local/etc/repligard_hourly_dump_staging.conf 
            Copy/Paste the file from http://www.hklc.com/midgard_manual/article_799 
(top part)
            Edit the following lines 
                <database
                        schema="/usr/local/share/midgard/repligard_withsg.xml"  
(careful with this line)
                        name="midgard"
                        username="midgard"
                        password="midpass"                              (use midgard 
db password here)
                        encoding="ISO-8859-1"
                        blobdir="/var/www/midgardblob"
                />
                <!-- Login account description for Repligard operation -->
                <login 
                        username="admin"
                        password="adminpass"                            (password for 
the admin user)
        
------------------------------------------------------------------------------------------------

        
------------------------------------------------------------------------------------------------
        FILE 4: /usr/local/etc/repligard_hourly_import_live.conf 
            Copy/Paste the file from http://www.hklc.com/midgard_manual/article_799 
(bottom part)
            Edit the following lines 
                <database
                        schema="/usr/local/share/midgard/repligard_withsg.xml"  
(careful with this line)
                        name="midgardlive"                              (this is 
different from above)
                        username="midgard"
                        password="midpass"                              (use midgard 
db password here)
                        encoding="ISO-8859-1"
                        blobdir="/var/www/midgardliveblob"              (this is 
different too)
                />
                <!-- Login account description for Repligard operation -->
                <login 
                        username="admin"
                        password="adminpass"                            (password for 
the admin user)
        
------------------------------------------------------------------------------------------------

        
------------------------------------------------------------------------------------------------
        FILE 5: /usr/local/etc/repligard_staging_to_live.sh
            Download the file from 
http://www.hklc.com/midgard_manual/repligard_staging_to_live.sh
            Edit every occurance of '/etc/repligard/' with '/usr/local/etc/'
            Do the following only if you do NOT want to receive e-mail messages every 
time cron runs this
            script.
            CHANGE 

                $REPLIGARD -c /etc/repligard/repligard_hourly_dump_staging.conf \
                -e /tmp/hourly_export_${THISDATE}.xml.gz

            TO (added > /dev/null)

                $REPLIGARD -c /usr/local/etc/repligard_hourly_dump_staging.conf \
                -e /tmp/hourly_export_${THISDATE}.xml.gz > /dev/null

            ALSO CHANGE

                $REPLIGARD -c /etc/repligard/repligard_hourly_import_live.conf \
                -i /tmp/hourly_export_${THISDATE}.xml.gz

            TO

                $REPLIGARD -c /usr/local/etc/repligard_hourly_import_live.conf \
                -i /tmp/hourly_export_${THISDATE}.xml.gz > /dev/null

        Make this file executable
            $ chmod 755 /usr/local/etc/repligard_staging_to_live.sh

        
------------------------------------------------------------------------------------------------


        
------------------------------------------------------------------------------------------------
        FILE 6: /usr/local/etc/apacheupdate.pl
            To get this file you will need to install the nadmin-tools rpm
            $ cd /usr/src/redhat/SOURCES/namdin
            $ rpm -ivh nadmin-tools-0.1-1.hklc_RH71.src.rpm

            (This will have extracted files into the /usr/src/redhat/SOURCES directory)

            $ cp /usr/src/redhat/SOURCES/apacheupdate.pl /usr/local/etc
            $ cd /usr/local/etc

            Change the following lines.
            FROM
                require '/etc/repligard/config.pl';
            TO
                require '/usr/local/etc/config.pl';

            FROM
                $BLOBS = "blobs_staging";
            TO
                $BLOBS = "midgardblobs";

            FROM
                $LIVEBLOBS = "blobs_live";
            TO
                $LIVEBLOBS = "midgardliveblobs";

            Make sure that the following is the correct IP addresses (We had assumed 
ip as '192.168.2.20')
                $virtualhostip="192.168.2.20";

            FROM
                $stop="killall -9 httpd";
            TO
                $stop="/etc/init.d/httpd stop";

            FROM
                $restart="/etc/rc.d/init.d/httpd restart"; 
            TO
                $restart="/etc/init.d/httpd restart"; 

        
------------------------------------------------------------------------------------------------
        
------------------------------------------------------------------------------------------------
        FILE 7: /usr/local/etc/nadminstudio.sh (cut and paste the code below)
        
------------------------------------------------------------------------------------------------
        #!/bin/sh

        if [  -r "/tmp/apachemodified" ]
        then
           perl /usr/local/etc/apacheupdate.pl
        fi

        if [ -r "/tmp/runreplication" ]
        then
          /usr/local/etc/repligard_staging_to_live.sh > /dev/null
          rm /tmp/runreplication
        fi
        
------------------------------------END---------------------------------------------------------

        Make this file executable
            $ chmod 755 /usr/local/etc/nadminstudio.sh

        
------------------------------------------------------------------------------------------------
        FILE 8: /etc/httpd/conf/midgard-data.conf.header (cut and paste the code below)
        
------------------------------------------------------------------------------------------------
                ## Uncomment this if you want serve files instead of Midgard URLs
                ## where there's a match for both. You'd want to use this if you have
                ## active pages and you're using static dummy pages to force this
                ## behaviour. Note that this setting is apache-wide, not per-host.
                # MidgardFavorFiles On

                ## Uncomment this for PHP3,
                # MidgardRootFile "/usr/lib/apache/midgard-root.php3"
                ## or this for PHP4
                MidgardRootFile "/usr/lib/apache/midgard-root.php"
        
-----------------------------------END----------------------------------------------------------

    4.6> Install PERL modules used by the scripts using CPAN (you may need to do a 
'perl -MCPAN -e shell')
            install DBI::DBD
            install DBI
            install DBD::mysql
    
    
    4.7> Edit the crontab file
            $ pico /etc/crontab

        Add the following lines

            01 * * * * root /usr/local/etc/repligard_staging_to_live.sh
            * * * * * root /usr/local/etc/nadminstudio.sh

    4.8> Run the following commands
            $ cd /usr/local/etc/
            $ ./repligard_staging_to_live.sh
            $ ./nadminstudio.sh

----------------------------------------------------------------
 NADMINSTUDIO IS SET UP WITH STAGING/REPLICATION SERVER
----------------------------------------------------------------

I hope you find this useful. If you cannot get something to work please e-mail me at 
[EMAIL PROTECTED]
and if we figure it out I will add it to this document.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to