Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to Setup a Complete Mail Server - Clean Install of Ubuntu 16.04 NEW
- Put together by Matthew Knight
- sudo apt-get update
- sudo apt-get install apache2 - Webserver
- sudo apt-get install mysql-server mysql-client libmysqlclient-dev - MySql
- sudo apt-get install -y phpmyadmin - PhpMyAdmin
- Naturally, because phpMyAdmin is such a common application installed on many web servers, it is a popular target for unauthorized access attempts. We can easily secure our phpMyAdmin installation by using Apache’s built-in .htaccess authentication.
- Step 1: Edit phpMyAdmin’s Apache Config
- We want to edit the phpMyAdmin Apache config that was created earlier:
- sudo vi /etc/apache2/conf-available/phpmyadmin.conf
- Add AllowOverride “ALL” directive below the DirectoryIndex:
- Options FollowSymLinks
- DirectoryIndex index.php
- AllowOverride ALL
- Step 2: Restart Apache to Accept Config Changes
- Restart Apache so our changes take affect:
- sudo service apache2 restart
- Step 3: Create an .htaccess File
- Now that we’ve enabled overrides for our phpMyAdmin application from Apache, we need to actually create an override with an .htaccess file.
- sudo vi /usr/share/phpmyadmin/.htaccess
- Add this text:
- AuthType Basic
- AuthName "phpMyAdmin Users Only"
- AuthUserFile /etc/phpmyadmin/.htpasswd
- Require valid-user
- Step 4: Create an .htpasswd File for Authentication
- First we need the htpasswd utility. If you don’t already have this installed, use the following:
- sudo apt-get install apache2-utils
- Now we can create a secure user for our phpMyAdmin application with the command:
- $ sudo htpasswd -c /etc/phpmyadmin/.htpasswd phpmyadmin
- New password:
- Re-type new password:
- Adding password for user phpmyadmin
- sudo apt-get install postfix
- sudo service postfix restart
- sudo apt-get install dovecot-imapd dovecot-pop3d
- sudo service dovecot restart
- sudo apt-get install squirrelmail
- sudo squirrelmail-configure
- sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/squirrelmail.conf
- sudo a2ensite squirrelmail.conf
- sudo useradd emailname - Should ask for a Full name etc.. on Ubuntu 16.04
- adduser emailname mail
- doveadm mailbox create -u email@example.com -s INBOX
- adduser emailname mail - Is needed before of the;
- ERROR: Could not complete request.
- Query: SELECT "INBOX"
- Reason Given: [SERVERBUG] Internal error occurred. Refer to server log for more information.
- --------
- Putty: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
- WinSCP: https://winscp.net/eng/index.php
- Ovh: Ovh.com
- SSL cert: Ssls.com
- Credit:
- Matthew Knight
- IG: matthewhknight
- Twitter: matthewhknight
- YouTube: YouTube.com/matthewhknight
- PayPal: https://paypal.me/matthewknight
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement