Tuesday, November 10, 2020

How To Install Fathom Analytics with Apache on Ubuntu 18.04 LTS

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 Fathom is a self-hosted open source web analytics platform that provides simple, useful website statistics without tracking or storing your users' personal information. It is a very good alternative to Google Analytics with a simple web interface that can be used for small and medium businesses. Fathom gives you full control over your data without using third-party solutions. Fathom offers you top pages, top referrers, bounce rate and average time spent on your website.
Offcial Website: https://usefathom.com/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Our Server Specification-     
Os:Ubuntu 18.04 LTS Bionic Beaver 64Bit   |IP address- 192.168.1.50  | Hostname :www.yourdomain.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd ; hostname ; hostname -I ; whoami ; getconf LONG_BIT

MariaDB Repositories:
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 ; add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.biznetgio.com/mariadb/repo/10.4/ubuntu bionic main'

apt update ; apt install -y build-essential software-properties-common curl gdebi net-tools wget curl sqlite3 dirmngr nano lsb-release apt-transport-https leafpad apache2 mariadb-server

a2enmod proxy proxy_http ; mysql_secure_installation

Create Mariadb Database :
mysql -u root -p
create database db;
grant all on db.* to 'dbuser'@'localhost' identified by 'dbpass';
flush privileges;
quit

wget https://github.com/usefathom/fathom/releases/download/latest-development/fathom-linux-amd64
mv fathom-linux-amd64 /usr/local/bin/fathom  ; chmod 755 /usr/local/bin/fathom

leafpad .env &>/dev/null
FATHOM_SERVER_ADDR=9000
FATHOM_DEBUG=true
FATHOM_DATABASE_DRIVER="mysql"
FATHOM_DATABASE_NAME="db"
FATHOM_DATABASE_USER="dbuser"
FATHOM_DATABASE_PASSWORD="dbpass"
FATHOM_DATABASE_HOST="localhost"
FATHOM_DATABASE_SSLMODE=""
FATHOM_SECRET="random-secret-string"

fathom --config=.env user add --email=admin@yourdomain.com.com --password=yourpassword123
fathom server

nano /etc/systemd/system/fathom.service
[Unit]
Description=Fathom server management service unit
Requires=network.target
After=network.target

[Service]
Type=simple
User=root
Restart=always
RestartSec=3
WorkingDirectory=/root
ExecStart=/usr/local/bin/fathom server

[Install]
WantedBy=multi-user.target
systemctl daemon-reload ; systemctl enable fathom ; systemctl start fathom ; systemctl status fathom

leafpad /etc/apache2/sites-available/yourdomain.conf &>/dev/null
<VirtualHost *:80>
    ServerName yourdomain.com
    ServerAdmin admin@yourdomain.com
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:9000/
    ProxyPassReverse / http://127.0.0.1:9000/
    TransferLog /var/log/apache2/yourdomain_access.log
    ErrorLog /var/log/apache2/yourdomain_error.log
</VirtualHost>

a2ensite yourdomain ; a2dissite 000-default.conf  ; apache2ctl configtest ; echo "192.168.1.50 www.yourdomain.com" >> /etc/hosts ; systemctl reload apache2
http://www.yourdomain.com

Example email=admin@yourdomain.com.com  || password=yourpassword123

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Saturday, November 7, 2020

How To Install Fae CMS (Ruby On Rails) on Ubuntu 18.04

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 Fae: A Formidable Rails CMS
Fae CMS is an open source content management system (CMS) for Ruby on Rails ||
Offcial Website: https://www.faecms.com/documentation
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Our Server Specification-     
Os:Ubuntu 18.04 LTS Bionic Beaver 64Bit   | IP address- 192.168.1.50  | Hostname :www.yourdomain.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd ; hostname ; hostname -I ; whoami ; getconf LONG_BIT ; apt update ; apt install -y build-essential software-properties-common git curl gdebi net-tools wget sqlite3 dirmngr nano lsb-release apt-transport-https -y

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

apt-get update ; apt-get install nodejs yarn zlib1g-dev build-essential libpq-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev -y

cd ~/ ; git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

rbenv install 2.5.3
rbenv global 2.5.3
gem install bundler
gem install rails -v 5.2.3
rbenv rehash

rails new faecms
cd ~/faecms
nano Gemfile
gem 'fae-rails'
bundle install
rails g fae:install
rails server --binding=0.0.0.0
http://localhost:3000/admin

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thursday, November 5, 2020

How To Install OrangeScrum with Apache2 on Ubuntu 18.04 LTS

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 OrangeScrum is a free and open source project management and collaboration tool written in PHP with CakePHP framework. It is simple, easy to use and ideal for small or medium businesses. It is used to manage projects, teams, documents, task, and communicate with the team on important issues. Orangescrum comes with lots of features like, Visual representation, kanban view, All in one screen, daily email catch-up, Gantt Charts, conversation thread, ticketing system, Dropbox integration, and many more. You can easily collaborate with Employees, Leaders, Clients and Freelancers from the central location.
Offcial Website: https://www.orangescrum.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Our Server Specification-     
Os:Ubuntu 18.04 LTS Bionic Beaver 64Bit   |IP address- 192.168.1.50  | Hostname :www.yourdomain.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd ; hostname ; hostname -I ; whoami ; getconf LONG_BIT ; apt install -y build-essential software-properties-common curl gdebi net-tools wget curl sqlite3 dirmngr nano lsb-release apt-transport-https leafpad

MariaDB Repositories:
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 ; add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.biznetgio.com/mariadb/repo/10.4/ubuntu bionic main'

Apache2 Mariadb Php PHP Modules :
add-apt-repository ppa:ondrej/php -y
apt-get update ; apt install -y apache2 mariadb-server mariadb-client php7.2 php7.2-cli php7.2-fpm php7.2-cgi php7.2-bcmath php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-sqlite3 php7.2-xml php7.2-zip php7.2-snmp php7.2-json php7.2-imap php7.2-common php7.2-tidy php7.2-pgsql php7.2-ldap php-imagick php-pear php7.2-enchant php-memcache xvfb libfontconfig wkhtmltopdf

systemctl start apache2 mariadb ; systemctl enable apache2 mariadb ; mysql_secure_installation
mysql -u root -p
SHOW VARIABLES LIKE 'sql_mode';
set global sql_mode='';
set global sql_mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

a2enmod headers rewrite ; phpenmod mbstring ; sed -i "s/;date.timezone.*/date.timezone = Asia\/\Kolkata/" /etc/php/*/apache2/php.ini ; echo ServerName 127.0.0.1 >> /etc/apache2/apache2.conf

Create Mariadb Database :
mysql -u root -p
CREATE DATABASE orangescrumdb;
GRANT ALL PRIVILEGES ON orangescrumdb.* TO 'orangescrumuser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;

Orangescrum Download Link: https://www.orangescrum.org/free-download
Select installation package - PHP7.2-(Manual) - ( i already Downloaded it )

ls /home/ubuntu/Downloads/
unzip /home/ubuntu/Downloads/orangescrum-master.zip -d /var/www/html/
mv /var/www/html/orangescrum-php72/ /var/www/html/orangescrum
leafpad /var/www/html/orangescrum/app/Config/constants.php &>/dev/null
_____________________________________________________________________________________________________
important Part:
SMTP setting:
ssl://smtp.gmail.com
Smtp Port: 465
SMTP Username: (your Gmail username Or smtp username )  
SMTP Password: (your Gmail password Or smtp Account Password )

define("WEB_DOMAIN", "www.yourdomain.com"); //ex. demo.orangescrum.com
define('FROM_EMAIL_NOTIFY', 'your Gmail username'); //(REQUIRED)
define('SUPPORT_EMAIL', 'your Gmail username'); //(REQUIRED) From Email
______________________________________________________________________________________________________

leafpad /var/www/html/orangescrum/app/Config/database.php &>/dev/null      [ class DATABASE_CONFIG { ]
chown -R www-data:www-data /var/www/html/ ; chmod -R 755 /var/www/html/
cd /var/www/html/orangescrum ; mysql -u orangescrumuser -p orangescrumdb < database.sql   

Setting up Apache VirtualHost :
leafpad /etc/apache2/sites-available/yourdomain.conf &>/dev/null
<VirtualHost *:80>

     ServerAdmin admin@yourdomain.com
     DocumentRoot /var/www/html/orangescrum/
     ServerName www.yourdomain.com

     <Directory /var/www/html/orangescrum/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/yourdomain_error.log
     CustomLog ${APACHE_LOG_DIR}/yourdomain_access.log combined

</VirtualHost>

a2ensite yourdomain ; a2dissite 000-default.conf  ; apache2ctl configtest ; echo "192.168.1.50 www.yourdomain.com" >> /etc/hosts ; systemctl reload apache2
http://www.yourdomain.com

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Friday, October 30, 2020

How To Deploy MariaDB on Docker Without Dockerfile On Ubuntu 20.04

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

MariaDB is an open source relational database management system (DBMS).

Docker is an open source virtualization and containerization technology for building and containerizing your applications. It's a tool that allows you to create isolated containers that can be used to run your apps.
Offcial Website -https://www.docker.com/

MariaDB Dockerhub link - https://hub.docker.com/_/mariadb
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Testing Environment:
Ubuntu 20.04 LTS                     Hostname - www.yourdomain.com  - ip Address - 192.168.1.10  
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common neofetch apt-transport-https ca-certificates curl gnupg-agent docker.io docker-compose

systemctl enable --now docker ; docker --version ; docker-compose version
usermod -aG docker $USER ; newgrp docker

docker pull mariadb
docker run -d --name mariadb1 \
-p 33061:3306 \
-v ~/Docker/mariadb1/config:/etc/mysql/conf.d \
-v ~/Docker/mariadb1/datadir:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=root123 \
-e MYSQL_DATABASE=dbtest \
mariadb

docker ps
docker logs mariadb1
docker exec -it mariadb1 bash
mysql --user=root --password=root123
show databases;


Container-id -

Container-id -           $ docker ps -aq                         
Stop Container -         $ docker stop ed2896902b49                 
Start Container -        $ docker start ed2896902b49
Check Container logs-    $ docker logs ed2896902b49
Delete a Docker Image -  $ docker rmi ed2896902b49

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Tuesday, October 27, 2020

How To Setup And Configure Mailcow Server On Ubuntu 18.04 LTS

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 Mailcow is a lightweight mailserver suite based on multiple packages, like DoveCot, Postfix and many other open-source packages.
Offcial Website: https://mailcow.email/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Our Server Specification-     
Os:Ubuntu 18.04 LTS Bionic Beaver 64Bit   | IP address- 192.168.1.50  | Hostname :www.yourdomain.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd ; hostname ; hostname -I ; whoami ; getconf LONG_BIT ; apt update ; apt install -y build-essential software-properties-common curl gdebi net-tools wget sqlite3 dirmngr nano lsb-release apt-transport-https ca-certificates curl gnupg-agent -y

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

apt update ; apt-get install docker-ce docker-ce-cli containerd.io -y
docker run hello-world

curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
usermod -aG docker $USER

cd /opt
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized

./generate_config.sh
docker-compose pull
docker-compose up -d
https://www.yourdomain.com
admin/moohoo

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Friday, October 23, 2020

How To Install OpenCMS with Nginx Mariadb On Ubuntu 18.04

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 OpenCMS is an opensource content management framework based on Java… It helps content managers to create and maintain beautiful websites fast and efficiently….. Developed by Alkacon Software, it supports multi-language, multi-site on an enterprise-scale |
Offcial Website: http://www.opencms.org/en/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Our Server Specification-     
Os:Ubuntu 18.04 LTS Bionic Beaver 64Bit   | IP address- 192.168.1.50  | Hostname :www.yourdomain.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd ; hostname ; hostname -I ; whoami ; getconf LONG_BIT ; echo $JAVA_HOME ; java -version ; javac -version
JAVA_HOME:/usr/java/jdk-12.0.2

apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 ; add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.biznetgio.com/mariadb/repo/10.4/ubuntu bionic main'

apt update ; apt install -y build-essential software-properties-common curl gdebi net-tools wget sqlite3 dirmngr nano lsb-release apt-transport-https mariadb-server mariadb-client nginx -y
mysql_secure_installation

Mariadb Username/Pass: root/password

groupadd tomcat ; useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
cd /opt/ ; wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.8/bin/apache-tomcat-9.0.8.tar.gz
tar -xzvf apache-tomcat-9.0.8.tar.gz ; mv apache-tomcat-9.0.8/ tomcat/
chmod -R 777 /opt/tomcat/ ; chown tomcat:tomcat -R /opt/tomcat/
nano ~/.bashrc
export CATALINA_HOME=/opt/tomcat
source ~/.bashrc ; echo $CATALINA_HOME

nano /etc/systemd/system/apache-tomcat.service
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking
Environment=JAVA_HOME=/usr/java/jdk-12.0.2
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target
systemctl daemon-reload ; systemctl start apache-tomcat ; systemctl enable apache-tomcat ; systemctl status apache-tomcat

leafpad /opt/tomcat/conf/tomcat-users.xml &>/dev/null
<tomcat-users>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="admin-gui,manager-gui"/>
</tomcat-users>
leafpad /opt/tomcat/webapps/manager/META-INF/context.xml &>/dev/null
<!-- -->
leafpad /opt/tomcat/webapps/host-manager/META-INF/context.xml &>/dev/null
<!-- -->


nano /etc/nginx/conf.d/yourdomain.conf
server {
  listen 80;
  server_name www.yourdomain.com;

  access_log /var/log/nginx/yourdomain.com_access.log;
  error_log /var/log/nginx/yourdomain.com_error.log;
  location / {
     proxy_pass http://127.0.0.1:8080;
     proxy_set_header Host $host;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
rm /etc/nginx/sites-enabled/default
nginx -t  ; echo "192.168.1.50 www.yourdomain.com" >> /etc/hosts ; systemctl restart nginx  

cd /tmp && wget http://www.opencms.org/downloads/opencms/opencms-11.0.0.zip
unzip opencms-11.0.0
mv opencms.war /opt/tomcat/webapps/opencms.war ; chown tomcat:tomcat /opt/tomcat/webapps/opencms.war
systemctl restart apache-tomcat

http://www.yourdomain.com
http://www.yourdomain.com/opencms/setup

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thursday, October 22, 2020

How To Install Monica Personal Relationship Manager with Nginx on Ubuntu 18.04 LTS

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 Monica is a free, open source web-based Personal Relationship Management software written in the Laravel framework. It is used to keep track of all the important details about your friends and family. You can easily add and manage contacts, define relationships between contacts, set auto reminders for birthdays using Monica. You can also track conversations made on social media or SMS using Monica. Monica has an ability to define what section should appear on the contact sheet.
Offcial website:https://www.monicahq.com/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Our Server Specification-     
Os:Ubuntu 18.04 LTS Bionic Beaver 64Bit   | IP address- 192.168.1.50 | Hostname :www.yourdomain.com
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lsb_release -cd ; hostname ; hostname -I ; whoami ; getconf LONG_BIT ; apt install -y build-essential software-properties-common curl gdebi net-tools wget sqlite3 dirmngr nano lsb-release apt-transport-https git leafpad git

MariaDB Repositories:
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 ; add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.biznetgio.com/mariadb/repo/10.4/ubuntu bionic main'

Nginx Mariadb Php PHP Modules :
curl -sL https://deb.nodesource.com/setup_10.x | bash -
add-apt-repository ppa:ondrej/php -y
apt-get update ; apt install -y nginx mariadb-server mariadb-client php7.2 php7.2-cli php7.2-fpm php7.2-cgi php7.2-bcmath php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-sqlite3 php7.2-xml php7.2-zip php7.2-snmp php7.2-json php7.2-imap php7.2-common php7.2-tidy php7.2-pgsql php7.2-ldap php-imagick php-pear nodejs

systemctl start nginx mariadb ; systemctl enable nginx mariadb ; mysql_secure_installation

Create Mariadb Database :
mysql -u root -p
create database db;
grant all on db.* to 'dbuser'@'localhost' identified by 'dbpass';
flush privileges;
quit

sed -i "s/;date.timezone.*/date.timezone = Asia\/\Kolkata/" /etc/php/7.2/fpm/php.ini ; sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.2/fpm/php.ini
leafpad  /etc/php/7.2/fpm/pool.d/www.conf &>/dev/null  env[HOSTNAME] = $HOSTNAME ]

curl -sS https://getcomposer.org/installer | php ; mv composer.phar /usr/local/bin/composer ; chmod +x /usr/local/bin/composer

mkdir -p /var/www/html/monica ; cd /var/www/html/monica
git clone https://github.com/monicahq/monica.git .
git checkout tags/v2.1.1
mv .env.example .env
nano .env
composer install --no-interaction --no-suggest --no-dev --ignore-platform-reqs
npm install

npm install --save v-tooltip
npm install --save vue-directive-tooltip/css/index.css
npm run production
php artisan key:generate
php artisan setup:production
chown -R www-data:www-data /var/www/html/ ; chmod -R 755 /var/www/html/


Setting up Nginx Server Blocks (Virtual Hosts):-
gedit /etc/nginx/sites-available/default &>/dev/null
server {
    server_name www.yourdomain.com;

    access_log /var/log/nginx/yourdomain-access.log;
    error_log /var/log/nginx/yourdomain-error.log;
    root /var/www/html/monica/public/;

    location / {
        index index.php;
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

nginx -t  ; echo "192.168.1.50 www.yourdomain.com" >> /etc/hosts ; systemctl restart nginx mariadb
http://www.yourdomain.com

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------