| Previous: Installing AOLserver 3.1 | Next: Acceptance Tests | |
Installing the ArsDigita |
||
This document covers the installation of the ArsDigita Community System (ACS) step by step. It assumes that you have already installed Oracle and AOLserver.
/web. Substitute the correct file name into
the line below. Tip: If you type acs- and then press
the TAB key, your shell should complete the file name for
you.
$ su - nsadmin
; Enter nsadmin's password.
$ cd /tmp
$ tar -xzvf acs-4.0.tar.gz --directory=/web
; Stay logged in as nsadmin.
$ cd /web
$ mv acs service_name
You should be logged on as nsadmin for this step and you should make sure that nsadmin is in the dba group.
$ groups
nsadmin dba web
If you do not see these groups, take the following action:
$ su - # Enter root password
# usermod -g nsadmin -G dba,web nsadmin
If you get an error about an undefined group, then add that group
manually:
# groupadd dba
# groupadd nsadmin
# groupadd web
Make sure to logout as root when you are finished with this
step and log back in as nsadmin.
svrmgrl and login:
$ svrmgrl
SVRMGR> connect internal
Connected.
SVRMGR> select file_name from dba_data_files;
Example results:
/ora8/m01/app/oracle/oradata/ora8/system01.dbf
/ora8/m01/app/oracle/oradata/ora8/tools01.dbf
/ora8/m01/app/oracle/oradata/ora8/rbs01.dbf
/ora8/m01/app/oracle/oradata/ora8/temp01.dbf
/ora8/m01/app/oracle/oradata/ora8/users01.dbf
/ora8/m01/app/oracle/oradata/ora8/indx01.dbf
/ora8/m01/app/oracle/oradata/ora8/drsys01.dbf
/ora8 directory
that is separate from the Oracle system data files. By default, the
Oracle system is on m01, so we will use m02.
This enables your Oracle system and database files to be on separate
disks for optimized performance. For more information on such a
configuration, see Chapter
12 of Philip's
book. For this example, we'll use
/ora8/m02/oradata/ora8/.
svrmgrl and login as root for this step:
SVRMGR> exit
$ su -
; Enter root password.
# mkdir -p /ora8/m02/oradata/ora8/
# chown nsadmin.web /ora8/m02/oradata/ora8
# chmod 775 /ora8/m02/oradata/ora8
# exit
$
autoextend. This
allows the tablespace's storage capacity to grow as the size of the
data grows. We set the pctincrease to be a very low value so that our
extents won't grow geometrically. We do not set it to 0 at the
tablespace level because this would affect Oracle's ability to
automatically coalesce free space in the tablespace.
$ svrmgrl
SVRMGR> connect internal;
SVRMGR> create tablespace service_name datafile '/ora8/m02/oradata/ora8/service_name01.dbf' size 50m autoextend on default storage (pctincrease 1);
database_password with the appropriate password.)Write down what you specify as service_name and database_password. You will need this information for configuring exports and AOLserver.
SVRMGR> create user service_name identified by database_password default tablespace service_name
temporary tablespace temp quota unlimited on service_name;
SVRMGR> grant connect, resource, ctxapp, javasyspriv, query rewrite to service_name;
SVRMGR> revoke unlimited tablespace from service_name;
SVRMGR> alter user service_name quota unlimited on service_name;
SVRMGR> exit;
Your table space is now ready. In case you are trying to delete a previous ACS installation, consult these commands in the appendix below.
$ sqlplus service_name/database_password
SQL> select sysdate from dual;
SYSDATE
----------
2000-06-11
SQL> exit
You should see today's date in a format 'YYYY-MM-DD.' If you can't login, try redoing step 1 again. If the date is in the wrong format, make sure you followed the steps outlined in the Oracle documentation.
The AOLserver architecture lets you run an arbitrary number of virtual servers. A virtual server is an HTTP service running on a specific port, e.g. port 80. In order for the ACS to work, you need to configure a virtual server. Because the process is involved, we have prepared a sample virtual server configuration file.
localhost 127.0.0.1 Once you have
installed a virtual server as described below, you should notify
your sysadmin that you have claimed this IP.
$ cp /tmp/template-ini.ini /home/aol31/service_name.ini
8080 for a first time installation. No other service
uses this port and special access is not required to use it. If
you want to use port 80, please read Appendix B.
| Variable to replace | Target Value |
|---|---|
| service_database_username | service_name |
| service_database_password | database_password |
| AOL_HOME | /home/aol31 |
| service_short_name | service_name |
| service_short_description | a description of your service |
| service_email | the email address of the maintainer |
| ACS_HOME | /web/service_name |
| service_ip_address | your ip address |
| service_ip_name | your dns name |
| service_port | what port to use (80 is standard HTTP port) |
| service_ip_address_ssl | disabled by default |
| service_ip_name_ssl | disabled by default |
| service_port_ssl} | disabled by default |
$ cd /usr/local/aolserver/bin
$ cp /tmp/nsd-oracle.txt ./nsd-oracle
$ chmod 700 /usr/local/aolserver/bin/nsd-oracle
If you deviated from the Oracle installation defaults we specified, edit nsd-oracle as necessary.
$ killall -9 nsd
; Should probably see:
nsd: no process killed
$ /usr/local/aolserver/bin/nsd-oracle -c /home/aol31/servername.ini
Attempt to connect to the service from a web browser as you did in the AOLserver documentation. You should specify a URL like:
http://ip_name:ip_port/
You should see a page that looks like this - if so, go on to the next section.
If you don't see the login page, view your error log (/home/aol31/log/servername-error.log) to make sure the service is starting without any problems. If you need to make changes, don't forget to kill any running servers.
$ killall -9 nsd
Assuming you got your AOLserver up and running previously,
If you can't get to the login page, check for one of the below errors:
Check the log file. Make sure there is a line like:
Notice: nssock: listening on http://localhost.localdomain:8000If you can't find this line, look for a line specifying an error listening to a port. Such errors are caused if another process is listening to that port or if you don't have permission to access the port. Try using another port, perhaps 8086. You specify the port in
/home/aol30/service_name.ini under
[ns/server/service_name/module/nssock] Here is a sample
for a computer programmed to listen to 127.0.0.1:8080. Try replacing
the entries in your file with this one.
[ns/server/service_name/module/nssock] timeout=120 Address=127.0.0.1 Hostname=127.0.0.1 Port=8080
This step should be completed as root. This can break every service on your machine, so proceed with caution.
/usr/local/bin.
$ su - ; Enter root password. # cp /tmp/restart-aolserver.txt /usr/local/bin/restart-aolserver # chown root.web /usr/local/bin/restart-aolserver # chmod 4750 /usr/local/bin/restart-aolserver # ln -s /usr/bin/perl /usr/local/bin/perl # su - nsadmin
$ killall -9 nsd nsd: no process killed $ /usr/local/aolserver/bin/nsd-oracle -c /home/aol31/service_name.ini $ restart-aolserver service_name Killing 23727 23728 23729 23730 $ killall -9 nsd nsd: no process killedThe numbers indicate the process ids (PIDs) of the processes being killed. It is important that no processes are killed by the second call to
killall. If there are processes being killed,
it means that the script is not working.
/etc/inittab for editing.
$ su - ; Enter root password # emacs -nw /etc/inittab
nss:2345:respawn:/usr/local/aolserver/bin/nsd-oracle -i -c /home/aol31/service_name.ini
/etc/inittab.
# killall -9 nsd # /sbin/init q
# restart-aolserver service_name Killing 23750 23753 23754 23756
imp command. These commands can be run from the shell,
you don't need to use sqlplus.
To export:exp service_name/database_password file=foo.dmp consistent=y full=y
To import:
imp service_name/database_password file=foo.dmp [fromuser=olduser touser=service_name]TOP
service_name.ini file in /home/aol30.
Under the [ns/parameters] section, ensure that there is an entry
User=nsadminMoreover, you will need to start the service as root. If you follow the instructions above for automating startup, this will be taken care of, but if you ever start the server from the command line, be sure to su - first.
These steps are required because port 80 is a privileged port. Only certain users can claim it. When you start nsd as root, it obtains the port, and then changes to run as whatever user you specify in the server configuration file. This ensures a high level of security, as the server, once started, is not running as root. This mean that if someone was able to exploit your web server to execute a command on your server, they would not be able to gain root access.
drop user command with the
cascade option. This command will drop the user and
every database object the user owns. drop user service_name cascade;
If this does not work because svrmgrl "cannot drop a user that is currently connected", make sure to kill the AOLserver using this user. If it still does not work, do:
select username, sid, serial# from v$session where username='service_name';
and then
alter system kill session 'sid,serial#';
where sid and serial# are replaced with the corresponding values for the open session.
Use with caution!
If you feel the need to delete everything related to the service, you can also issue the following:
drop tablespace service_name including contents cascade constraints;TOP
While you're working with Oracle, you should configure it to do automatic exports. An export is a separate backup copy of the database. This copy includes all of the database's state at the time that the export was initiated. If your database is corrupted, you can restore from one of these backups (see appendix). You should do this step as root.
$ su -
; Enter root password
# cp /tmp/export-oracle.txt /usr/sbin/export-oracle
# chmod 700 /usr/sbin/export-oracle
/ora8/m02/oracle-exports.
# mkdir /ora8/m02/oracle-exports
# chown oracle.dba /ora8/m02/oracle-exports
# chmod 770 /ora8/m02/oracle-exports
/usr/sbin/export-oracle and change the
SERVICE_NAME and DATABASE_PASSWORD
fields to their correct values. If you want to use a directory
other than /ora8/m02/oracle-exports, you also need to
change the exportdir setting.
Test the export procedure by running the command:
# /usr/sbin/export-oracle
mv: /ora8/m02/oracle-exports/oraexport-service_name.dmp.gz: No such file or directory
Export: Release 8.1.6.1.0 - Production on Sun Jun 11 18:07:45 2000
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Export done in US7ASCII character set and US7ASCII NCHAR character set
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SERVICE_NAME
. exporting object type definitions for user SERVICE_NAME
About to export SERVICE_NAME's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SERVICE_NAME's tables via Conventional Path ...
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
If you don't have any warnings, proceed to automate the backups.
While still root, run the following
command. You can replace the EDITOR="emacs -nw" portion
with whatever editor your prefer, such as EDITOR=vi.
# export EDITOR="emacs -nw"
# crontab -e
Now add the following line on a line by itself
0 23 * * * /usr/sbin/export-oracle
Save the file, exit the editor. Verify that the addition succeeded by checking the output of the following command.
# crontab -l | grep export-oracle
0 23 * * * /usr/sbin/export-oracle
# exit
; Logout
If you see the line, go ahead and log out.
| Previous: Installing AOLserver 3.1 | Installing the ArsDigita Community System v 4.0
part of the ACS Installation Guide | Next: Acceptance Tests |