Can we install wazuh in /home or /opt directory?

364 views
Skip to first unread message

Sayontani Bose

unread,
Aug 31, 2020, 1:48:35 AM8/31/20
to Wazuh mailing list

Hi Team,

I want to install Wazuh in /home or /opt directory , Is it possible to do ? If yes then please provide the solution .


Thanks & Regards
Sayontani Bose

Jonathan Martín Valera

unread,
Aug 31, 2020, 4:41:31 AM8/31/20
to Wazuh mailing list
Hi, Sayontani Bose

Yes it is possible, below I will tell you how to do it :)

In this link https://documentation.wazuh.com/3.13/development/packaging/index.html you can find a guide on how to generate custom packages.

Imagine you want to make a custom package in a ubuntu 18.04 to install wazuh in /home (I will use this guide https://documentation.wazuh.com/3.13/development/packaging/generate-deb-package.html#debian).

Note: As requirements to create the custom package you need to have installed docker and git.

- First, you need to download the wazuh-packages repository, and place it in the corresponding directory where the package generation script (generate_debian_package.sh) is located:

git clone https://github.com/wazuh/wazuh-packages && cd wazuh-packages/debs

Suppose we want to make a custom package for version 3.13.1 in /home. So we would use the following command:

./generate_debian_package.sh -b v3.13.1 -t agent -p /home

(-b to indicate wazuh branch version and -p to set the installation path. You can see all available parameters using -h)

- After waiting for the process to finish, you can find the package in the output directory.

- If we install that custom package, we see how the installation directory has been set correctly

root@ubuntu:~# cat /etc/ossec-init.conf
DIRECTORY
="/home"
NAME
="Wazuh"
VERSION
="v3.13.1"
REVISION
="31309"
DATE
="Mon Aug 31 08:13:59 UTC 2020"
TYPE
="agent"

Note: Be careful if you specify the path /home, because the result you would have would be the following:

root@ubuntu:/home# ls /home
active
-response  agentless  backup  bin  etc  lib  logs  queue  ruleset  tmp  ubuntu  vagrant  var  wodles

(Perhaps in this case it would be better /home/ossec or /home/wazuh ... /home/whatever_you_want )

I hope this information is helpful to you :)

Best regards.

Sayontani Bose

unread,
Sep 2, 2020, 1:57:23 AM9/2/20
to Wazuh mailing list
Hi Jonathan Martín Valera,

Thanks for sharing the solution but whenever i m trying to generate rpm packages for manager it throws a error . Below i m sharing my error . Can you have solution for this ??

error: libarchive-3.1.2-12.el7.src.rpm cannot be installed
Installing libarchive-3.1.2-12.el7.src.rpm The command '/bin/sh -c curl -O http://vault.centos.org/7.7.1908/os/Source/SPackages/libarchive-3.1.2-12.el7.src.rpm && rpmbuild --rebuild libarchive-3.1.2-12.el7.src.rpm && rpm -Uvh /root/rpmbuild/RPMS/x86_64/* --nodeps' returned a non-zero code: 1

Thanks & Regards
Sayontani Bose

Jonathan Martín Valera

unread,
Sep 2, 2020, 3:21:22 AM9/2/20
to Wazuh mailing list
Hi Sayontani Bose,

Could you describe to me the process you have gone through to build the package?

In my case, I just built a manager package for 3.13.1 and it has been successfully completed. The steps I have followed are as follows:

- Clone wazuh-packages repository


- Go to RPM generation folder

cd wazuh-packages/rpms

- Build manager v3.13.1 RPM package

./generate_rpm_package.sh -b v3.13.1 -p /home/ossec -t manager

Best regards.

Sayontani Bose

unread,
Sep 2, 2020, 4:45:43 AM9/2/20
to Wazuh mailing list
Hi Jonathan,

In my case, I just built a manager package for 3.13.1 and it has been successfully completed. The steps I have followed are as follows :

- Clone wazuh-packages repository


- Go to RPM generation folder

cd wazuh-packages/rpms

- Build manager v3.13.1 RPM package

./generate_rpm_package.sh -b v3.13.1 -p /home/ossec -t manager

While processing the third step it throws above error which i have mentioned . Can you have a solution?

Thanks & Regards
Sayontani Bose


Jonathan Martín Valera

unread,
Sep 2, 2020, 10:00:29 AM9/2/20
to Wazuh mailing list
Hi Sayontani Bose,

I need more information to help you.

- What version of Wazuh are you trying to generate the package for?

- Can you write the command you are using to generate the package?

- Can you share the complete trace of the result of executing the command to generate the package?

Best regards.

Martijn Groenewegen

unread,
Sep 4, 2020, 8:50:12 AM9/4/20
to Jonathan Martín Valera, Wazuh mailing list
Keep in mind that if you use this process the automatic upgrade doesnt work anymore when you upgrade the manager, you have to create a custom package then also it dosnt honor the path its currently installed in. I dont know the reason for the current installation path but i dont see why /opt wouldnt be a better location for the default installer

--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/d412bc63-c72b-4b19-9622-9c9c0ba5e2eeo%40googlegroups.com.

Sayontani Bose

unread,
Sep 8, 2020, 12:46:59 AM9/8/20
to Wazuh mailing list
Hi

Thanks for the help now its solved !!!

Best Regards

Scott Ruckh

unread,
Feb 11, 2021, 12:21:13 PM2/11/21
to Wazuh mailing list
I am having the same problem as above.

Tried to run this command from CentOS 7.9 server:

./generate_rpm_package.sh -b v3.13.2 -s /tmp -t api -a x86_64

docker components:
docker-1.13.1-203.git0be3e21.el7.centos.x86_64
docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64
docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64

Started having problems here during the build process:

Reference files will be read from: /root/rpmbuild/BUILD/libarchive-3.1.2/tar/test
Running tests on: "/root/rpmbuild/BUILD/libarchive-3.1.2/bsdtar"
Exercising: bsdtar 3.1.2 - libarchive 3.1.2

First sign of problem:
35: test_option_newer_than                            new.txt: Cannot restore extended attributes on this file system
a/b/: (null)
a/b/new.txt: (null)
lt-bsdtar: Error exit delayed from previous errors.
new.txt: Cannot restore extended attributes on this file system
a/b/: (null)
a/b/new.txt: (null)
lt-bsdtar: Error exit delayed from previous errors.

Finally ending with error mentioned above:
The command '/bin/sh -c curl -O https://packages.wazuh.com/utils/libarchive/libarchive-3.1.2-12.el7.src.rpm &&     rpmbuild --rebuild libarchive-3.1.2-12.el7.src.rpm && rpm -Uvh /root/rpmbuild/RPMS/x86_64/* --nodeps && rm -rf libarchive-*' returned a non-zero code: 1

I did not see solution although OP seemed to get it working.





Reply all
Reply to author
Forward
0 new messages