Advertisement
ZaraByte

How to Setup a Complete Mail Server - CLEAN

May 25th, 2019
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. How to Setup a Complete Mail Server - Clean Install of Ubuntu 16.04 NEW
  2. Put together by Matthew Knight
  3.  
  4. sudo apt-get update
  5. sudo apt-get install apache2 - Webserver
  6. sudo apt-get install mysql-server mysql-client libmysqlclient-dev - MySql
  7. sudo apt-get install -y phpmyadmin - PhpMyAdmin
  8.  
  9. 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.
  10.  
  11. Step 1: Edit phpMyAdmin’s Apache Config
  12. We want to edit the phpMyAdmin Apache config that was created earlier:
  13.  
  14. sudo vi /etc/apache2/conf-available/phpmyadmin.conf
  15.  
  16. Add AllowOverride “ALL” directive below the DirectoryIndex:
  17.  
  18. Options FollowSymLinks
  19. DirectoryIndex index.php
  20. AllowOverride ALL
  21.  
  22. Step 2: Restart Apache to Accept Config Changes
  23. Restart Apache so our changes take affect:
  24. sudo service apache2 restart
  25. Step 3: Create an .htaccess File
  26. Now that we’ve enabled overrides for our phpMyAdmin application from Apache, we need to actually create an override with an .htaccess file.
  27.  
  28. sudo vi /usr/share/phpmyadmin/.htaccess
  29. Add this text:
  30. AuthType Basic
  31. AuthName "phpMyAdmin Users Only"
  32. AuthUserFile /etc/phpmyadmin/.htpasswd
  33. Require valid-user
  34. Step 4: Create an .htpasswd File for Authentication
  35. First we need the htpasswd utility. If you don’t already have this installed, use the following:
  36. sudo apt-get install apache2-utils
  37. Now we can create a secure user for our phpMyAdmin application with the command:
  38.  
  39. $ sudo htpasswd -c /etc/phpmyadmin/.htpasswd phpmyadmin
  40. New password:
  41. Re-type new password:
  42. Adding password for user phpmyadmin
  43.  
  44.  
  45. sudo apt-get install postfix
  46. sudo service postfix restart
  47. sudo apt-get install dovecot-imapd dovecot-pop3d
  48.  
  49. sudo service dovecot restart
  50. sudo apt-get install squirrelmail
  51. sudo squirrelmail-configure
  52. sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/squirrelmail.conf
  53. sudo a2ensite squirrelmail.conf
  54. sudo useradd emailname - Should ask for a Full name etc.. on Ubuntu 16.04
  55. adduser emailname mail
  56. doveadm mailbox create -u email@example.com -s INBOX
  57. adduser emailname mail - Is needed before of the;
  58. ERROR: Could not complete request.
  59. Query: SELECT "INBOX"
  60. Reason Given: [SERVERBUG] Internal error occurred. Refer to server log for more information.
  61. --------
  62. Putty: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
  63. WinSCP: https://winscp.net/eng/index.php
  64. Ovh: Ovh.com
  65. SSL cert: Ssls.com
  66.  
  67. Credit:
  68. Matthew Knight
  69. IG: matthewhknight
  70. Twitter: matthewhknight
  71. YouTube: YouTube.com/matthewhknight
  72. PayPal: https://paypal.me/matthewknight
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement