Jboss run with sudo - jvm

I'm trying to run JBoss with sudo under certain configuration. I type: sudo jboss config.
And get the following result: path-to-jboss/bin/run.sh: 255: java: not found
I think it could be a JVM installation issue, but not sure.

It looks like sudo is changing your $PATH, so that the java executable can no longer be found. See this question for some possible reasons why.

Related

How to resolve Failed running '/usr/lib/pkgconfig/../../bin/mod-mono-server2 --filename /tmp/mod_mono_server_global --nonstop --master

I'm trying to get mod_mono working on CentOS 6.5. I have many failed attempts where either something does not compile at all or fails when trying to run a website. I've tried both latest from git, tarball from git releases, and tarballs of different versions from http://download.mono-project.com/sources/mono/. All fail in one way or another.
So far the "most" working solution I've found is to download this: http://download.pokorra.de/mono/tarballs/mono-3.2.6.tar.bz2 and use latest xsp and mod_mono from under mono-project site.
Problem is even though mod_mono installation went ok, i get this in httpd/error_log:
[error] Failed running '/usr/lib/pkgconfig/../../bin/mod-mono-server2 --filename /tmp/mod_mono_server_global --nonstop --master (null) (null) (null) (null) (null) (null) (null) (null)'. Reason: No such file or directory
So mod_mono does not run. What could be causing this? There are no errors in make or make install output.
Most importantly:
locate mod-mono-server
/usr/local/src/xsp-3.0.11/man/mod-mono-server.1
/usr/local/src/xsp-3.0.11/scripts/mod-mono-server
/usr/local/src/xsp-3.0.11/scripts/mod-mono-server2
/usr/local/src/xsp-3.0.11/scripts/mod-mono-server4
/usr/local/src/xsp-3.0.11/src/Mono.WebServer.Apache/mod-mono-server2.exe
/usr/local/src/xsp-3.0.11/src/Mono.WebServer.Apache/mod-mono-server2.exe.mdb
/usr/local/src/xsp-3.0.11/src/Mono.WebServer.Apache/mod-mono-server4.exe
/usr/local/src/xsp-3.0.11/src/Mono.WebServer.Apache/mod-mono-server4.exe.mdb
/usr/local/src/xsp-3.0.11/test/mod-mono-server.exe.config
/usr/share/man/man1/mod-mono-server.1
There are no mod-mono-servers anywhere else except under sources.
Mono itself is fine, I can run a small console application using mono mytestapp.exe.
I installed mod_mono (like mono and xsp) using prefix /usr:
./configure --prefix=/usr
make && make install
I can see mod_mono.conf generated correctly.
Please forgive me if this is really a hilariously silly question, but what's going on? I would have expected to see something under /usr/bin and /usr/lib but there's nothing even though mod_mono installs without errors.
Edit: Just a side note, as opposed to some other installation, xsp runs fine. With other mono installations I had exceptions in the xsp output.
Most likely, you are trying to run /usr/bin/mod-mono-server2, which most likely does not exist, rather than /usr/bin/mod-mono-server4.
The solution which I just tested is to
sudo apt-get update followed sudo apt-get install mono-apache-server4
create a symbolic link from /usr/bin/mod-mono-server2 to
/usr/bin/mod-mono-server4 like this:
sudo ln -s mod-mono-server4 mod-mono-server2

(httpd) Getting some problems with Mod_security Installation

I'm using Webuzo on my first unmanaged VPS (CentOS 6.4,OpenVZ). I tried to install Mod_Security following this guide. I installed Modsecurity-apache_2.6.6 but there's a problem in Step3 that prevents me from installing OWASP Mod_Security Core Rule Set
wget http://www.modsecurity.org/download/modsecurity-apache_2.6.6.tar.gz
The Download address has been removed. So I found another guide for the rule set but I can't get this command to work
git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
It returns "-bash: git: command not found"
What command should I use to get OWASP CRS?
Also, I suspect the mod_security installation is incomplete since httpd server is unable to restart after installing modsecurity. Here's the configuration error:
[root#xx ~]# httpd -t
Syntax error on line 7 of /etc/httpd/conf.d/modsecurity.conf:
Invalid command 'SecRuleEngine', perhaps misspelled or defined by a module not included in the server configuration
Should I uninstall Mod_Secuirty first since everything seems to have become a mess now?
Any help is appreciated.
The apache binary in case of Webuzo is located at /usr/local/apps/apache and the modules are located at /usr/local/apps/apache/modules/lib.
Also the apache configurations in case of Webuzo are located at /usr/local/apps/apache/etc/ and /usr/local/apps/apache/etc/conf.d/
It seems you are trying to compile mod_security at an inappropriate location.
As you are having error with modsecurity.conf, I wonder whether you have followed the step
Step 4: Configuring Mod_Security
In the guide you have followed.
"-bash: git: command not found"
This error can be resolved by installing the package that includes git. try
yum install git-core -y
Both guide1 and guide2 are good to install mod_sec and follow any one. :)

Configuration for Java binding for ZeroMQ (0MQ) with no root privileges on Linux

I am a novice with zeroMQ and I am stuck at binding ØMQ with java on a server running CentOS release 5.9.
Unfortunately, I do not have super user/root privileges on the server and am trying to install ØMQ as a normal user with restricted privileges. I have installed ØMQ by following instructions on http://www.zeromq.org/area:download
Make sure that libtool, autoconf, automake are installed.
Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run ./configure, followed by make.
Could not run the following obviously
To install ØMQ system-wide run sudo make install.
On Linux, run sudo ldconfig after installing ØMQ.
Then I attempted to install jzmq.
Cloned [git clone https://github.com/zeromq/jzmq.git]
Ran autogen.sh
Ran configure
At this point I get the following error
checking for ZeroMQ... no
checking zmq.h usability... no
checking zmq.h presence... no
checking for zmq.h... no
configure: error: cannot find zmq.h
As a result of the above error I am not able to run java tests and get error "no jzmq in java.library.path".
Can anybody help/direct me to how to get java binding for zeromq work when you dont have root privileges to install it? Its difficult to get IT department to install a new software on servers.
Appreciate your help.
Note: I do not have write permissions to /usr directory
Thanks
GBP
This can be overcome by adding --with-zeromq=/home/user/zeromq (installation directory of zeromq)
./configure --with-zeromq=/home/user/zeromq
Other steps include
export LD_LIBRARY_PATH=/home/user/zeromq/lib
You can also use JeroMQ (https://github.com/zeromq/jeromq) which is a pure Java implementation of ZeroMQ
I got this working by running autogen.sh on OEL 6 then running configure / compiling / installing on CentOS 5.9. I briefly looked into why autogen.sh was failing and the problem was the tool chain was too old. Since I had a more up-to-date system with a modern tool chain available running autogen.sh on something other than CentOS 5 was the easiest path for me. I'm sure it works fine with other modern Linux variants, I had OEL 6 at my finger tips.
I also did not have access to a standard directory for installation. To get that working I added zmq.jar to my class path, and the run-time linker needed to be able to find the zeromq and jzmq run-time libraries.
I faced the same issue on CentOS 6.5 and found that you need to install "gcc-c++" for this to work.
I used the following to install dependencies:
yum -y install jdk zeromq-devel unzip libtool gcc autoconf automake gcc-c++ python
Note that "jdk" comes from our private repository and it's same what can be downloaded from java.com
The following public repositories are installed on server:
atomic
Actually, I ended up having this same issue, and the following script worked for me, where I installed zeromq into ~ (so that I have ~/lib contains libzmq.a libzmq.la libzmq.so libzmq.so.3 libzmq.so.3.1.0 pkgconfig)
./autogen.sh ./configure --prefix=$HOME \ #because you don't have root privileges
--with-zeromq=$HOME --includedir=$HOME/include/ --libdir=$HOME/lib/
./make
./make -n install
#to check to see if it installs it to the right location
make install

Having trouble installing mod_WSGI - can't find input file

I'm trying to set up mod_wsgi for use with Django. I have apache2, apache2-dev, python2.6, python2.6-dev all installed, but I'm getting this error when running configure:
checking for apxs2... /usr/bin/apxs2
checking Apache version... 2.2.14
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: error: cannot find input file: Makefile.in
Thanks for the help!
I had the exact same problem. Installing the apache2-dev package solved it.
sudo apt-get install apache2-dev
I don't think the asker needs this answer anymore, so I answered for future readers with similar problems
Install apache2-threaded-dev:
$ sudo apt-get install apache2-threaded-dev
I started writing that you may need to ensure that you have axps installed (you can do this by installing the apache2-dev package). but I notice that configure already found axps. I had a similar problem but configure was bailing on not finding this dependency. Maybe some similar dependency or write permissions.
You are running the mod_WSGI 'configure' script in the mod_WSGI source code directory aren't you? Ie., in the same directory as the Makefile.in file that comes with the source tar ball.
mod_wsgi's configure script uses apxs to find the path to httpd:
apxs -q SBINDIR
apxs -q TARGET
Combine those with a "/" and add "-v", e.g.,
/blah/bin/httpd -v
That should run without an error. If it does not then mod_wsgi's configure script can't figure out the httpd version and you will get a broken symbolic link for Makefile.in.
For me, libpcre.so.0 wasn't in the LD_LIBRARY_PATH. Doing this:
export LD_LIBRARY_PATH=/usr/local/lib
then reconfiguring mod_wsgi and building fixed the problem.

Manual Installation of Glassfish on Ubuntu

I just installed Glassfish on my Ubuntu server (No GUI) using THIS tutorial. Everything went well. But now when I'm trying to play with ASADMIN tool it's telling me this:
The program 'asadmin' is currently not
installed. You can install it by
typing: apt-get install glassfishv2
-bash: asadmin: command not found
So, in order to run asadmin tool always need to type:
/opt/glassfish/bin/asadmin start-domain domain1
or go to that folder and run it from there.
So, the question is, what file do i need to edit in order to set this path in to the environment.
You can add the following to your ~/.bashrc file to add all the binaries in /opt/glassfish/bin to your $PATH
export PATH=$PATH:/opt/glassfish/bin
~ expands to /home/your-user - just to be clear.
Just type to CLI:
export PATH=/opt/glassfish/bin/:$PATH