Copenhagen Admin Manual - OneStart

advertisement
COPENHAGEN ADMINISTRATION MANUAL
TABLE OF CONTENTS
Introduction to Copenhagen commands
i.
Basic copenhagen commands …………………………………………………………………………3
Copenhagen Installation
i.
Copenhagen files and location…………………………………………………………………5
ii.
Editing configuration files………………………………………………………………………5
iii.
Xsl template files location………………………………………………………………………6
iv.
Setting copenhagen path…………………………………………………………………………………6
Troubleshooting Copenhagen
i.
Copenhagen too slow …………………………………………………………………………………………8
ii.
Distribution not being delivered…………………………………………………………8
iii.
Page not found error………………………………………………………………………………………10
iv.
Admin interface not showing(page not found)…………………………10
v.
Media relation site not showing…………………………………………………………11
vi.
Admin interface not showing( mysql error)………………………………11
vii.
Documents not recaching………………………………………………………………………………11
viii.
Out of disk space error………………………………………………………………………………12
ix.
Troubleshooting xsl using sabcmd………………………………………………………12
Daily Administration.
i.
Adding/change page status options……………………………………………………13
ii.
Adding a new page type…………………………………………………………………………………13
iii.
Adding options information………………………………………………………………………14
iv.
Changing distribution status to tentative………………………………14
v.
Creating a new internal client …………………………………………………………14
Indiana university creative services
Page 1
COPENHAGEN ADMINISTRATION MANUAL
vi.
Copying files between servers using scp……………………………………17
Indiana university creative services
Page 2
COPENHAGEN ADMINISTRATION MANUAL
i.
Copenhagen Command Line Interface (CLI)
The command used to perform a lot of Copenhagen’s day to day task is
Copenhagen. Type Copenhagen followed by the any of the following options; for
example typing
copenhagen [options] command
Copenhagen send_email: will send all queued email.
Copenhagen –-dateKey=[arg]: will display date field, e.g creationDate or
publicationDate
Copenhagen –docTypes=[arg]: A
comma-separated list of integer document types
Copenhagen -–es=[arg]: Affected documents should have status level[ arg] upon
completion
Copenhagen –help, -h -?: Displays this help message
Copenhagen –interval=[arg]: The interval in seconds between instances of this
executable is run, e.g., --interval=600
Copenhagen –migrationOffset=[arg]: The interval(in seconds) prior to now before
which documents may be migrated, e.g –migrationOffset=172800 – migrate
documents submitted before 48 hours ago.
Copenhagen –-queue=[arg]: Run the command on documents at status level [arg].
Copenhagen –-user=[arg]: Run the command as user [arg]
Copenhagen –version, -v: Display version information.
The following command performs additional tasks.
Copenhagen cache_xml perform a sitewide XML rechace
Copenhagen flush_html: Flushes all cached HTML files
Copenhagen migrate: moves content through the site’s workflow, e.g, archive all
expired document.
Copenhagen send_email: will send emails in the queue.
Copenhagen tickle: Notify users of any tasks and/or checked out documents for
the current day.
Indiana university creative services
Page 3
COPENHAGEN ADMINISTRATION MANUAL
Copenhagen update_xml: Update any data files that were recently changed in the
Copenhagen database.
Indiana university creative services
Page 4
COPENHAGEN ADMINISTRATION MANUAL
II.
Copenhagen Installation
To install Copenhagen perform the following installation procedure. Note that
the main driving force behind Copenhagen is its ability to perform HTML
generation based on the XML and the associated style sheet (XSL file). Hence
the need to make sure that Copenhagen command executes successfully. The
following is an overall Installation process;
a.
Untar Copenhagen software to the master account. Use the following
command
tar xvfz copenhagen.tar.gz
b.
In the master account change the configuration in the following files:
/etc/preferences/Copenhagen.config.inc /etc/preferences/sessionInfo.php.inc
/etc/preferences/optinInfo.php.inc
/www/.htaccess
/www/.copenhagen
/www/pub/libs/tpls/*
/wwws/admin/.htaccess
/wwws/admin/.copenhagen
/bin/Copenhagen
In the files above make sure that all the paths are defined correctly and the
account information reference is correct. As an example the following line in
Copenhagen.config.inc
adminRoot = "/home/iuinfo/wwws/admin";
Should have the correct path to the admin interface.
Indiana university creative services
Page 5
COPENHAGEN ADMINISTRATION MANUAL
c.
Modify all the related xsl/templates files. The templates files are found
in /www/pub/libs/xsl/interior/*.xsl. Master.xsl- controls all the information
in the head section of the HTML document. This file also controls the overall
structure of the page by defining page hearders, the left navigation bar,
center control area, related information bar, and the footer. Templates.xslThis file has many templates within it that control what content is displayed
and how it is displayed based on document type or URLs. Person_templates.xslControls how faculty and expert sources profiles appear. This file references
templates.xsl for some templates. To find the XSL configuration files go to
/home/iuinfo/etc/preferences/xslInfo.php.inc.
d.
To make sure that the Copenhagen command works, the shebang line must
point to an actual PHP processor i.e type
whereis php
to get the location of the php processor. If the shebang line does not point to
the right one change it.
e.
To include the Copenhagen command in your path, for instance to be able
to just type command Copenhagen without having to specify the path
(/home/iuinfo/bin/Copenhagen), include the path in your shell. For bash shell
add the following lines in your .bashrc file
PATH$PATH:/home/iuinfo/bin;export PATH.
In the file /bin/Copenhagen add the following as the shebang line this is in
relation to copenprod.uits.indiana.edu.
#!usr/local/php4.4.0/bin
f.
Once all the configuration files are set correctly, the next part is to
set up the database connection. Make sure that the database server is up and
running. To check this use the following command.
Indiana university creative services
Page 6
COPENHAGEN ADMINISTRATION MANUAL
Ps ax | grep mysqld.
III.
Troubleshooting Copenhagen
Indiana university creative services
Page 7
COPENHAGEN ADMINISTRATION MANUAL
a.
Copenhagen too slow (Killing all Copenhagen process)
Log into iuinfo account on copenprod.uits.indiana.edu. Then type the following
command
ps –U iuinfo.
This will show you all the Copenhagen processes running on the account. To
kill all Copenhagen processes type the following. This should be the last
option since all copenhagen work by the end users will be lost
Killall –SIGKILL Copenhagen.
b.
Distributions not being Delivered (Mail stuck in the queue.) Type:
Copenhagen send_email.
This will send all the held up emails in the queue. There are times when
distributions have been scheduled but mails are not being delivered. In this
scenario check /etc/logs/email. Using the queueID number, this can be found by
login into Copenhagen web interface. click on the intended distribution and
then click on info. Hoover around the task and the queueID will be found at the
bottom of the page (as shown in the picture fig 1.1). Using the queueID check
in /etc/logs/email. For instance if the queueID is 995363, the files you need
to look for are 995363_actual.txt and 995363_intended.txt. If actual does not
exist then the distribution will have to be resent. The best way to go about
this is to log into phpmyadmin, look for distQ table and change status from
Indiana university creative services
Page 8
COPENHAGEN ADMINISTRATION MANUAL
confirmed to tentative in the status column
fig 1.1
Clear all the mail spooling logs, to accomplish this, go to /var/spool/mail/
then type the following command.
> iuinfo
If the files system is growing rapidly, concentrate your effort in the
/var/spool/mail directory – look for huge mailboxes( something like)
find /var/spool/mail –size +1000k
Indiana university creative services
Page 9
COPENHAGEN ADMINISTRATION MANUAL
This will display a list of mailboxes larger than 1MB in size. It would also be
a good idea to check the httpd log files at /usr/local/etc/httpd/logs
c.
Page not displaying (XSL errors or XML).
This error is usually caused by error in the relevant XSL or XML file, to fix
this go through the XSL (for developers) or XML file. For instance, if a page
with an ID of 555 is causing the error. Locate the XML file found in
etc/scratch/555.xml. Open the file using an XML supported editor and look for
characters that are not supported.
d.
Admin interface not showing.
This is a result of the secure web server not running. To fix this start the
secure web server. Log into -copenprod.uits.indiana.edu using the account
iuinfo. Run the following command:
sudo service apachessl start
Or enter the soft link path.
/usr/local/apachessl_prod/bin/apachectl startssl
Or the hard path:
/usr/local/apache_1.3.33_ssl/bin/apachectl startssl
/usr/local/apache_prod/bin/apachectl start
Both mgrlog and iuinfo account should be able to run the sudo command. Note
sudo command and service system utility programs are in /sbin (system
binaries). Which should be in both account’s default search path.
Indiana university creative services
Page 10
COPENHAGEN ADMINISTRATION MANUAL
e.
Media Relation website not showing (page not found error).
This is due to the fact that the web server is not running, to fix this start
the web server. Log into copenprod.uits.indiana.edu using the account iuinfo.
Run the following command.
sudo service apache start
f.
Admin interface not showing (mysql error).
This is due to the fact that the database server is not running. To fix this
problem log onto copenprod.uits.indiana.edu using the iuinfodb account and
restart the database. To restart the database run the following command:
cmd_mysql start
g.
Document not recaching.
If the document has been published but the changes are not reflected try the
following. –In the admin interface highlight the document and click on the
recache button. If the document is still not generating a newer copy, try the
following command in iuinfo account.
copenhagen –queue=1, page cache xml
(for page)
copenhagen –queue=1, category cache xml
(for topic)
copenhagen –queue=1, group cache xml (for group)
copenhagen –queue=1, asset cache xml
h.
(for asset)
Out of disk space.
Indiana university creative services
Page 11
COPENHAGEN ADMINISTRATION MANUAL
In case of insufficient space copenhagen stops running- To find out disk
usage Type the following command:
du –h ( disk usage in a human readable form). For example to find how much
space has been used in www directory type du –h www. Which give something
the like:
252K
./www/blurbTest/tpl
44K
./www/blurbTest/img
1.3M
./www/blurbTest/old
2.1M
./www/blurbTest
20K
./www/pub/bclients
To free up space, the first place to start from are the logs. Look for and
delete old application and email logs. Email logs are explained in b) above.
i.
Troubleshooting xsl using sabcmd
Sablotron XSL processor has a command line interface. This is tools is
essentially what copenhagen command runs to generate HTML from XSL and XML.
The command is in this general order.
sabcmd file1.xsl,file2.xsl,file2.xsl
file1.xml,file2.xml file1.html
In copenhagen, command like would output the result to screen.
sabcmd /home/iuiinfo/www/pub/libs/xsl/interior/master.xsl
home/iuiinfo/etc/scratch/1373.xml
while output to a file
sabcmd /home/iuiinfo/www/pub/libs/xsl/interior/master.xsl
/home/iuiinfo/etc/scratch/groups/120.xml
/home/iuiinfo/etc/scratch/groups/120.html
Indiana university creative services
Page 12
COPENHAGEN ADMINISTRATION MANUAL
IV. Day to day Administration.
(a)
Adding/Changing page status options.
- Add status to the following file on iuinfo@copentest.uits.indiana.edu
etc/preferences/statusinfo.php.inc.
etc/preferences/kindInfo.php.inc.
- Test the new status within the test environment.
https://info-t.iu.edu/admin.
- Move the changes to the live site at: https://info.iu.edu/admin.
- Test on the live site.
–Notify the stakeholders. Adding a new published state (published, archived)
requires additional configuration.
(b)
-
Adding a new page type.
Create two new standard web pages in Copenhagen. Indicate which one will be
the homepage for the new page type, and which one will be the archive in
slug and the title. Make sure that the site can be displayed on the proper
internal clients (under public Copenhagen websites). Save the changes. Note
the document ID form the URL fields.
–Add a new document type to the following file
etc/preferences/docTypes.php.inc. Indicate the homepage, listpage( use
homepage id), and archive page based on the documents you just created.
Give the new doctype a unique id ($_doctypes[xx])
Indiana university creative services
Page 13
COPENHAGEN ADMINISTRATION MANUAL
–
log in as super user and assign edit right to the new doc type. Finally
modify the XSL if needed.
(c)
Adding degree options information.
Edit the file etc/preferences/degreeinfo.php.inc. Add the degree information
(make sure the ID is unique).
(d)
Changing the distribution status to tentative.
Find the distribution id (or page id). In copenhagen find the page, click on
info button. Navigate to the date, and hover over the distribution link.
Distribution ID will appear in the lower left corner of your browser. Note the
ID. Log into phpmyadmin in copenprod.uits.indiana.edu. The following is the
phpmyadmin url https://copenprod.uits.indiana.edu/~iuinfo/phpmyadmin log in
using the mrpsAdmin account, using the database Copenhagen and table distQ. Run
the following command.
select * from ‘distQ’ WHERE queueID= xxxx.
Edit the entry; change it from active to tentative. Other important commands
are send_email and mailq.
(e)
Creating a new internal client (Copenhagen website). The idea is to copy
the account iunews files to the new account. Make sure that all reference to
iunews is changes to reflect the new account name. Do not edit any reference to
iuinfo( this is the base account from which the clients account does its
processing). In details carry out the following.
Copy the www directory from iunews: Type
cp –R /home/iunews/www.
Edit the configuration files, .copenhagen and .htaccess
cd www
Indiana university creative services
Page 14
COPENHAGEN ADMINISTRATION MANUAL
pico .copenhagen
Don’t change any reference to iuinfo.
Reset the base url.
Reset the base path
Reset the scratch path.
Turn off caching so that template development is easier.
Edit .htaccess file.
Pico .htaccess
Change all iunews references to point to the new account name.
Setting up scratch directory.
To set up the scratch directory carry out the following.
Type the following
cd~
mkdir etc
chmod 750 etc
cd etc
ckdir scratch
chmod 770 scratch
cd scratch
Indiana university creative services
Page 15
COPENHAGEN ADMINISTRATION MANUAL
ckdir assets,
categories,clips,email,events,experts,groups,notes,pdfs,vcards,volumes
Chmod 770
In iuinfo account, carry out the following.
Create a new entry for the client account
cd ~/etc/preferences
pico clientInfo.php.inc
create a new internal client entry.
In copenhagen perform the following
Make a home page
Create a new home page (standard web page) for the new site
Set the site name as the primary site.
Make a note of the home page id(1111)
Publish the page.
In the new account:
Set home page for the client
-pico ~/www/.copenhagen
-set the home page for the account site(1111).
In your browser:
Indiana university creative services
Page 16
COPENHAGEN ADMINISTRATION MANUAL
-Load http://copenprod.uits.indiana.edu/~account/
- start making changes to ~/www/pub/libs/xsl/interior/master.xsl
Changing public site URL
On client account do a global URL search and replace on
www/pub/libs/xsl/internal/master.xsl, templates.xsl,print.xsl.
On client account in www/.copenhagen change the line
$_CLIENT_ENV[“base_url”].
(f)
Copying images or files from copentest to coppenprod.
Using the secure copy command, images or files can be easily copied from
one server to the next. Other development tools like Dreamweaver can be used,
but to maintain security settings on the files, it is advisable to use unix scp
command. Log into iuinfo account in copenprod and run the following command,
xxx being the files or directory you want to copy. Go to the directory where
you want to copy the images
Indiana university creative services
Page 17
COPENHAGEN ADMINISTRATION MANUAL
Copy images from Miles to Copentest
scp -r iuinfot@miles.ucs.indiana.edu:/home/iuinfo/www/pub/libs/images/usr/* .
Copy scratch from iunews account
scp -r iuinfo@miles.ucs.indiana.edu:/home/iuinfo/etc/scratch/* .
Copy scratch from music account
scp -r musicpub@miles.ucs.indiana.edu:/home/musicpub/etc/scratch/* .
Copy scratch from chem account
scp -r chemiub@miles.ucs.indiana.edu:/home/chemiub/etc/scratch/* .
Copy asset XML
Copy scratch from iunews account
scp -r iuinfo@miles.ucs.indiana.edu:/home/iuinfo/etc/scratch/assets/*.xml .
Copy php.ini
scp iuinfo@copentest.uits.indiana.edu:/home/iuinfo/bin/php.ini
/usr/local/php4.4.0/php.ini
scp -r
iuinfo@copentest.uits.indiana.edu:/home/iuinfo/sourcecode/copenhagen_1_5/wwws
.
recaching command for Copenhagen
Indiana university creative services
Page 18
COPENHAGEN ADMINISTRATION MANUAL
copenhagen --queue=1697,page cache_xml
copying mysql database using command line
mysqldump --quick -h localhost
gunzip < copenhagen.gz
DELETE
-u root -p
mrpsRevised | gzip > copen.gz
| mysql -u root -h localhost -p copentest
from pme2Recipients where pmeRecipID > 347;
Untar files in unix
untar filename.tar.tar
rename filename.tar.tar to filename.gz
gunzip filename.gz
tar xvf folder created
Indiana university creative services
Page 19
COPENHAGEN ADMINISTRATION MANUAL
copenhagen not sending e-mail
* check as folder in www/pub/libs
and chmod etc directory
tar xvfz something.tar.gz
outputting a query to a text file
select description from
OUTFILE 'testtest.xml';
personDescription where personID like 753 INTO
Granting privileges in mysql
GRANT ALL PRIVILEGES ON copenhagen.* TO 'copentest'@'localhost'
'rexT4!4$' WITH GRANT OPTION;
IDENTIFIED BY
GRANT ALL PRIVILEGES ON vpurit.* TO 'vpurit'@'veritas.ucs.indiana.edu'
IDENTIFIED BY 'rexT4!4$' WITH GRANT OPTION;
Indiana university creative services
Page 20
Download