Skip to content

Instantly share code, notes, and snippets.

@putztzu
Last active November 27, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save putztzu/2aa95ae5f4989e83e963daad4e1e9cdc to your computer and use it in GitHub Desktop.
Save putztzu/2aa95ae5f4989e83e963daad4e1e9cdc to your computer and use it in GitHub Desktop.
Install ocsinventory from source on openSUSE LEAP 15.2
## Add and activate PHP repository for 15.2
zypper -n ar -f http://download.opensuse.org/repositories/devel:/languages:/php/openSUSE_Leap_15.2/ PHP_repo
## Add and activate Perl repository for 15.2
zypper -n ar -f http://download.opensuse.org/repositories/devel:/languages:/perl/openSUSE_Leap_15.2/ Perl5_repo
## Private Padom repository for php7-imap
zypper -n ar -f https://download.opensuse.org/repositories/home:/Padom/openSUSE_Leap_15.2/ Private_Padom_repo_for_php7-imap
## Refresh repos
zypper --gpg-auto-import-keys ref
## Install general purpose utilities
zypper -n in git
## Install Perl prerequisites
zypper -n in perl-DBD-mysql perl-XML-Simple perl-Compress-Zlib perl-DBI perl-Apache-DBI perl-Net-IP perl-SOAP-Lite perl-Archive-Zip perl-Mojolicious perl-Plack perl-XML-Entities perl-Switch
## Install PHP prerequisites
zypper -n in perl-XML-Simple perl-DBI perl-Net-IP php7-gd php7-devel libzip-devel
## Install PECL utility to access PHP Extensions repository
zypper -n in php7-pecl
(
## PECL commands
pecl channel-update pecl.php.net
## Install PHP Extensions
pecl install zip
exit
)
## enable zip PHP extension
ex /etc/php7/cli/php.ini <<eof
/;extension=bz2/ insert
extension=zip
.
xit
eof
## Install LAMP server (Apache2, PHP, Mariadb), php7-imap, C build tools and YaST http server module
zypper -n in -t pattern lamp_server
zypper -n in apache2-mod_perl php7-imap yast2-http-server
## Start and enable Apache and MariaDB
systemctl start apache2
systemctl enable apache2
systemctl start mariadb
systemctl enable mariadb
## Run Mariadb Security Configuration
## For more information on this use of a Here Doc to provide these settings to an interactive script
## See https://en.opensuse.org/User:Tsu2/MySQL_and_Mariadb
## Please Change "1234" to your own MySQL Admin password
mysql_secure_installation <<EOF
y
1234
1234
y
y
y
EOF
## Install OCSinventory
## This installs the main branch
## If you instead wish to install the current official stable release, comment (##) the following line and remove the comments from the 2.8 branch
## Some tidiness I prefer. Creates a github subdirectory in root home directory for github projects
mkdir ~/github
## Following installs the OCSinventory main branch which I assume is the Development branch
git clone https://github.com/OCSInventory-NG/OCSInventory-Server.git ~/github/ocsinventory
## git clone https://github.com/OCSInventory-NG/OCSInventory-Server.git -b release2.8 ~/github/ocsinventory
## Run the OCSinventory setup
cd ~/github/ocsinventory
./setup.sh
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment