# Serverinstallation Linux

The following steps describe how to install on a Debian 10 server. Generally you can try to install on other Linux systems.

This may work if all Squeeze dependencies like the correct PHP version, PHP modules and Apache extensions are present in your operating systems package repositories.

### Linux (Debian 10)

#### 1. Prepare Debian for installation via apt

Before installing Squeeze some third party applications need to be installed. Follow the steps below to install these applications.

<p class="callout info">Please note that using a proxy to connect to the internet might need some additional configuration like:  
  
`export https_proxy=<a href="https://proxy.intra.net/">https://proxy.intra.net</a>:proxy_port`  
or  
`export http_proxy=<a href="http://user/">http://user</a>:<a href="mailto:password@proxy.intra.net">password@proxy.intra.net</a>:proxy_port`</p>

```shell
apt update
apt upgrade
```

#### 2. Install PHP 7.4

```shell
apt-get update
apt-get install php7.4 php7.4-cli php7.4-common php7.4-imap php7.4-mysql php7.4-mailparse php7.4-bcmath php7.4-intl php7.4-gd php7.4-xml php7.4-xsl php7.4-mbstring php7.4-opcache php7.4-curl php7.4-zip php7.4-bz2 php7.4-soap php7.4-json php7.4-imagick libapache2-mod-php7.4
```

#### 3. Install Apache

To install Apache run the following command

```shell
apt install apache2
```

And enable the following modules

```hljs
a2enmod proxy rewrite deflate filter headers
```

#### 4. Install MariaDB

```shell
apt update
apt install mariadb-server
systemctl status mariadb
```

run the follwing command and follow the instructions to secure the installation:

```shell
mysql_secure_installation
```

Create a new user for later use

```shell
mysql --user=root mysql
```

```SQL
CREATE USER 'squeeze'@'localhost' IDENTIFIED BY 'secret';
GRANT ALL PRIVILEGES ON *.* TO 'squeeze'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
```

#### 5. Install RabbitMQ

Run the following command to install RabbitMQ including the management web interface

```hljs
apt-get install rabbitmq-server
rabbitmq-plugins enable rabbitmq_management

```

If needed add a new user to RabbitMQ

```shell
rabbitmqctl add_user username password
rabbitmqctl set_user_tags username administrator
rabbitmqctl set_permissions -p / username ".*" ".*" ".*"
```

#### 6. Install ElasticSearch

Run the following command to install ElasticSearch

```shell

nano /etc/apt/sources.list
deb http://ftp.us.debian.org/debian sid main

apt-get update
apt install openjdk-8-jre-headless

apt install gnupg2
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list
apt update && apt upgrade
apt install apt-transport-https uuid-runtime pwgen
apt update
apt install elasticsearch

cd /usr/share/elasticsearch/bin 
./elasticsearch-plugin install analysis-icu
./elasticsearch-plugin install mapper-attachments

```

<p class="callout info">To be able to install the plugins behind a proxy please use the following commands:</p>

<div data-lang="hljs css sh" id="bkmrk-es_java_opts%3D%22-dhttp"><div data-lang="hljs css sh"><textarea style="display: none;">ES\_JAVA\_OPTS="-Dhttp.proxyHost=proxy.intra.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.intra.net -Dhttps.proxyPort=3128" ./elasticsearch-plugin install analysis-icu ES\_JAVA\_OPTS="-Dhttp.proxyHost=proxy.intra.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.intra.net -Dhttps.proxyPort=3128" ./elasticsearch-plugin install mapper-attachments </textarea></div></div>```shell
ES_JAVA_OPTS="-Dhttp.proxyHost=proxy.intra.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.intra.net -Dhttps.proxyPort=3128" ./elasticsearch-plugin install analysis-icu 
ES_JAVA_OPTS="-Dhttp.proxyHost=proxy.intra.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.intra.net -Dhttps.proxyPort=3128" ./elasticsearch-plugin install mapper-attachments
```

Optional:

```shell
nano /etc/elasticsearch/elasticsearch.yml
cluster.name: my-applicationnano 

/etc/elasticsearch/jvm.options
-Xms512m
-Xmx512m
```

Enable and start ElasticSearch

```shell
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl restart elasticsearch.service
systemctl status elasticsearch.service
```

<div data-lang="hljs css sh" id="bkmrk-7.-install-additiona"><div><span style="color: #222222; font-size: 1.666em; font-weight: 400;">7. Install additional tools</span></div></div>```
apt install tesseract-ocr tesseract-ocr-deu imagemagick ghostscript poppler-utils zbar-tools git sudo
```

#### 8. Install Squeeze

```shell
cd /var/www/html
git clone https://git.dexpro-solutions.de/dex/squeeze/Squeeze.git

chown -R www-data Squeeze/
chmod -R 775 Squeeze/
```

<div data-lang="shell" id="bkmrk-edit-the-default-vir"><div><div><div><div>Edit the default virtual host or create a new virtual host:  
  
</div></div></div></div></div>```shell
nano /etc/apache2/sites-enabled/000-default.conf

DocumentRoot /var/www/html/Squeeze/public
<Directory "/var/www/html/Squeeze/public">
    AllowOverride All
</Directory>
```

Now restart the apache webserver:

```shell
systemctl restart apache2
```

#### 9. Web installer

Once the installer finished, start your preferred browser and open [http://localhost](http://localhost) to run the web installer