JBoss 7.2.0 Final creating server.log file in unexpected places - jboss7.x

I am trying to set up JBoss 7.2.0 Final on CentOS 6.5 to handle 4 different deployments of our software. I'm not sure if I have set things up correctly or not, but everything seems to work except that server.log is not ending up where I think I am telling it to be saved in 3 of 4 deployments.
There are 4 HTTP ports being used for the deployments. They are :8080, :8180, :9876, and :9976. I don't know if that is relevant information or not, but I bring it up because in each standalone.xml file I am using the jboss.socket.binding.port-offset option to assign the ports. The only deployment that seems to work flawlessly is :8080, which has jboss.socket.binding.port-offset:0. :8180 has jboss.socket.binding.port-offset:100, etc.
Each deployment lives in its own directory, for example
/opt/jboss-eap-6.1/target/standalone8080/
and
/opt/jboss-eap-6.1/target/standalone9876/
In the standalone.xml file for each deployment (/opt/jboss-eap-6.1/target/standalone9876/configuration/standalone.xml, for example), the server log is specified in the same way:
<file relative-to="jboss.server.log.dir" path="server.log"/>
This should result in the server.log being saved in, for example,
/opt/jboss-eap-6.1/target/standalone9876/log,
and when redeploying the software on each port, I have echoed out the $JBOSS_LOG_DIR variable and it seems on the surface to be set correctly in each case.
However, as mentioned above, only port :8080 creates the server.log file in the expected location (/opt/jboss-eap-6.1/target/standalone8080/log).
The incorrect locations:
--Port :8180 puts its server.log file in the :8080 location. I.e., :8180 overwrites the server.log file at /opt/jboss-eap-6.1/target/standalone8080/log.
--Port :9876 puts its server.log file in /opt/jboss-eap-6.1/target/standalone/log. I.e., it creates a new folder simply called standalone and puts the file there. I will add that in a former time, the entire port :9876 deployment lived in a folder at that path (/opt/jboss-eap-6.1/target/standalone). This apparent clue makes me think there is some other place where there is a setting for the server.log file path. I could be quite wrong.
--Finally, port :9976 is putting its server.log file one level above the desired log directory, in other words, at /opt/jboss-eap-6.1/target/standalone9976.
I don't know if the way these 4 deployments are being handled is fundamentally incorrect or if there is a setting hiding somewhere that is overriding my desired paths.
I saw one poster with a similar problem say they made a change to domain.xml to fix the issue. I don't think I can do that, since I only have one domain.xml file (located in /opt/jboss-eap-6.1/domain/configuration) that is associated with all 4 deployments.
Another post recommended removing the "relative-to" bit in the <file> tag in the standalone.xml file. I tried that with port :9876 as follows:
<file path="/opt/jboss-eap-6.1/target/standalone9876/log/server.log"/>
This did not work for me. The server.log file still ended up in
<file path="/opt/jboss-eap-6.1/target/standalone/log/server.log"/>
Any ideas what I am doing wrong? Is there simply another place I need to declare my log path, or is the way these 4 servers are set up just plain incorrect?

Have a look at each logging.properties file in each configuration directory. You might just need to update those, once, to change the path to {jboss.server.log.dir}/server.log. Then when you start each server you'll need to specify the jboss.server.log.dir directory.
./bin/standalone.sh -Djboss.server.log.dir=$JBOSS_HOME/target/standalone8080/log
There might be a clever way to handle it in the $JBOSS_HOME/bin/standalone.conf file.

Related

(MacOS Server) Apache File Extension Questions

I am running into some sort of issue when trying to access my local website:
Forbidden
You don't have permission to access /index.html on this server.
Apache Server at ffghost.local Port 34580
I'm using macOS X Server 5.2 with Apache 2.4.18. OS X Server automatically creates two default websites (one on port 80 and one on port 443). I created a new website. It was my understanding that Apache would redirect from the default site to the created site automatically once created. This didn't happen. So, in an attempt to begin de-conflicting I replaced the files where the default site was located with the new website files and all of the sudden am getting the above 404 message.
I have read a lot of possibilities as to why this may be happening. I've run a syntax checker for Apache in terminal and terminal says syntax is ok. So from there I was going to check into the config files, but there are several, and I just want to know the gist behind them.
There seem to be about 4 file extension types. I don't know what they all mean or if they are active.
.config (I'm assuming this is the active file)
.config.prev (I'm assuming this is a previous version or copy of an active config file and is no longer active)
.config.orig (original file? and is no longer active)
.config.default (???)
Also, OS X Server and Apache seem to have the same files in two different places and I'm a little confused on which one to change. If I change one of them will it be reflected in the other? Do I need to change both of them? Additionally, I don't have DNS set up and am unsure if that was the original issue of not pulling up the new website over the default site.
You are mixing several aspects in your question which makes it complicated to give a helpful answer. For example, you say you get Forbidden when accessing your site, but later you mention a status 404. The former might be due to configuring a user group being allowed to access the site, while the latter just means Not found.
As to your actual question about the config files:
The file just ending in .conf is the one that is being used.
However, the Server app uses a lot of of different config files which might be relevant:
Path /Library/Server/Web/Config/apache2 contains the general config files
httpd.conf - general Apache configuration
httpd_server_app.conf - more general configuration
the other files contain configurations for specific applications or webapps (the latter being defined in plist files in /Library/Server/Web/Config/apache2/webapps)
Path /Library/Server/Web/Config/apache2/sites contains config files specific to your websites. They are named something like 0000_127.0.0.1_34543_your.domain.name.conf where 34543 is the configuration for the https (SSL) port, while 35480 would indicate the http port. There is also a file like 0000_127.0.0.1_34543_.conf (no domain name in the file name) which defines the default site.
In addition to these, there are two more configuration file in /Library/Server/Web/Config/proxy which configure the proxy services.
It is not recommended to manually adjust the config files, except for those in the sites subdirectory, because they may get overwritten by the Server app or when updating the Server app.
Important: If you change the files manually, you must re-start the Apache server in order to make the changes effective. Use sudo serveradmin stop/start web to do so.
However, I do not know of a detailed documentation of of all these files, so I try to stay on the safe side and possibly not edit the general config files (only those in sites). I also recommend to write down any manual changes, so they can be reapplied if necessary.
Without exactly knowing what you configured in the Server app and which files you changed how, I'm afraid it is impossible to say what might have gone wrong. I recommend to start all over by removing and re-adding the web sites.

WAMP Server 3.0.0 cannot open apache conf file

I've re-installed WAMP in order to put it into a different directory. This was mainly so everything is automatically backed up.
Mysql starts ok, but apache fails with the following message from the event viewer:
The Apache service named reported the following error:
httpd.exe: Could not open configuration file bin/conf/httpd.conf: The system cannot find the path specified. .
This file is in the correct place (C:\googledrive\wamp64\bin\apache\apache2.4.17\conf) and there isn't any other stray httpd.conf files that it might be picking up on the path or anywhere.
Any ideas?
This turned out to be a permissions problem. It seems that the system account didn't have access to the directory containing the config file, but I guess must have had enough access to start up Apache and give that helpful (not) message!

Is it possible to run more than one rabbitmq instance on one machine?

I want to build a RabbitMQ cluster in my dev machine (windows).
reason is that I would like to test and study it.
Is it possible to run more than one rabbitmq instance on one machine?
I am guessing I need to:
Change the listening port
Change the appdata folder (C:\Users\MyUser\AppData\Roaming)
Change the ui plugin port so I can view all instances.
Remove the service and run from cli
Has anyone tried it?
Is there a known guide?
This thread appears to detail what you need. From the thread responses (scroll down):
The following settings are necessary to separate the node runtimes
completely, while allowing them to share the installed code base.
RABBITMQ_CONFIG_FILE /etc/rabbitmq/rabbitmq
RABBITMQ_MNESIA_BASE /var/lib/rabbitmq/mnesia
RABBITMQ_LOG_BASE /var/log/rabbitmq
RABBITMQ_ENABLED_PLUGINS_FILE /etc/rabbitmq/enabled_plugins
Now the official RabbitMQ documentation contains a section "A Cluster on a Single Machine", which describes how to run multiple Rabbit nodes on a single machine.
See https://www.rabbitmq.com/clustering.html#single-machine
One approach that I took when testing out clustering on my dev machine was to fire up several VMs. I had several for Rabbit and one for HAProxy.
While you can, as per one of the other answers, run multiple instances on a single OS instance, the multiple VM approach allowed me to mimic the intended production environment more closely.
NB. I have chosen to interpret your 'one machine' as meaning a physical machine for the purpose of this answer. If your meaning was 'virtual' then I defer to the other answer posted against this question which details how to accomplish this.
You can run multiple RabbitMQ instances on 1 machine without clustering. You just need to change the ports and the node name in rabbitmq-defaults, rabbitmq-env and config files.
For Linux:
Make sure you have Erlang installed, then download the latest version for Generic Unix and extract it.
Go to rabbit installation folder(the folder you just extracted)/sbin -> open the rabbitmq-defaults file and change SYS_PREFIX=${RABBITMQ_HOME} to create the default folder somewhere else, you should set the path to the extracted folder, for ex. /home/YOUR-USERNAME/rabbit_server-msg(this is my extracted folder).
Change the node name. Open the rabbitmq-env file -> find NODENAME=rabbit#${HOSTNAME} and change the name rabbit (ex. rabbitMSG#${HOSTNAME}). In the same file locate and change DEFAULT_NODE_PORT, by default it’s set to 5672. The default clustering port is set by ${DEFAULT_NODE_PORT} + 20000. So if you set the default node port to 5673, the clustering port will be 25673.
Install the Management Plugin. Navigate to rabbitmq-server/sbin and run “./rabbitmq-plugins enable rabbitmq_management”
The AMQP and HTTP ports need to be chnaged in the config file. Copy the file rabbitmq.config.example and paste it in the rabbit_server-msg(again this is my extracted forlder)/etc(this is the default folder created by RabbitMQ from step 1)/rabbitmq folder, rename the file to just rabbitmq.config. If you can’t find the file rabbitmq.config.example in the rabbit folder create a file named rabbitmq.config and copy the code from their GitHub.
Open the config file and uncomment the following lines:
– {tcp_listeners, [5672]} and change the port number (It is recommended to set the same number as the DEFAULT_NODE_PORT in rabbitmq-env for example 5673).
– {listener, [{port, 12345} and change the port number (This is for the management plugin).
NOTE: Be careful with the commas and brackets. Remove the comma after {tcp_listeners, [5672]}. Also after {listener, [{port, 12345} close the brackets like so ]}. Otherwise when you try to run ./rabbitmq-server it will show errors (It will show you on which line in the config file you have an error so you can fix it).
Now start up the server and log in the manager. Check the Listening ports under Ports and contexts to see if you made the changes. Do this for the other servers and you will be able to run as many servers as you want on 1 machine all with different listening ports. To start the RabbitMQ server automatically when you log in use the Startup Application program.
For Windows:
Setting up RabbitMQ for Windows is preatty much the same as on Linux.
Make sure you have Erlang installed, then download the latest version for Windows and extract it.
Go to rabbit(the folder you just extracted)/sbin -> open the rabbitmq-defaults.bat file and change RABBITMQ_BASE to create the default folder somewhere else, you should set the path to the extracted folder, for ex. C:/rabbit_server-msg(this is my extracted folder).
Change the node name. Open the rabbitmq-env.bat file -> find RABBITMQ_NODENAME=rabbit#!HOSTNAME! and change the name rabbit (ex. rabbitMSG#!HOSTNAME!). In the same file locate and change RABBITMQ_NODE_PORT, by default it’s set to 5672. To change the default clustering port locate and change RABBITMQ_DIST_PORT, by default it’s set to 25672.
Install the Management Plugin. Navigate to rabbit-server/sbin and run “rabbitmq-plugins.bat enable rabbitmq_management”.
The AMQP and HTTP ports need to be chnaged in the config file. Create a file named rabbitmq.config and copy the code from their GitHub. Put the file in your installation folder/RabbitMQ (ex. my config is in C:/rabbit_server-msg/RabbitMQ). Also in the rabbitmq-defaults.bat file check CONFIG_FILE it should be set to CONFIG_FILE=!RABBITMQ_BASE!\rabbitmq.
Open the config file and uncomment the following lines:
– {tcp_listeners, [5672]} and change the port number (It is recommended to set the same number as the RABBITMQ_NODE_PORTin rabbitmq-env for example 5673).
– {listener, [{port, 12345} and change the port number (This is for the management plugin).
NOTE: Be careful with the commas and brackets. Remove the comma after {tcp_listeners, [5672]}. Also after {listener, [{port, 12345} close the brackets like so ]}. Otherwise when you try to run rabbitmq-server.bat it will show errors (It will show you on which line in the config file you have an error so you can fix it).
Now start up the server and log in the manager. Check the Listening ports under Ports and contexts to see if you made the changes. Do this for the other servers and you will be able to run as many servers as you want on 1 machine all with different listening ports.
Source: https://lazareski.com/multiple-rabbitmq-instances-on-1-machine/

HSQLDB 2.2.9: understanding server.properties file

I am running hsqlddb 2.2.9 on ubuntu Linux but I am struggling to understand the server.properties file. With hsqldb installed under /usr/local, when I start the server with java org.hsqldb.server.Server from the place I put the server.properties file, suppose server.properties is:
server.database.0=file:/usr/local/hsqldb-2.2.9/hsqldb/hibernate/hiberdb
server.dbname.0=hiberdb
Then I get a subdirectory hibdernate with everthing in it labeled
hibderdb.{log,script,properties,tmp}
with hibderdb.tmp an empty directory. So far so good.
However I cannot understand hyper sql db's logic in the following cases:
Suppose server.properties is:
server.database.0=file:/usr/local/hsqldb-2.2.9/hsqldb/hibernate
server.dbname.0=hiberdb
then the hibderdb alias is ignode and I get files
hibernate.{log,properties,script,tmp}
in the same directory as the server.properties file (i.e. in the current directory).
or even the following:
server.database.0=file:/usr/local/hsqldb-2.2.9/hsqldb/hibernate/
server.dbname.0=hiberdb
then all I get is a hibernate subdirectory with no hibderdb.* files and instead I have files
hibernate/{.log,.properties,.script,.tmp}
(these are hidden Unix files, and again the alias property dbname is ignored).
The HSQLDB documentation has an example:
http://hsqldb.org/doc/2.0/guide/listeners-chapt.html#lsc_server_props
server.database.1=file:/opt/db/mydb
server.dbname.1=enrolments
Is this example outdated or wrong?
Thanks,
Jason Posit
The server.dbname.0=hiberdb is totally unrelated to the other line in the properties file.
This 'alias' is used when accessing the server from a client.
The example in the documentation is correct. The external database client is dealing with a database alias it knows as 'enrolments', and does not need to know where you store the files on your server.
Access to your 'hiberdb' client is always via the URL such as jdbc:hsqldb:hsql://localhost/hiberdb no matter where you put the files.

tomcat 5.5 setting up context path with virtual hosts (non webapps directory)

I have been a web developer for a couple of years (some ASP, mostly PHP) and have recently taken on Java/JSP in the last two years.
The one thing I have tried repeatedly but continue to fail to wrap my head around is the way to setup a working JSP application in another location that is NOT the webapps folder. Rocking my application out of webapps does not seem to be a problem for me.
Could anyone help break this down, or point me to post somewhere which outlines it?
I have Googled repeatedly and read and re-read the documentation on the apache.org website, but I still cant seem to get it :(
I am trying to setup an "exploded" site (folders and files separated - not part of a WAR).
I know that I CAN edit the server.xml file, but am not supposed to (not that it matters... even when I attempt to edit that I fail).
I know I am missing something with the way the paths work. I THOUGHT I understand but I dont thinks so.
Any help is mucho appreciated!!
Love this site.
-- I have decided to re-phrase my question with more detail --
Let's say I have a directory structure as follows (**NOTE: webproject is NOT in the tomcat/webapps directory)
/webproject
/webproject/htdocs
/webproject/htdocs/images
/webproject/htdocs/images/logo.gif
/webproject/java
/webproject/java/page1.jsp
/webproject/java/page2.jsp
I would like to setup a virtual host so that I can view my project via a URL: http://webproject
I THINK all I need is two things (I am using apache):
a 'VirtualHost' entry in my httpd.conf file.
some type of 'context' file or fragment somewhere.
Am I right? If so, could someone help me define these two elements?
Also, if I want to use a domain-relative URL for referencing my logo.gif file from either of my jsp pages what would my path look like?
What if I want to use a domain-relative URL for referencing page2.jsp from page1.jsp?
HOWEVER, if there are paths within my application that reference resources (images, scripts, etc) using a path which starts at the root (ie. img src="/htdocs/images/foo.gif") it is not found.
Are you aware that those paths are supposed to be URL's relative to the current request URL (the one of the JSP page) and thus not local disk file system paths relative to their location at the local disk file system? As you're using /htdocs, it namely look like that you thought the latter.
Thus, if the JSP page is for example to be requested by http://example.com/context/page.jsp and the foo.gif is actually available by http://example.com/context/images/foo.gif, then you need to use either page-relative URL:
<img src="images/foo.gif">
or domain-relative URL:
<img src="/context/images/foo.gif">
or protocol-relative URL:
<img src="//example.com/context/images/foo.gif">
or absolute URL:
<img src="http://example.com/context/images/foo.gif">
OK, after struggling with this I finally got it to work. I aint saying this is the best (or even correct!) way of doing it, but this is what ultimately worked for me locally on my Windows machine (running WAMP) and on a remote server running Linux.
The paths listed are where they were for my environments. Obviously this could be different for your situation.
BEFORE-FIRST (Windows only)
With Windows, you need to setup an entry in your hosts file for the new "domain".
WIN - C:\Windows\System32\drivers\etc\hosts
127.0.0.1 webproject.local
FIRST
Need to edit httpd.conf and add a virtual host
WIN - C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf
LINUX - /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot "C:\wamp\www\webproject"
ServerName webproject.local
</VirtualHost>
SECOND
Setup a host and context in server.xml. From what I read online, editing server.xml is discouraged but this was the only way I could figure it out.
WIN - C:\Program Files (x86)\Apache Software Foundation\Tomcat 5.5\conf\server.xml
LINUX - etc/tomcat5/server.xml
<Host name="webproject" debug="0" appBase="webapps" unpackWARs="true">
<Context path="" docBase="C:/wamp/www/webproject"/>
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="webproject.local_error-log." suffix=".txt" timestamp="true"/>
</Host>
The thing I don't think is right, but worked for me was using "webapps" as the appBase even though my files are not in the "webapps" folder. Not sure why this is working... I fear that it is one of those situations where it works even though it shouldnt. I hope someone a lot smarter than me can offer some insight.