HP-UX Directory Server 8.1 administration server guide

2.4.4 Changing the log location in the command line
The access and error log files' names and locations can be changed to rotate the files. This rotation
has to be done manually to create new files if the existing log files become too large. The location
can be changed if the default location in /var/opt/dirsrv/admin-serv/log does not meet
the application needs.
The Admin Server configuration is stored in two locations. The main entry is an LDAP entry in
the Configuration Directory Server's o=NetscapeRoot database. The other is the console.conf
file. Changing the log settings requires changing both settings.
1. Edit the Admin Server configuration entry in the Configuration Directory Server.
a. Get the name of the Admin Server entry. Because the Admin Server entry has a special
object class, nsAdminConfig, it is possible to search for the entry using that object
class to retrieve the DN.
ldapsearch -D "cn=directory manager" -w secret -p 389 -h server.example.com \
-b "o=NetscapeRoot" "(objectclass=nsAdminConfig)" dn
version:1
dn: cn=configuration, cn=admin-serv-example, cn=HPDS Administration
Server, cn=Server Group, cn=server.example.com, ou=example.com,
o=NetscapeRoot
b. The Admin Server entry can be edited using ldapmodify. The access and error log
settings are stored in the nsAccessLogs and nsErrorLogs attributes, respectively.
For example:
ldapmodify -D "cn=directory manager" -w secret -p 389 -h server.example.com
dn: cn=configuration, cn=admin-serv-example, cn=HPDS Administration
Server, cn=Server Group, cn=server.example.com, ou=example.com,
o=NetscapeRoot
changetype:modify
replace:nsAccessLog
nsAccessLog:/var/opt/dirsrv/admin-serv/log/access_new
Click Enter twice to submit the operation, then Control-C to close ldapmodify.
2. Open the Admin Server configuration directory.
cd /etc/opt/dirsrv/admin-serv
3. Edit the console.conf file. For the access log, edit the path and file name in the CustomLog
parameter. For the error log, edit the path and file name in the ErrorLog parameter.
CustomLog /var/opt/dirsrv/admin-serv/log/access_new common
ErrorLog /var/opt/dirsrv/admin-serv/log/error_new
Leave the term common after the access log path; this means that the access log is in the
Common Log Format.
4. Restart the Admin Server.
/opt/dirsrv/sbin/restart-ds-admin
2.5 Changing the port number
The port number specifies where an instance of Admin Server listens for messages.
The default port number for Admin Server is set when the instance is first installed and the
configuration script, such as setup-ds-admin.pl, is run. The default port number is 9830,
although if that number is in use, then the setup program will use a randomly-generated number
larger than 1024 or one can assign any port number between 1025 and 65535.
2.5.1 Changing the port number in the console
1. Open the Admin Server management window.
2. Click the Configuration tab.
2.5 Changing the port number 13