Nagios webconf - Web directory - webserver

I'm following this guide.
I'm launching:
make install-webconf
The problem is that I already have Apache2 installed in /etc/apache2 directory, but thee Nagios installer looks for /etc/httpd ..
How can I resolve it?
As newbie, I tried to change the path in Makefile, but it doesn't work.

Back before web install section in the guide, it showed a 'configure' command. If you type './configure --help', you will see in the output:
--with-httpd-conf=<path_to_conf>
sets path to Apache conf.d directory
That configure option can be used to change your path to /etc/apache2, with something like:
./configure --with-httpd-conf=/etc/apache2/conf.d

Related

Could not load the Tomcat server configuration at /usr/share/tomcat9/conf. The configuration may be corrupt or incomplete

I am using JSP for the 1st time. I am using tomcat9. While creating server, from eclipse, I get a window which shows Could not load the Tomcat server configuration at /usr/share/tomcat9/conf. The configuration may be corrupt or incomplete. Attached is the screenshot.
I installed 2 versions of tomcat9, but the error still remains.
Don't use an installed copy of Tomcat, its layout will have been modified and you won't have full read-write control over it. Use the tar/zip file you can download from tomcat.apache.org.
On Linux ubuntu, I went to the directory-> /usr/share/tomcat9/ by
cd /usr/share/tomcat9/
but conf folder is not there
My default installation path was /opt/tomcat/latest/
conf folder is inside that
So, I created a symbolic link from /usr/share/tomcat9/ to /opt/tomcat/latest/conf
I did cd /usr/share/tomcat9/
Then
sudo ln -s /opt/tomcat/latest/conf conf
Now everything worked and I can run helloworld program
To help others facing same problem->
Just find the conf folder and create a link to that folder
In windows create a shortcut; and in linux create a symbolink link.
In Linux:
sudo locate tomcat>>a.txt
vi a.txt
then search for conf in a.txt
/conf
identify a line containing both tomcat and conf
Find the location where system is searching for conf, in the error message.
For me, it was /usr/share/tomcat9/
Then link both the folders by creating symbolic link using ln -s command

Setting up Zend Framework CLI tool on OS X 10.7 Lion

I have been fighting to set up Zend Framework's CLI tool on OS X for ages. I have followed the manual, but I can't get it to work.
The most common setup in the *nix environment, is to copy the zf.sh
and zf.php into the same directory as your PHP binary.
[...]
To find out the location of your PHP binary, you can execute 'which
php' on the command line. This will return the location of the PHP
binary you will be using to run PHP scripts in this environment.
When I do this, it says /usr/bin/php. So, I have put zf.sh and zf.php into /usr/bin.
Now, the next step is where I get really confused.
The next order of business is to ensure that Zend Framework library is
set up correctly inside of the system PHP include_path. To find out
where your include_path is located, you can execute php -i and look
for the include_path variable, or more succinctly, execute php -i |
grep include_path. Once you have found where your include_path is
located (this will generally be something like /usr/lib/php,
/usr/share/php, /usr/local/lib/php, or similar), ensure that the
contents of the /library/ directory are put inside your include_path
specified directory.
Running php -i | grep include_path returns include_path => .: => .:, which I am not really sure what means (I am new to *nix). I have tried to copy the contents of the library folder to /usr/share/php/, but without luck.
So I guess my problem is figuring out where my include path is so I can put the contents of the library folder there. I figured I would find my php.ini. When I run phpinfo() from a script, it says that my php.ini is located at /etc, but there is no php.ini in that folder. Also, executing php -i shows the following:
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)
I guess my PHP is running with default settings since no config file is loaded. I am testing from the terminal with zf show version and get -bash: zf: command not found.
I am really, really confused!
I had similar problems once. If i remember correctly i was using WAMP and it had multiple php.ini files (3 i think), i had to track down the right one.
i followed this tutorial and it worked for me
http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework.pdf
hope it helps

Install with pecl to local dir on shared hosting

I'd like to install a PHP extension on a bluehost shared site; specifically the MongoDB driver. Since pecl is unable to write to the primary server directory that has all the installed extensions, I'd like to install the mongo.so file to a directory I specify under my home. The closest article I found on the web was:
http://www.site5.com/blog/programming/php/how-to-setup-your-own-php-pear-environment/20090624/
However, after following the steps when I use the "pecl install mongo" command, it still keeps trying to install to bluehost's central directory on the server.
According to my web host's technical support team, utilising the pecl installer attempts to install the extension server-wide rather than under your account only. My web host doesn't allow server-wide installations in their shared environment for security reasons and because they want to keep their fleet universally the same across the board. I suspect your host is the same.
However, they did suggest I download, configure and install the pecl package (pecl_http) in my account only (rather than server-wide) via the following manual process:
$ cd ~/
$ wget http://pecl.php.net/get/pecl_http
$ tar -zxvf pecl_http.tar.gz
$ cd pecl_http
$ phpize
$ ./configure --prefix=~/bin
$ make
$ make test
$ make install
A successful install will have created extname.so and put it into the
PHP extensions directory. You'll need to edit php.ini (in my case,
this was a copy of the standard php.ini file that I placed in the same
folder as the script using the extension) and add an
extension=extname.so line (in my case, extension=http.so) before you can use the extension.
http://www.php.net/manual/en/install.pecl.phpize.php
Note that the tilde character (~) in the above code refers to the home directory of the current user (e.g. /home/username on my host's server).
Issues you may run into
When using the tar command, a "cannot open: not a directory" error
appeared as pecl_http had been downloaded without a file extension.
This was easily corrected:
mv pecl_http pecl_http.tar.gz
When using the make install command, a "cp: cannot create regular
file...: Permission denied" errror appeared. I resolved this issue
by changing the ext_dir for pecl...
pecl config-set ext_dir /home/username/bin/extensions
...and re-running make install. I also had to copy the http.so extension to /home/username/bin/extensions and then reference that location in my php.ini file:
extension_dir = "/home/username/bin/extensions"
this sounds like you don't have root access to your server. if your need to compile anything you must be have root access permission to server, or maybe you must be one of the sudoers.

Where do I get libpq source?

I want to write application which uses Postgresql as DBMS.
To write client application do I need libpq library and header files?
If yes where I would get libpq library and header files.
Libpq is included in the full PostgreSQL source code. You can use just libpq without the rest of PostgreSQL, but must download the full package.
You can download it from the PostgreSQL Downloads page.
Once you extract the full package it is inside src\interfaces\libpq.
The PostgreSQL installation guide details how to install only the client libraries in the Installation section, under Client-only installation.
Libpq documentation is also available.
In postgresql sources, src\interfaces\libpq.
And yes, it is possible to compile only the libpq.
get the lipq from repo, {for debian} :
sudo apt-get install libpq-dev
I was also facing this issue but didn't got a clear answer:
This issue clearly states that while installing diesel-cli system is not able to locate libpq.lib
First of all you should have a Postgres installed on your machine.
Also diesel require visual c++, thus download and install it if not already, the size of setup will be ~5gb.
Once above installations are done you need to setup environment variables:
In my case path of Postgres installation is C:\Program Files\PostgreSQL thus add 2 environment variable path under User variables add new in Path where your libpq.lib is located in my case it is available in both C:\Program Files\PostgreSQL\12\lib and C:\Program Files\PostgreSQL\12\bin
Once this is added create one more environment variable PQ_LIB_DIR and set path as shown below
Note: Once done re-trigger the installation command in a new cmd window
Source: pq-sys and github-solution
For Windows users, it's in (version may be different)
C:\Program Files\PostgreSQL\11\lib
There you find libpq.lib. Provide this directory to Linker input.
Don't forget to include C:\Program Files\PostgreSQL\11\include directory for include directories.
I fix this problem reccently. This is a solution if you don't want to install Postgres in you windows.
At first, you need download Postgres Binaries. The version I download is 13.6, but it's seems like any version is fine.
Unzip the zip file.Copy libpq.lib from pgsql\lib to shomewhere like C:\Program Files\Postgres\lib.
Execute the following command in cmd window.
setx PQ_LIB_DIR "{where_you_copy_to}"
Open a new cmd windows and install diesel_cli
cargo install diesel_cli --no-default-features --features postgres
In linux vertify you get the libpq.
1st, there is an app: pg_config: https://www.postgresql.org/docs/current/app-pgconfig.html
after you found out the pg_config absolute bin path.(if you installed multi version of postgressql) Then You can get
--includedir
Print the location of C header files of the client interfaces.
--libdir
Print the location of object code libraries.
Then try to compile/build some example code: https://www.postgresql.org/docs/current/libpq-example.html
Some common failure example: https://www.postgresql.org/docs/current/libpq-build.html
You can install Postgres locally from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads but select only "Command line tools" for install.
After that, you can found libpq.dll in C:\Program Files\PostgreSQL\15\bin

Simple Unix question - Configure

I'm using Solaris 10, ksh. Whenever I do a ./configure, I get the error "ksh: ./configure: not found"
When I do a "where configure", nothing is found.
How do I "install configure"?
./configure means that you want to run an executable called configure in your current directory (signified by a .). I'm guessing you're trying to build and install from source, and the directions say to do the standard ./configure; make; make install. You should do that from the top-level directory of the source you downloaded and unpacked:
$ cd /path/to/source
$ ./configure
$ make
$ make install
"./configure" means "run the program configure from the current directory". That is, you need to cd to the directory that configure lives in before attempting to run it like that.
As for where configure might be found, it's usually at the root of whatever source package you're trying to build.
I'm not a Solaris guy, but the configure script should be within your current directory before you execute it. I am assuming you're trying to build something. If it's a project of your own, take a look at GNU autoconf. (I have no idea if this a part of Solaris or not.) It's part of M4.
If it's a project that you downloaded, untar/unzip/unpack it and then cd to its directory before running the configure script.
I had to run a command for another directory; and then that popped everything up :)
In case someone else comes across this specific issue, I'm trying to install the Perl-Php plugin on a Solaris machine. Initially, there is no configure file; instead you have to find where your "phpize" is located -- for me it was /opt/webstack/php/5.2/phpize, run it while you are still in the "perl-php-plugin" folder, and then configure will appear.
Then you can ./configure :)
Thanks to everyone who responded.