RabbitMQ installation on Mac - macos

Sorry for this noob-questions. Here written:
Contained in the tarball is a directory named rabbitmq_server-3.3.5.
You should extract this into somewhere appropriate for application
binaries on your system.
Where it is? sbin, usr/bin, bin or something else? So, every time on startup I need to go to that path and command:
sbin/rabbitmq-server -detach
Or I can do it like this:
rabbitmq-server -detach
Thanks!

Related

CLI Go Config.toml file location

I am attempting to test a Golang application hauser locally on via -bash CLI before deploying on a VM.
Per the documentation, I compiled locally and copied the example-config.toml file. I then mapped to the GOPATH and opened hauser.exe to open config.toml file. However, when I execute, it returns open config.toml: no such file or directory
C02Z30ANLVDV:~ pmcgin2$ $GOPATH/bin/hauser -c Documents/go/bin/config.toml
2020/08/14 18:05:23 Cannot find folder , make sure it exists
C02Z30ANLVDV:~ pmcgin2$ open Documents/go/bin/config.toml
No application knows how to open /Users/pmcgin2/Documents/go/bin/config.toml.
Is there an alternative command I can execute to override the default config.toml location for an application like this?
There are two possibilities to solve your issue:
give an absolute path as argument:
$GOPATH/bin/hauser -c /Users/pmcgin2/Documents/go/bin/config.toml
give a relative path from the binary location:
$GOPATH/bin/hauser -c config.toml
Generally, it is easier to use absolute paths.

docker build hangs in directory with many files

Windows 10. I have in folder just:
app (directory with many files)
Dockerfile (simpliest docker file)
I run "docker build ." and it just hangs.
If I remove "app" directory. Build runs ok.
In docker file just one line:
FROM node
Didn't find any issues like that. It fills like it tries to scan the directory or something.
Any advice?
UPD: It seems that I should use .dockerignore https://docs.docker.com/engine/reference/builder/#/dockerignore-file
When you run docker build ... the Docker client sends the context (recursive contents of the directory) via REST to the Docker daemon for building. If that context is large, this could take some time (depending on a variety of factors, if your daemon is local / remote, platform maybe, etc...).
How long are you giving it to hang before giving up? Could be that it's still just working? Or could be that the context was so large maybe the client / daemon experienced an issue. Checking the (client / daemon) logs would help debug that.
And yes, a .dockerignore file (basically a .gitignore but for Docker context) is probably what you're looking for, unless you need the contents of the app directory during your build.
Your Dockerfile should be put in the directory that only includes it's build context. For example, if you are building a spring-boot app, you can put the Dockerfile right under /app, as shown in this official docker sample.
Docker's documentation:
In most cases, it’s best to start with an empty directory as context and keep your Dockerfile in that directory. Add only the files needed for building the Dockerfile.
Warning: Do not use your root directory, /, as the PATH as it causes the build to transfer the entire contents of your hard drive to the Docker daemon.
I've seen that simple docker examples put dockerfile in the root directory, but for complicated examples like the one I posted above, the dockerfile is put only in it's relevant directory. You can dig through the dockersamples repository and find your case.

how to customize login page for shibboleth idp

I would like to customize the login page and I'm trying to follow the shibboleth wiki, but I'm not sure where to find " src/main/webapp/login.jsp within your IdP distribution package" in order to modify it. My shibboleth resides in /opt/shibboleth-idp, but I don't have a src folder in there. Any help would be appreciated.
For IdP version 3, you can customize by changing the files in the "views" directory. These are Apache Velocity templates, and you can make changes that become active without having to rebuild the war file.
(sorry this is two months late, but...)
the files for login are not stored inside your shibboleth-idp directory. (well, they're sorta in there...rolled into the java war file.)
somewhere, there should be a directory that was used to build your shibboleth-idp instance. many times i've seen it in the same folder as the shibboleth-idp folder, but it doesn't have to be. so since yours is /opt/shibboleth-idp, it might be at /opt/shibboleth-identityprovider-version.number. if not, use the find command as already suggested, but maybe try something like
find / -name 'shibboleth-identityprovider*' -ls 2>/dev/null
unless someone built it off-box, that folder should exist somewhere. inside there is the src directory where login.jsp resides.
the install script the shib doc tells you to run after making your changes is at the top level of that shibboleth-identityprovider-version.number folder too (install.sh for unix). when you run the install script, you tell it where to put the idp files (in your case, /opt/shibboleth-idp).
also, before running the install script, it's a good idea to back up your conf directory. you might accidentally tell the install script to overwrite it. or it might do it even if you told it not to (bug in some versions).
I recommend starting with the Linux find command:
find /opt/shibboleth-idp/ -name login.jsp

How do I change the default location of mongodb?

I installed MongoDB on Yosemite using brew. I understand that the default storage location is /data/db. I'd like to change this to location /Volumes/Data/mongodb, so that when I run 'mongod', it will choose the databases in /Volumes/Data/mongodb by default. I tried editing the mongod.conf file, and I have
storage:
dbPath: /Volumes/Data/mongodb
However, whenever I run 'mongod', it gives me the message:
ERROR: dbpath (/data/db) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
If I give mongod the --dbpath argument, it works fine, but I want it to work by default. Why does it appear that my mongod.conf file is not obeyed. Searching on google, it seems the conf file in installed in different locations depending on OS and install method. Running db.serverCmdLineOpts() gives:
{
"argv" : [
"/usr/local/opt/mongodb/bin/mongod",
"--config",
"/usr/local/etc/mongod.conf"
],
"parsed" : {
"config" : "/usr/local/etc/mongod.conf",
"net" : {
"bindIp" : "127.0.0.1"
},
"storage" : {
"dbPath" : "/Volumes/Data/mongodb"
},
"systemLog" : {
"destination" : "file",
"logAppend" : true,
"path" : "/usr/local/var/log/mongodb/mongo.log"
}
},
"ok" : 1
}
Notes
The path must exist. It doesn't get created automagically.
/Volumes is sort of a reserved directory for mounting drives and bundles and shouldn't be worked on directly.
In case you use a volume or (sparse) bundle, you need to make sure it is mounted on boot or you have to do it manually before starting MongoDB.
Basically, there are two places to put MongoDB data in OS X. Sadly, neither brew nor MacPorts obey the File Hierarchy Standard*, which is also adopted by the BSD which is the foundation of OS X.
Solution 1: You want the data accessible by all users of OS X
Since mongod is run from /usr/local subtree, so this is our parent. But since variable data belongs to /var we need to use the local tree there. So our base path for the data is /var/local/lib. It is mongoldb data, so you can either put it into mongo (because of the package basename) or mongodb (because of the vendor name) or even mongod (because of the daemon name). That's basically a matter of taste, but I'd stick with the vendor. So your dbpath would be /var/local/lib/mongodb.
Solution 2: Only you will access the data
Put the data into your home directory.
Well, basically you can do what you want there, but in general I'd put data into a hidden directory (prefixed with a dot) so that it does not clutter your Finder. Something like $HOME/.mongodb
This solution isn't really clean, since the software will run from a public subtree and the data is stored in a user directory.
Extension to both solutions
If you want to put your data into a volume or (sparse) bundle, simply create a symlink from the correct location to the volume, simply create a symlink instead of creating a directory. Example for solution 1:
sudo ln -s /Volumes/YourVolume /var/local/lib/mongodb
* Well, it is to argue that since MacPorts installs under /opt, it technically does (though imho it would rather belong to /usr/local in the first place)
AFAIK, mongod needs to be configured before working. There are 2 ways to specify configurations.
by command line arguments. which is the --dbpath parameter you added. for example:
mongod --dbpath /Volumes/Data/mongodb
by specifying a config file. Usually if you install from source, it comes with one at /etc/mongod.conf (varies depends on different Linux distributions). Where you can specify all the parameters in it.
By saying
I want it to work by default
I assume you mean you want to start daemon on system reboot. So the config file you are actually using is specified in the daemon script. For example in CentOS you can find daemon script in /etc/init.d/mongod, where the line
CONFIGFILE="/etc/mongod.conf"
decides which config file you are using. So you may want to find your daemon script and check it first.
If this is not your situation, maybe you just downloaded mongodb from somewhere and unzipped it to your system, and you start mongodb with nothing but:
mongod
This way I guess the default location of mongod.conf is decided by the compiling parameters. Which means if you want to change it, you'll have to download the source code and compile it yourself.

How to install a mod_ftp module on a MAMP server

Background:
I recently installed MAMP, and am using it as a production server. The server setup did not come with an FTP server, and from what I've read, you can set up an FTP server via mod_ftp, an Apache module. I am not an expert with Apache software or server admin, although I can learn quickly. I can get to the following point and then I get stuck. Can someone please help me out?
I checked out the mod_ftp module files from the repository, here:
http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/
and I unzipped the contents into:
/Applications/MAMP/mod_ftp
I opened the README-FTP file (here):
http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/README-FTP
README-FTP:
To build and install as a DSO outside of the httpd source
build, from the ftp source root directory, simply;
./configure.apxs
make
make install
...
To build static, or as a DSO but within the same build as httpd,
copy the entire ftp source directory tree on top of your existing
httpd source tree, and from the httpd source root directory
./buildconf (to pick up ftp)
./configure --enable-ftp {your usual options}
and proceed as usual.
Some Questions:
"build and install a DSO outside of the httpd source build, from the ftp source root directory" -- is the ftp source root directory the mod_ftp folder that I created from the zipped files I checked out from the repository?
What does it mean "outside of the httpd source build"? -- is this the ServerRoot value I set in the httpd.conf as "/Applications/MAMP/Library" ?
Likewise, what does "within the same httpd build" mean -- what location is this referring to?
How do I know whether I want a static or DSO build?
What is the statement: "copy the entire ftp source directory tree on top of your existing
httpd source tree" actually asking me to do? (on top of?? As in, in the parent directory of the httpd source tree, or in the same directory?)
If you've made it this far, I'd like to commend you!
From this point, I chose the first option, and entered the commands seen in README-FTP into my Terminal.
Here's what my terminal looks like:
$ ./configure.apxs
Configuring mod_ftp for APXS in /usr/sbin/apxs
Detecting features
Finished, run 'make' to compile mod_ftp
Run 'make FTPPORT=8021 install' to install mod_ftp
(The default FTPPORT is 21 if not specified)
The manual pages ftp/index.html and mod/mod_ftp.html
will be installed to help get you started.
The conf/extra/ftpd.conf will be installed as an example
for you to work from. In your configuration file,
/private/etc/apache2/httpd.conf
uncomment the line '#Include conf/extra/ftpd.conf'
to activate this example mod_ftp configuration.
$ make
Making all in modules/ftp
$ sudo make install
Password:
Making install in modules/ftp
/usr/share/apr-1/build-1/libtool --silent --mode=install cp mod_ftp.la /usr/libexec/apache2/
Installing configuration files
for i in /private/etc/apache2/httpd.conf /private/etc/apache2/original/httpd.conf; do \
if test -f $i; then \
(awk -f /applications/mamp/library/mod_ftp/build/addloadexample.awk \
-v MODULE=ftp -v DSO=.so -v LIBPATH=libexec/apache2 \
-v EXAMPLECONF=/private/etc/apache2/extra/ftpd.conf \
< $i > $i.new && \
mv $i $i.bak && mv $i.new $i \
) || true; \
fi; \
done
Preserving existing FTP documents
Installing header files
Installing online manual
$
So what do I do from here?
I don't see mod_ftp.so anywhere, and I am particularly looking in this directory:
/Applications/MAMP/Library/modules (where all of Apache's other mod_*.so files are...)
and this directory:
/Applications/MAMP/mod_ftp/modules/ftp (where all of mod_ftp's various .c, .h and other files are)
Ultimately, I think the problem I am running into is that I don't understand how the file structures between my mod_ftp source folder and the httpd source folders need to be integrated in order to get the module running properly. Also, I don't know what I don't know, so there is probably one simple question to ask, but unfortunately I can't figure out how to ask it. Thank you for your help and patience!
Cheers!
P.S., yes, I have scoured the internet for hours.
I ended up scrapping MAMP and using the Mac's built in server. Through the System Preferences > Sharing menu, you can enable file sharing, which has an Options pane that allows you to "Share files and folders using FTP." I was able to obtain a static IP address through Comcast Business, and configured port forwarding on port 21 in my router to accept traffic. Then, I could use my FTP client to connect to my router with something like "123.456.789:21" as my host. Wasn't the best or most secure solution, but it worked, so take it with a grain of salt.
Right, I finally managed to install this on Ubuntu LTS 16.04.
First of all, you should install svn and the apxs functionality by running
sudo apt-get install subversion apache2-dev.
Then, cd to a convenient folder, and run svn co http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/. This downloads everything in the folder named /trunk. Then, cd into the /trunk folder of the downloaded repo.
Then, run the stated instructions
./configure.apxs --> does something in the subfolder to enable makefile to work
make --> this compiles the contents of the repo and changes things around.
make install --> you may want to run with the suggested flag. Essentially copies things to where it needs to be copied, and creates the necessary modules.
The suggested ./buildconf and ./configure should only be done if you are compiling apache2 with ftp at the same time. Since you should already have apache2 installed, this is not the option that you should be doing. Just stick with the first set of instructions, which are used to compile mod_ftp independently of apache2 and patch things in as needed.
At this point, the installation should technically work. However, you are not fully out of the woods yet. If you restart apache2 at this point, it should fail to start. If you run systemctl -xe, you will see that it is due to syntax errors in various places of the config files where someone forgot to prepend a forward slash, so rather than being given relative to root, the directories being specified end up being relative to /etc/apache2 instead. Fix those, using the line numbers as a guide. The omissions may be found in the apache2.conf file that specify the location of the mod_ftp module, and in the ftpd.conf file that specify the location of the error log.
You now need to mess around with apache2.conf and ftpd.conf (found in the /extra subfolder of the /etc/apache2 folder). Make sure that the lines
include /etc/apache2/extra/ftpd.conf
LoadModule ftp_module /usr/lib/apache2/modules/mod_ftp.so are present and uncommented.
The first basically tells the main apache2.conf file to include the configuration files for mod_ftp to help with partitioning your http and ftp configuration settings. The second just makes sure that the ftp module is loaded so that it can interpret the directives in the ftpd.conf file. Thus, you won't need to add the line "FTP on" or specify ports, as those are handled in ftpd.conf perfectly well.
You should now be good to go. Just note that for some weird reason if you set the document root in ftpd.conf to be the same as that in apache2.conf, apache2 will still run normally. The ftp server will work normally but the http server will not work. No idea why, but if you want to do that a simple workaround is to just do a symlink to the http document root and set that as the ftp document root.

Resources