Thursday, April 15, 2021

Install Composer in MacOS Catalina

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Local or specific Directory: 
php composer-setup.php --install-dir=bin --filename=composer

Global: 
mv composer.phar /usr/local/bin/composer




Note: If the above fails due to permissions, you may need to run it again with sudo.
Note: On some versions of macOS the /usr directory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding: mkdir -p /usr/local/bin.


You can also follow instruction from: https://getcomposer.org/download/






Install extensions for PHP 7.4 on Ubuntu 20

sudo apt-get install php7.4-cli php7.4-fpm php7.4-bcmath php7.4-curl php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-sqlite3 php7.4-xml php7.4-zip


or 

sudo apt update
sudo apt install php7.4
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

Tuesday, April 13, 2021

Mautic Cronjob Setup

 Mautic Cron Jobs are as follows:


#Segments Every 2 Minutes

*/2 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:segments:update

*/3 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:import


#Campaigns (Every 1 Minute)

* * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:campaigns:update 

* * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:campaigns:trigger

* * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:messages:send


#Process Email Queue Every 5 Minutes

*/5 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:emails:send #Fetch and Process Monitored Email Every 10 Minutes

*/10 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:email:fetch


#Process Email Queue Every 5 Minutes

*/5 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:emails:send


#Fetch and Process Monitored Email Every 10 Minutes

*/10 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:email:fetch


Leave a line between cron jobs



Friday, March 19, 2021

Disable Apacche in Mac

 sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist

Thursday, February 25, 2021

How to install Fully Featured Mail Server using Postal on Ubuntu 16.04

Prerquisites:
Ruby 2.3 or higher
MySQL or MariaDB database server
Erlang
RabbitMQ server
Node.js (for javascript compilation)
Git (for accessing the repository)
Nginx

Installing dependencies:

Install Ruby

sudo apt install software-properties-common
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt update
sudo apt install ruby2.3 ruby2.3-dev build-essential

Install MySQL

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.coreix.net/mariadb/repo/10.1/ubuntu xenial main'
sudo apt update
sudo apt install mariadb-server libmysqlclient-dev
Some additional configuration may be required to optimise your MySQL server. This is outside the scope of this documentation.

Install Erlang
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb 
sudo dpkg -i erlang-solutions_1.0_all.deb

sudo apt-get update sudo apt-get install erlang

sudo apt-get update sudo apt-get install esl-erlang

If there is any issue while installing Erlang then use the following command:
sudo apt-get purge elixir
sudo apt-get purge erlang
sudo apt-get install esl-erlang

Install RabbitMQ

curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.deb.sh | sudo bash
sudo apt update
sudo apt-get install apt-transport-https
sudo apt install rabbitmq-server

Install Node.js

sudo apt install nodejs
Install Git

sudo apt install git
There is documentation for installing the core prerequisites if needed.
Preparing the database

Postal has a single main MySQL database that contains all configuration and each mail server you create will have its own database that stores its messages and other mail-server specific content. No configuration is stored in the mail server databases.
mysql -u root -p -h 127.0.0.1
Begin by creating your main database. Run the commands below to create a new database. Replace XXX with a suitable password.

CREATE DATABASE `postal` CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL ON `postal`.* TO `postal`@`127.0.0.1` IDENTIFIED BY "XXX";
Postal will handle the creation of databases for your mail servers but you need to give it access to do this. Run the following to add a grant that permits a user to manage all databases that are prefixed with postal-.

GRANT ALL PRIVILEGES ON `postal-%` . * to `postal`@`127.0.0.1`  IDENTIFIED BY "XXX";
Setting up RabbitMQ

Postal requires its own RabbitMQ vhost and user to connect with. You can create these using the following commands:

sudo rabbitmqctl add_vhost /postal
sudo rabbitmqctl add_user postal XXX
sudo rabbitmqctl set_permissions -p /postal postal ".*" ".*" ".*"
Preparing your operating system

Postal should be executed as its own user on your server. Run the following commands to create a new user with a home directory in /opt/postal.

sudo useradd -r -m -d /opt/postal -s /bin/bash postal
Postal needs to be able to listen on privileged ports (for example 80, 443 and 25). To enable this, we will allow ruby to listen on these ports. On a shared server this would be a security risk however on a server dedicated to Postal, this shouldn't cause any issues.

sudo setcap 'cap_net_bind_service=+ep' /usr/bin/ruby2.3
Installing system-wide gems

To run Postal, you'll need to have bundler and procodile installed on your system. Install them both:

sudo gem install bundler
sudo gem install procodile
Cloning the repository

Now, we're ready to get the repository cloned onto your server. Run the clone command as your postal user and clone into the /opt/postal/app directory.

sudo -i -u postal git clone https://github.com/atech/postal /opt/postal/app
The master branch (which is cloned by default) will contain the most stable version of the software. If you wish to work with a less stable branch, use the devel branch.
Postal provides a single binary that allows you to interact with it from any directory on your server. To make this available everywhere, simply symlink it into the /usr/bin/postal directory.

sudo ln -s /opt/postal/app/bin/postal /usr/bin/postal
Install Ruby dependencies

This will install all the required dependencies required to run the application.

postal bundle /opt/postal/app/vendor/bundle
Setting up configuration files

Before you can do anything, you'll need to generate the default configuration. By default, configuration is kept outside of the repository file structure and is stored in /opt/postal/config. Generate the initial configuration with the following command:

postal initialize-config
This will create a number of files for your configuration, including various private keys & certificates as well as a default postal.yml configuration file.
Configuring

Open up your new postal.yml configuration file from /opt/postal/config. Follow the comments in the example file and update items as appropriate based on your installation.
Initialize database & assets

postal initialize
Create your initial admin user

postal make-user
This will guide you through setting up a new admin user for your installation. You'll be prompted for an e-mail address, name & password. You can then use these when you first login.
Starting the application

To start the application, just run the following command. This will run postal in the foreground. This is only useful for testing and development. You'll run it in the background when you're sure everything is working.

postal run
If everything looks OK, you can just CTRL+C this and continue. If there are any errors, you should investigate these before continuing.

Now, you can run postal in the background on your server:

postal start
You can look at the status at any time using postal status.
Configuring Nginx

The Postal management interface and API should sit behind nginx. Install it and configure it as appropriate.

sudo apt install nginx
Once installed, you can change the default site configuration to match something suitable. The repository contains an example config file that you can copy into place.

sudo cp /opt/postal/app/resource/nginx.cfg /etc/nginx/sites-available/default
You can create a self signed SSL certificate if you need to (otherwise put your own
key & cert in /etc/nginx/ssl/postal.crt and postal.key)
sudo mkdir /etc/nginx/ssl/
sudo openssl req -x509 -newkey rsa:4096 -keyout /etc/nginx/ssl/postal.key -out /etc/nginx/ssl/postal.crt -days 365 -nodes

Make the appropriate changes for your domain and SSL certificate and then restart

sudo nano -w /etc/nginx/sites-available/default

sudo /etc/init.d/nginx restart
This might be a good time to set up Let's Encrypt rather than using a self-signed certificate. CertBot is a good way to go about setting this up.
Accessing the web interface

You can now navigate to your domain and you should see the Postal web interface asking for a login. You can login using the credentials you created earlier.

You can start by creating your own organization & mail server and exploring the system.

By default, the system is not configured to use any IP pools that are configured. Messages will be sent from the main IP on the server. Configuring multiple IP pools will be covered in other documentation.
Configuring Postal SMTP

The Postal system itself needs to be able to send e-mails. This is something that needs to be configured in your postal.yml configuration file. You can send these messages using Postal itself. Just create a new mail server and use its credentials in your config file. Postal sends emails when servers are approaching limits, new users are invited, password resets and more.

Once you have added the configuration for this, you can test the configuration using the command below. Replace the e-mail address with one of your own.

postal test-app-smtp youraddress@domain.com

Complete Installation with Git Repo:

https://gist.githubusercontent.com/amisalabir/5fd99cd156b2eba220ae826ef8348f89/raw/44bd3f5314e116c9134456aecae3258f15f10479/ubuntu1604.sh

Tuesday, February 23, 2021

Install and enable the imap extension on Ubuntu 20.04



Debian/Ubuntu with PHP5
sudo apt-get install php5-imap
sudo php5enmod imap


Debian/Ubuntu with PHP7
sudo apt-get install php7.0-imap


YUM based distro

sudo yum install php-imap


Mac OS X with php5.6


brew reinstall php56 --with-imap

Install PHP zip Extension on Ubuntu 20.04

 Mehtod 1:

sudo apt-get install php7.4-zip
sudo /etc/init.d/apache2 restart or sudo service nginx restart


 Mehtod 2:

sudo apt-get update
sudo apt-get install libz-dev -y
pecl install zlib zip
sudo /etc/init.d/apache2 restart

Office 2021 Activation using command

  @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================...