RabbitMQ conf file location - rabbitmq

Where do I put my rabbitmq.conf file and how do I make it known to the rabbitmq-server?
All documentation and what I can find only clarifies that this file is not there initially, and the example config file is referenced. Official doc says that I can override the RABBITMQ_CONFIG_FILE env variable. It is unset on my system, but how would I set it so that it is known to rabbitmq-server?

As #Taschi mentioned, the default location of the rabbitmq.conf file is /etc/rabbitmq folder.
Also, you can place it in a custom location and let the rabbitmq-server know the location by setting in in the rabbitmq-env.conf file.
Contents of rabbitmq-env.conf file
CONFIG_FILE=/path/to/rabbitmq.conf
Reference: https://www.rabbitmq.com/configure.html#config-location

By default, the location is at /etc/rabbitmq, according to https://medium.com/#lukaszlenart/how-to-configure-rabbitmq-properly-fa39b2d4cda2.
How to properly set the env variable depends on your operating system, but you could just do it in a startup shell script.

ON MAC
If installed via Homebrew you possible find the rabbitmq-env.conf file at
/opt/homebrew/etc/rabbitmq/rabbitmq-env.conf
One way to find out as well is to read the plist file to see the config location
Once you start rabbitmq via brew services start rabbitmq
It displays "rabbitmq started {user} ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist"
RUN: vim ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist
This should display certain file location such as config that you need.

Related

Windows 10 - Apache 2.4.53 + PHP 8.0.19 not loading php modules [duplicate]

I have found that:
When I type the following on terminal:
php -i | grep php.ini
I get the output:
The Loaded Configuration file is # /etc/php5/cli/php.ini
However, from phpinfo(), I get to see:
The loaded ini file is # /etc/php5/apache2/php.ini
Which one of these is working right now? How is it possible to have two php.ini files ?
Depends on where you are running PHP from. If you run it from command line, it uses the cli/php.ini and apache2/php.ini when run through apache.
You are executing phpinfo() through the browser, hence you get /etc/php5/apache2/php.ini as the answer. Running php -r "phpinfo();" | grep "Loaded Configuration" from the terminal should output the CLI ini. Same function, context changes.
The advantage of this system is obviously to allow different configurations depending on the context. For a simplified example, you might want to have safe_mode on in apache but it's unnecessary in CLI mode.
Your .ini paths are actually quite unusual. Normally, the default .ini is just php.ini and CLI .ini is called php-cli.ini and they reside in the same folder.
I'm no expert on the subject but this should be the basic idea. If anyone has any corrections, I'd be happy to hear them.

Run Time Argumnets in PCF

In order to run the application in my local, i need to provide some VM arguments(basically file path, where it is located). In similar way in PCF also I have to provide those arguments.
currently I am keeping in application.yml file like below.
jaas:
conf: /home/vcap/app/BOOT-INF/classes/nonprod_jaas.conf
krb5:
conf: /home/vcap/app/BOOT-INF/classes/krb5.conf
trustore:
conf: /home/vcap/app/BOOT-INF/classes/kafka_client_truststore.jks
When I deploy the application in PCF, will these files will be read from that location.
Basically I want to know this is correct way or not to provide the arguments in PCF.
how to check whether the file is present in that location, /home/vcap/app/BOOT-INF/classes/
You need to ssh into the container to check the location of the file.
cf ssh appname
In spring, #Value enables the use of the classpath: prefix to resolve the classpath (see this link) https://www.baeldung.com/spring-classpath-file-accessclasspath: It means you need to set this programmatically not via the variables in yml. Then you don't need to provide the path the way you are doing.
Also classpath: is a Spring specific convention, the JVM doesn't understand it which means you cannot use it directly in application.yml file. If you need to set in yml or as environment variable - you need to give it a full or relative path. On PCF, you can use /app or /home/vcap/app (the former is a symlink to the latter) as the path to the root of your application.

Installing stackify in linux

The installation guide of Stackify states that we have to modify the catalina.sh of tomcat file to add the java agent. But in a spring-boot app, where can I find the tomcat location to modify the file.
I changed the application.properties file to set the custom location for tomcat by setting server.tomcat.basedir.
How can I change the catalina.sh file now?
Should be able to do the command cd $CATALINA_HOME/bin to get to the folder that contains the catalina.sh. After that you can add CATALINA_OPTS="$CATALINA_OPTS -javaagent:enter_path_stackify_apm_jar" to it.

Redis Default Config Not Found

I'm following this tutorial to setup a Redis server:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis
and getting this error message:
Mmmmm... the default config is missing. Did you switch to the utils directory?
I'm in the /utils directory, but there doesn't appear to be a default config. From the documentation I've read online, it seems like the config should have been created upon setup. Is this something I have to make manually or is this an installation error? My 'make test' command ran successfully, so I don't know why the config file wouldn't have been set up automatically.
If you're on WSL (Windows Subsystem for Linux), you can get this error if you put your Redis folder somewhere that has a path name containing whitespace.
So, like if you put it in the "Program Files" folder. I migrated mine out to just the C:\ drive (or /mnt/c/ for WSL), and it worked just fine.
Had to manually copy default config from the dir above into the correct dir.

php cron job doesn't update php.ini

I recently modify the "include_path" var in my php.ini file. Before you ask, I restarted the apache service. The change work for every pages we access from a web browser.
The problem is the cron jobs doesn't seems to consider that change. When I do a phpinfo() inside the cron job, it uses the same php.ini file than the web server and it is the one I changed, but the value beside "include_path" is the old one.
So is there a way to "restart" crontab?
Or maybe there is another problem?
Several systems use a separate php.ini file for web and CLI. You will need to make changes in that one as well: How to find the php.ini file used by the command line?
The easiest way to find this file is to run this at the command line: php --ini which will result in output like this:
user#computer:~$ php --ini
Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File: /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
What you see as "Loaded Configuration File:" is where you need to add your changes.
EDIT: Another option, is in your CRON script use set_include_path() to make the change at runtime.
PHP generally has two .ini files. One for in-webserver (SAPI) and one for command-line (CLI) usage. If you modified only the SAPI one, then anything running from CLI (e.g. cron jobs) will not see the change.
do a php -i at the command line to see where PHP is looking for its ini file while in that mode.