np-setup errors

Le Dang Khoa <kenji_le-/[email protected]> Sun, 1 May 2005 23:54:18 -0700 (PDT)
Newsgroups gmane.network.net-policy.user
Message-ID <[email protected]>
--0-355666511-1115016858=:40657
Content-Type: multipart/alternative; boundary="0-1937664529-1115016858=:40657"

--0-1937664529-1115016858=:40657
Content-Type: text/plain; charset=us-ascii


Dear Wes,

After the failure, I decided to reinstall net-policy and its pre-requisite packages. However, there are still some errors that I want to ask you about.

My detailed installation process is shown in the install_log file attached with the mail. 

Here is my database creating process:

# Initialize database , superuser = "postgresql" , passphrase = "gcsvn123"

$ /usr/local/pgsql/bin/initdb -U postgresql -W -D /usr/local/pgsql/data

# Create user "sqluser" , passphrase = "sqlpass"

$ /usr/local/pgsql/bin/createuser --no-adduser --createdb --pwprompt -h 127.0.0.1 sqluser

# Create 3 databases test, netpolicy, sqluser (owner = sqluser)

$ /usr/local/pgsql/bin/createdb --owner=sqluser -h 127.0.0.1 test

$ /usr/local/pgsql/bin/createdb --owner=sqluser -h 127.0.0.1 netpolicy

$ /usr/local/pgsql/bin/createdb --owner=sqluser -h 127.0.0.1 sqluser

Here are the error messages when I run np-setup:

# np-setup -u sqluser -p sqlpass 

DBD::Pg::db do failed: ERROR: relation "usmclientinfo" already exists

command error: create table usmClientInfo (

id serial primary key,

clientid integer references clients(id),

initUserName varchar (64),

initUserAuthProto varchar (64),

initUserAuthPass varchar (64),

initUserPrivProto varchar (64),

initUserPrivPass varchar (64))

DBD::Pg::db do failed: execute called with an unbound placeholder at /usr/local/

bin/np-setup line 529.

DBD::Pg::db do failed: ERROR: permission denied for language c

DBD::Pg::db do failed: ERROR: permission denied for language c

DBD::Pg::db do failed: ERROR: permission denied for language c

When I start net-policy, it's OK:

# service net-policy start

Starting np-distd: [ OK ]

Starting np-datad: [ OK ]

Starting np-collectd-perl: [ OK ]

But when I run https://127.0.0.1/net-policy, I received this error message:

"Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.33 Server at 127.0.0.1 Port 443"

And when I stop net-policy, it's failed:

# service net-policy stop

Shutting down np-distd: [FAILED]

Shutting down np-datad: [FAILED]

Shutting down np-collectd-perl: [FAILED]

Please tell me how to overcome these problems.

 

Best regards,

Kenji Le

Global Cybersoft Vietnam



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--0-1937664529-1115016858=:40657
Content-Type: text/html; charset=us-ascii

