OCS Reports - Install on Debian 10 Kategoria: Linux | Tagi: debian, debian10, OCS | Autor: Bartłomiej Gałęzia

1. Packages

apt-get update
apt-get install aptitude sudo vim mc nmap screen make cmake gcc make apache2 libapache2-mod-perl2 libapache-dbi-perl libapache-db-perl libapache2-mod-php mariadb-server mariadb-client software-properties-common php7.3 libapache2-mod-php7.3 php7.3-common php7.3-sqlite3 php7.3-mysql php7.3-gmp php7.3-curl php7.3-mbstring php7.3-gd php7.3-cli php7.3-xml php7.3-zip php7.3-soap php7.3-json php-pclzip git curl perl libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libnet-ip-perl libsoap-lite-perl libio-compress-perl libapache-dbi-perl libapache2-mod-perl2 libapache2-mod-perl2-dev

2. Mysql

sudo mysql_secure_installation
sudo mysql -u root -p

3. Apache config

vim /etc/php/7.3/apache2/php.ini
file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360

4. Database

sudo mysql -u root -p
CREATE DATABASE ocs;
CREATE USER 'ocsuser'@'localhost' IDENTIFIED BY 'new_password_here';
GRANT ALL ON ocs.* TO 'ocsuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

5. Perl

cpan -f Archive::Zip
sudo perl -MCPAN -e 'install Apache2::SOAP' && sudo perl -MCPAN -e 'install XML::Entities' && sudo perl -MCPAN -e 'install Net::IP' && sudo perl -MCPAN -e 'install Apache::DBI' && sudo perl -MCPAN -e 'install Mojolicious' && sudo perl -MCPAN -e 'install Switch' && sudo perl -MCPAN -e 'install Plack::Handler'

6. Install OCS

cd /tmp
git clone https://github.com/OCSInventory-NG/OCSInventory-Server.git
cd OCSInventory-Server
git clone https://github.com/OCSInventory-NG/OCSInventory-ocsreports.git ocsreports
cd /tmp/OCSInventory-Server/ocsreports
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
sudo composer install
cd ..
vim setup.sh
DB_SERVER_USER="ocsuser"
DB_SERVER_PWD="new_password_here"
./setup.sh

7. After Install

sudo ln -s /etc/apache2/conf-available/ocsinventory-reports.conf /etc/apache2/conf-enabled/ocsinventory-reports.conf
sudo ln -s /etc/apache2/conf-available/z-ocsinventory-server.conf /etc/apache2/conf-enabled/z-ocsinventory-server.conf
sudo ln -s /etc/apache2/conf-available/zz-ocsinventory-restapi.conf /etc/apache2/conf-enabled/zz-ocsinventory-restapi.conf
sudo chown -R www-data:www-data /var/lib/ocsinventory-reports
service apache2 restart

http://localhost/ocsreports/install.php

sudo mv /usr/share/ocsinventory-reports/ocsreports/install.php /usr/share/ocsinventory-reports/ocsreports/install.php.bak

https://websiteforstudents.com/how-to-install-ocs-inventory-server-on-ubuntu-18-04-16-04/

8. Debuging

vim /etc/apache2/conf-enabled/zz-ocsinventory-restapi.conf
  $ENV{OCS_DB_LOCAL} = 'ocs';
  $ENV{OCS_DB_USER} = 'ocsuser';
  $ENV{OCS_DB_PWD} = 'new_password_here';
vim /etc/apache2/conf-enabled/z-ocsinventory-server.conf
  PerlSetEnv OCS_DB_NAME ocs
  PerlSetEnv OCS_DB_LOCAL ocs
  PerlSetEnv OCS_DB_USER ocsuser
  PerlSetVar OCS_DB_PWD new_password_here

https://ocsinventory12.rssing.com/chan-50766537/article3077-live.html

Dodaj komentarz

Brak komentarzy, bądź pierwszy i dodaj swój komentarz