Brave New Things
exploring the ebb and flow of technology one whim at a time with Josh Barto n...
Thursday, June 25, 2015
Wednesday, June 4, 2014
This is going to be a short post. I am working on altering a script so that postgres will store it's log in /var/postgres/931 instead of /var/postgres/931/data. When you set up SMF so that postgres may be started as a service, the log directory does not allow full paths. Clearly the only solution to this was to usea symbolic link. Ok... so if I plan on using this script for future version of postgres how do I get the data dir path for postgres. That solution was fun to work on as it taught me more than I really wanted to know about sed (stream editor). The command is as follows:
There isn't much to this, just a regex that gets everything in between -D and -i after output from ps has been piped in showing the paths that postgres was started with.
Enjoy!
root@mymachine:~# ps auxw | grep postgres | sed -r 's/.* (-D) (.*) ?(-i)/\2/' | head -n1
/var/postgres/84/data
/var/postgres/84/data
There isn't much to this, just a regex that gets everything in between -D and -i after output from ps has been piped in showing the paths that postgres was started with.
Enjoy!
Wednesday, March 26, 2014
CGI in an AOLServer World
Some
assumptions, if you are hoping to get the same results I did
- You are running at least version 4.5.1 of Aolserver
- Running at least postgres 9.3.1
- Have perl installed
ns_section
"ns/server/${server}/module/nscgi"
ns_param Map "GET /cgi-bin ${serverroot}/cgi-bin"
ns_param Map "POST /cgi-bin ${serverroot}/cgi-bin"
ns_param Interps CGIinterps
ns_section
"ns/interps/CGIinterps"
ns_param .pl "/usr/bin/perl"
You will also
want to ensure that the following line is uncommented in your nsd.tcl file:
ns_param
nscgi
${bindir}/nscgi.so
It is very
important that you:
- capitalize the word "Map" in the "ns_param Map" section
- that the cgi-bin mapping whatever you decide to call it, not have a trailing '/'.
If you still
have problems getting it to work, try changing the path from a dynamic path
like
"${serverroot}/cgi-bin" to a static path.
"${serverroot}/cgi-bin" to a static path.
This solved my problems, and awstats has been working great, feel free to shoot me a comment if you feel this posting is incomplete.
Subscribe to:
Comments (Atom)