<DIV>
<DIV><FONT size=2>
<P>Dear Wes,</P>
<P>After the failure, I decided to reinstall net-policy and its pre-requisite packages. However, there are still some errors that I want to ask you about.</P></FONT><FONT face="Courier New" size=2>
<P>My detailed installation process is shown in the install_log file attached with the mail. </P>
<P><STRONG>Here is my database creating process:</STRONG></P></FONT><FONT size=2>
<P># Initialize database , superuser = "postgresql" , passphrase = "gcsvn123"</P>
<P>$ /usr/local/pgsql/bin/initdb -U postgresql -W -D /usr/local/pgsql/data</P>
<P># Create user "sqluser" , passphrase = "sqlpass"</P>
<P>$ /usr/local/pgsql/bin/createuser --no-adduser --createdb --pwprompt -h 127.0.0.1 sqluser</P>
<P># Create 3 databases test, netpolicy, sqluser (owner = sqluser)</P>
<P>$ /usr/local/pgsql/bin/createdb --owner=sqluser -h 127.0.0.1 test</P>
<P>$ /usr/local/pgsql/bin/createdb --owner=sqluser -h 127.0.0.1 netpolicy</P>
<P>$ /usr/local/pgsql/bin/createdb --owner=sqluser -h 127.0.0.1 sqluser</P>
<P><STRONG>Here are the error messages when I run np-setup:</STRONG></P>
<P># np-setup -u sqluser -p sqlpass </P>
<P>DBD::Pg::db do failed: ERROR: relation "usmclientinfo" already exists</P>
<P>command error: create table usmClientInfo (</P>
<P>id serial primary key,</P>
<P>clientid integer references clients(id),</P>
<P>initUserName varchar (64),</P>
<P>initUserAuthProto varchar (64),</P>
<P>initUserAuthPass varchar (64),</P>
<P>initUserPrivProto varchar (64),</P>
<P>initUserPrivPass varchar (64))</P>
<P>DBD::Pg::db do failed: execute called with an unbound placeholder at /usr/local/</P>
<P>bin/np-setup line 529.</P>
<P>DBD::Pg::db do failed: ERROR: permission denied for language c</P>
<P>DBD::Pg::db do failed: ERROR: permission denied for language c</P>
<P>DBD::Pg::db do failed: ERROR: permission denied for language c</P>
<P><STRONG>When I start net-policy, it's OK:</STRONG></P>
<P># service net-policy start</P>
<P>Starting np-distd: [ OK ]</P>
<P>Starting np-datad: [ OK ]</P>
<P>Starting np-collectd-perl: [ OK ]</P>
<P><STRONG>But when I run https://127.0.0.1/net-policy, I received this error message:</STRONG></P>
<P>"Internal Server Error</P>
<P>The server encountered an internal error or misconfiguration and was unable to complete your request.</P>
<P>Please contact the server administrator, root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.</P>
<P>More information about this error may be available in the server error log.</P>
<P>Apache/1.3.33 Server at 127.0.0.1 Port 443"</P>
<P><STRONG>And when I stop net-policy, it's failed:</STRONG></P>
<P># service net-policy stop</P>
<P>Shutting down np-distd: [FAILED]</P>
<P>Shutting down np-datad: [FAILED]</P>
<P>Shutting down np-collectd-perl: [FAILED]</P>
<P><STRONG>Please tell me how to overcome these problems.</STRONG></P>
<P>&nbsp;</P>
<P>Best regards,</P>
<P>Kenji Le</P>
<P>Global Cybersoft Vietnam</P></FONT></DIV></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com <p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com 
--0-1937664529-1115016858=:40657--
--0-355666511-1115016858=:40657
Content-Type: text/richtext; name="install_log.rtf"
Content-Description: install_log.rtf
Content-Disposition: inline; filename="install_log.rtf"

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fmodern\fprq1\fcharset0 Courier New;}{\f1\fnil\fcharset0 Courier New;}{\f2\fswiss\fcharset0 Arial;}}
{\colortbl ;\red0\green0\blue0;}
{\*\generator Msftedit 5.41.15.1503;}\viewkind4\uc1\pard\cf1\b\f0\fs20 0/ Add /usr/local/lib to /etc/ld.so.conf (OK)\par
\cf0\b0\f1\par
# vi /etc/ld.so.conf\par
\tab add    /usr/local/lib\par
# ldconfig\par
\par
---------------------------------------------------------------------------------------------\par
\b I/  Install lates iptables  (version 1.3.1)\par
\b0  \par
# tar jxvf iptables-1.3.1.tar.tar\par
# make KERNEL_DIR=/usr/src/linux-2.4\par
# make install KERNEL_DIR=/usr/src/linux-2.4\par
   Remember source dir of iptables after extracting tar file . For example : the directory is\par
   /root/source/iptables-1.3.1\par
# ldconfig\par
\par
---------------------------------------------------------------------------------------------\par
\b II/   Install Postgresql\par
\b0\par
# mkdir /usr/local/pgsql\par
$ ./configure --prefix=/usr/local/pgsql\par
$ gmake\par
$ su\par
# gmake install\par
# adduser postgresql\par
# mkdir /usr/local/pgsql/data\par
# chown postgresql /usr/local/pgsql/data\par
# su - postgresql\par
# Note : config file "/usr/local/pgsql/data/pg_hba.conf"\par
# For more pgsql <command> help , use command :\par
$ /usr/local/pgsql/bin/<command> --help\par
\b # Initialize database , superuser = "postgresql" , passphrase = "gcsvn123"\par
$ /usr/local/pgsql/bin/initdb -U postgresql -W -D /usr/local/pgsql/data  (Passphrase = "gcsvn123")\par
\b0 # Modify pg_hba.conf for accept 127.0.0.1\par
$ vi /usr/local/pgsql/data/pg_hba.conf\par
        Add followed line after "IPv4 Connection" :\par
        host    all         all         127.0.0.1/32     trust\par
# Start postmaster in host 127.0.0.1 , enable TCP/IP connection (-i)\par
$ /usr/local/pgsql/bin/postmaster -h 127.0.0.1 -i -D /usr/local/pgsql/data &\par
\b # Create user "sqluser" , passphrase = "sqlpass"\par
$ /usr/local/pgsql/bin/createuser --no-adduser --createdb --pwprompt -h 127.0.0.1 sqluser  (passphrase = sqlpass)\par
# Create 3 databases test, netpolicy, sqluser (owner = sqluser)\par
$ /usr/local/pgsql/bin/createdb --owner=sqluser -h 127.0.0.1 test (netpolicy , sqluser)\par
\b0\par
\par
# /usr/local/pgsql/bin/psql -h 127.0.0.1 -U sqluser test  (Connect Database)\par
# vi /etc/profile\par
        Modify : add /usr/local/pgsql/bin to PATH env var\par
# . /etc/profile\par
 Add /usr/local/pgsql/lib to /etc/ld.so.conf\par
# ldconfig\par
----------------------------------------------------------------------------------------------------------------------\par
\b III/     Install unixODBC 2.2.6 (PREFIX == /usr/local)\par
\b0\par
# ./configure\par
# make\par
# make install\par
# ldconfig\par
--------------------------------------------------------------------------------------------------------------------\par
\b IV/  Install libodbc++ 0.2.3 (PREFIX == /usr/local)\par
\b0                                                                                                                              \par
# ./configure --enable-threads\par
# make\par
# make install\par
# ldconfig\par
\par
---------------------------------------------------------------------------------------------------------------------\par
\b V/  Configure ODBC  ( installed in III and IV )\par
\b0\par
# vi /etc/odbcinst.ini\par
          Modify as followed\par
   [NetPolicyPg]\par
   Description    =     The Net-Policy database\par
   Driver         =     /usr/local/lib/libodbcpsql.so\par
   Setup          =     /usr/local/lib/libodbcpsqlS.so\par
   FileUsage      =     1\par
   ReadOnly       =     No\par
   ...\par
   <Other information related>\par
   ...\par
   More Specifically\par
   Postgres ODBC driver :\par
   name:     NetPolicyPg\par
   description: < The descriptions needed for usage >\par
   driver:  /usr/local/lib/libodbcpsql.so\par
   Setup: /usr/local/lib/libodbcpsqlS.so\par
   FileUsage: 1  (default)\par
   CPTimeout: <leave blank> (CPTimeout =)\par
   CPReuse: <leave blank>   (CPReuse = )\par
   EXAMPLE\par
        [PostgreSQL]\par
        Description     = ODBC for PostgreSQL\par
        Driver          = /usr/local/lib/libodbcpsql.so\par
        Setup           = /usr/local/lib/libodbcpsqlS.so\par
        FileUsage       = 1\par
\par
--------------------------------------------------------------------------------------------------------------------\par
\b VI/ Install libpqxx-2.5.0.tar.gz (PREFIX == /usr/local) (NOT NEEDED)\par
\b0\par
# ./configure\par
# make\par
# make check (optional)\par
# make install\par
# ldconfig\par
\par
-------------------------------------------------------------------------------------------------------------------\par
\b VII/  Install psqlodbc-08.00.0100.tar.gz  (PREFIX == /usr/local) (NOT NEEDED)\par
\b0\par
See INSTALL and README files\par
\par
-------------------------------------------------------------------------------------------------------------------\par
\b VIII/   Install stable.tar.gz  (PREFIX == /usr/local) (TRY NOT INSTALL)\par
\b0\par
See INSTALL and README files\par
# rm -f config.sh Policy.sh\par
# sh Configure -de\par
# make\par
# make test\par
# make install\par
\par
Add /usr/local/lib/perl5/5.8.6\par
# ldconfig\par
\par
-----------------------------------------------------------------------------------------------------------------\par
\b IX/  Install httpd 1.3.33 with mod_ssl and mod_perl \par
\b0\par
\b 1/ openssl 0.9.7g.tar.gz (PREFIX == /usr/local/ssl)\par
\b0\par
# ./Configure\par
# make\par
# make test\par
# make install\par
Add /usr/local/ssl/bin to ~/.bash_profile\par
# . ~/.bash_profile\par
Add /usr/local/ssl/lib to /etc/ld.so.conf\par
# ldconfig\par
\par
\b 2/ mod_ssl 2.8.22-1.3.33.tar.gz\par
\b0\par
# mkdir /usr/local/apache\par
# ./configure --with-apache=/root/source/apache_1.3.33 --with-ssl=/root/source/openssl-0.9.7g --prefix=/usr/local/apache --enable-module=ssl --enable-module=all --enable-shared=max --enable-rule=EAPI\par
# cd to apache 1.3.33 source\par
\par
\b 3/ apache 1.3.33\par
\b0\par
# make\par
 make certificate ("NOT use")\par
# make install\par
\par
\b 4/ mod_perl 1.29.tar.gz\par
\b0\par
# perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs EVERYTHING=1\par
# make\par
# make install\par
\par
Creat SSL Certificate (Not needed if run  "make certificate" in apache 1.3.33)\par
\par
# cd \par
# /usr/local/ssl/bin/openssl genrsa -des3 -out server.key 1024      (Pass : gcsvn123)\par
# /usr/local/ssl/bin/openssl rsa -in server.key -out server.pem\par
# /usr/local/ssl/bin/openssl req -new -key server.key -out server.csr\par
# /usr/local/ssl/bin/openssl x509 -req -days 300 -in server.csr -signkey server.key -out server.crt\par
# mkdir /usr/local/apache/conf/ssl.crt\par
# cp server.crt /usr/local/apache/conf/ssl.crt/server.crt\par
# mkdir /usr/local/apache/conf/ssl.key\par
# cp server.key /usr/local/apache/conf/ssl.key/server.key\par
Modify httpd\par
# vi /usr/local/apache/conf/httpd.conf  (or ssl.conf)\par
    Modify  : ServerName  127.0.0.1\par
\par
# vi .bash_profile\par
    Modify  : add /usr/local/apache/bin to PATH\par
# . .bash_profile   // Update env var in .bash_profile\par
Start httpd\par
# /usr/local/apache/bin/apachectl startssl\par
\par
Modify httpd.conf (if possible)\par
From\par
<IfDefine SSL>\par
LoadModule ssl_module         libexec/libssl.so\par
LoadModule perl_module        libexec/libperl.so\par
</IfDefine>\par
To\par
<IfDefine SSL>\par
LoadModule ssl_module         libexec/libssl.so\par
</IfDefine>\par
LoadModule perl_module        libexec/libperl.so\par
\par
From\par
<IfDefine SSL>\par
AddModule mod_ssl.c\par
AddModule mod_perl.c\par
</IfDefine>\par
To\par
<IfDefine SSL>\par
AddModule mod_ssl.c\par
</IfDefine>\par
AddModule mod_perl.c\par
\par
Check existing of these lines\par
<IfDefine SSL>\par
Listen 80\par
Listen 443\par
</IfDefine>\par
\par
----------------------------------------------------------------------------------------------\par
\b X/  Install followed Perl modules : (Using source packages) (OK)\par
\b0\par
"Script*" :\par
# perl Makefile.PL\par
# make\par
# make test\par
# make install\par
\par
\b 1. DBI-1.48.tar.gz (DBI)\par
\b0\par
Install as "Script*"\par
\par
\b 2. Apache-DBI-0.92.tar.gz (Apache::DBI)\par
\b0\par
# perl Makefile.PL\par
# make\par
(  make test : only works with MySQL so far; patches welcome )\par
# make install\par
\par
\b 3. DBD-Pg-1.41.tar.gz (DBD::Pg)\par
\b0\par
# export POSTGRES_LIB="/usr/local/pgsql/lib -lssl"\par
Install as "Script*"\par
When testing ... \par
The tests are designed to connect to a live database.  The following\par
environment variables must be set for the tests to run:\par
                                                                                                    \par
        DBI_DSN=dbi:Pg:dbname=<database>\par
        DBI_USER=<username>\par
        DBI_PASS=<password>\par
