Tuesday, February 15, 2022

How To Setup PostfixAdmin in Ubuntu 20.04.3 LTS

 in This Tutorial you will learn "How To install Setup PostfixAdmin in Ubuntu 20.04.3 LTS

Postfix Admin is a web based interface to configure and manage a Postfix based email server for many users.
Features:-
manage mailboxes, virtual domains and aliases
vacation/out-of-office messages
alias domains (forwarding one domain to another with recipient validation)
users can manage their own mailbox (change alias, password and vacation message)
quota support for single mailboxes and total quota of a domain
display used quota
fetchmail integration
commandline client postfixadmin-cli for those who don't want to click around in a web interface ;-)
Squirrelmail plugin
________________________________________________________________________________________________________________________

Server - Os:  Ubuntu 20.04.3 LTS 64Bit        | IP -192.168.1.80            |Hostname -  ubuntu.example.com
________________________________________________________________________________________________________________________
lsb_release -d ; hostname ; hostname -I  ; add-apt-repository ppa:ondrej/php -y ; apt-get update
apt install -y apache2 build-essential mariadb-server mariadb-client php7.2 libapache2-mod-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-imap php7.2-common php7.2-tidy php7.2-pgsql php7.2-ldap php7.2-soap php7.2-xsl php7.2-redis php7.2-xmlrpc

a2enmod rewrite expires ; sed -i "s/;date.timezone.*/date.timezone = Asia\/\Kolkata/" /etc/php/*/apache2/php.ini
systemctl start apache2 mariadb ; systemctl enable apache2 mariadb ; mysql_secure_installation

wget https://sourceforge.net/projects/postfixadmin/files/postfixadmin-3.3.8/PostfixAdmin%203.3.8.tar.gz -O PostfixAdmin-tar.gz
tar -xvf PostfixAdmin-tar.gz
cp -r postfixadmin-postfixadmin-* /var/www/html/postfixadmin
mkdir /var/www/html/postfixadmin/templates_c ; chmod 755 -R /var/www/html/postfixadmin/templates_c
chown -R www-data:www-data /var/www/html/postfixadmin/templates_c

chown -R www-data:www-data /var/www/html/ ; chmod -R 777 /var/www/html/
nano  /etc/apache2/sites-available/yourdomain.conf
<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/html/postfixadmin/public/
ServerName www.yourdomain.com
<Directory /var/www/html/postfixadmin/public/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/yourdomain.com-error_log
CustomLog /var/log/apache2/yourdomain.com-access_log common
</VirtualHost>

a2ensite yourdomain.conf ; a2dissite 000-default.conf  ; apache2ctl configtest ; echo "192.168.1.80 www.yourdomain.com" >> /etc/hosts ; rm -rf /var/www/html/index.html
systemctl reload apache2

mysql -u root -p
CREATE USER 'postfixadmin'@'localhost' IDENTIFIED BY 'Strong_Password';
CREATE DATABASE postfixadmin;
GRANT ALL PRIVILEGES ON postfixadmin.* TO 'postfixadmin'@'localhost';
FLUSH PRIVILEGES;
\q
nano /var/www/html/postfixadmin/public/config.local.php
<?php
$CONF['database_type'] = 'mysqli';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'postfixadmin';
$CONF['database_password'] = 'Strong_Password';
$CONF['database_name'] = 'postfixadmin';
$CONF['configured'] = true;
$CONF['encrypt'] = 'md5crypt';
?>
nano /var/www/html/postfixadmin/config.inc.php
Strong_Password12
$CONF['setup_password'] = '$2y$10$JXT9tJR32lRjTTd2BS32Zu7nrMDtSBrFjrTd2GI0SgdgKVQfRA.wW';
http://www.yourdomain.com/setup.php
________________________________________________________________________________________________________________________

No comments:

Post a Comment