\par
\b 4. DBD-File-0.22.tar.gz (DBD::File)\par
\b0\par
Install as "Script*"\par
\par
\b 5. CGI.pm-3.08.tar.gz\par
\b0\par
Install as "Script*"\par
\par
\b 6. Install Tk (http://cpan.linuxforum.net/authors/id/N/NI/NI-S/Tk-804.027.tar.gz) (NOT NEEDED)\par
\b0\par
Install as "Script*"\par
# export LANG=en_GB.UTF-8\par
# perl Makefile.PL          # normal build\par
# make\par
# make test\par
# make install\par
\par
\b 7. Run ldconfig\par
\b0\par
A. Using CPAN  \par
\par
# perl -MCPAN -e shell\par
# cpan> o conf prerequisites_policy ask\par
:: Choose ftp and/or http site\par
# cpan> install mod_perl\par
# cpan> install DBI\par
# cpan> install Apache::DBI\par
# cpan> install DBD::Pg\par
# cpan> install DBD::File\par
# cpan> install CGI\par
# cpan> install Tk (Optional)\par
\par
B. Using source packages\par
\par
http://cpan.linuxforum.net/authors/id/N/NI/NI-S/Tk-804.027.tar.gz\par
--------------------------------------------------------------------------------------------\par
\b XI/  Install libsmi 0.4.2  (PREFIX == /usr/local) (OK)\par
\b0\par
# ./configure\par
# make\par
# make install\par
# ldconfig\par
\par
--------------------------------------------------------------------------------------------\par
\b XII/ Install openSNMP 0.4.0 (PREFIX == /usr/local) (OK)\par
\b0\par
# ./configure\par
# make \par
# make install\par
# ldconfig\par
\par
---------------------------------------------------------------------------------------------\par
\b XIII/ Install netSNMP 5.2.1 (PREFIX == /usr/local) (OK)\par
\b0\par
# ./configure --with-perl-modules --enable-embedded-perl --enable-shared\par
   Answer config as follow :\par
\tab SNMP version          3\par
\tab Contact               root-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]\par
\tab System location       Unknown\par
        logfile               /var/log/snmpd.log\par
\tab persistent info       /var/net-snmp\par
# make\par
# make install\par
# ldconfig\par
\par
\b ***Create snmp user and configure it***\par
\b0 # net-snmp-config --create-snmpv3-user\par
name:  MD5User\par
passwd: The Net-SNMP Demo Password     (The passwd is auto encrypted)\par
# vi /var/net-snmp/snmpd.conf (/usr/local/share/snmp/snmpd.conf)\par
Them vao dong (Optional)\par
defContext none\par
defSecurityName MD5User\par
defAuthPassphrase The Net-SNMP Demo Password\par
defVersion 3\par
defAuthType MD5\par
defSecurityLevel authNoPriv\par
                                                                                \par
# /usr/local/sbin/snmpd -c /var/net-snmp/snmpd.conf\par
# snmpgetnext -v 3 -n "" -u MD5User -a MD5 -A "The Net-SNMP Demo Password" -l authNoPriv 127.0.0.1 sysUpTime\par
\par
---------------------------------------------------------------------------------------------\par
\b XIV/  Install net-policy manager (version 2.0)  (PREFIX == /usr/local)\par
\b0\par
# ./configure --with-sqluser=sqluser --with-sqlpassword=sqlpass --with-pgsql-includedir-server=/usr/local/pgsql/include/server\par
# make\par
# make install \par
\par
\par
--------------------------------------------------------------------------------------------\par
\f2\par
}

--0-355666511-1115016858=:40657--


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20