On this page • • • • The Perfect Setup - CentOS 5.0 (32-bit) Version 1.0 Author: Falko Timme This tutorial shows how to set up a CentOS 5.0 based server that offers all services needed by ISPs and web hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of CentOS 5.0, but should apply to the 64-bit version with very little modifications as well. I will use the following software: • Web Server: Apache 2.2 with PHP 5.1.6 • Database Server: MySQL 5.0 • Mail Server: Postfix • DNS Server: BIND9 (chrooted) • FTP Server: Proftpd • POP3/IMAP server: Dovecot • Webalizer for web site statistics In the end you should have a system that works reliably, and if you like you can install the free webhosting control panel (i.e., ISPConfig runs on it out of the box). I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you! 1 Requirements To install such a system you will need the following: • Download the six CentOS 5.0 CD iso images from a mirror next to you (the list of mirrors can be found here: ). • a fast internet connection. 2 Preliminary Note In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate. That said, the choice is yours: if you still prefer to install the real deal, read how to install Postfix on CentOS; otherwise, keep reading. Setup Let’s see how to install sSMTP and use it in the correct way with the main SMTP e-mail service providers used in Italy, that is GMail and Aruba. In this article, we will show you how to setup and configure a mail server with PostfixAdmin, Postfix, Dovecot and SQLite on a CentOS VPS. PostfixAdmin is a PHP-based web front-end that allows you to manage virtual domains and users for a Postfix mail transport agent. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Install And Configure Postfix On Centos 5 Iso Download3 Install The Base System Boot from your first CentOS 5.0 CD (CD 1). Press at the boot prompt: It can take a long time to test the installation media so we skip this test here: The welcome screen of the CentOS installer appears. Click on Next: Choose your language next: Select your keyboard layout: I'm installing CentOS 5.0 on a fresh system, so I answer Yes to the question Would you like to initialize this drive, erasing ALL DATA? Now we must select a partitioning scheme for our installation. For simplicity's sake I select Remove linux partitions on selected drives and create default layout. This will result in a small /boot and a large / partition as well as a swap partition. Of course, you're free to partition your hard drive however you like it. Then I hit Next: Answer the following question ( Are you sure you want to do this?) with Yes: On to the network settings. The default setting here is to configure the network interfaces with DHCP, but we are installing a server, so static IP addresses are not a bad idea. Click on the Edit button at the top right. In the window that pops up uncheck Use dynamic IP configuration (DHCP) and Enable IPv6 support and give your network card a static IP address (in this tutorial I'm using the IP address 192.168.0.100 for demonstration purposes) and a suitable netmask (e.g. 255.255.255.0; if you are not sure about the right values, might help you): Set the hostname manually, e.g. Server1.example.com, and enter a gateway (e.g. 192.168.0.1) and up to two DNS servers (e.g. 145.253.2.75 and 193.174.32.18): Choose your time zone: Give root a password. I like digitalocean’s tutorials about setting up servers and VPS, which is usually easy to understand, and if not (like this, at least works! I composed a. In that tutorial, you can see I’ve got a lot of trouble making sendmail work, so I think this time I should try Postfix, which is said to be more advanced than sendmail, and easier to use. But frankly speaking, I do not think the concepts in Postfix are easier to understand than sendmail. In fact, they use the same set of concepts. But with the guide of the digitalocean’s tutorial, the configuration work is indeed simpler than sendmail. The point is you need not understand the complex concepts involved in it. What you need to do is just to copy/paste the code provided in the tutorial and change the domain name to your real domain name. Install postfix. Soft_bounce = no queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix mail_owner = postfix # The default_privs parameter specifies the default rights used by # the local delivery agent for delivery to external file or command. # These rights are used in the absence of a recipient user context. # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER. Enable SMTPS for postfix Now you can send mails using the mail command. But the configurations above is far from perfect in real production environment. We’ll add more configuration to make a real email system. First, we will add the ssl support for postfix. By default, postfix listens on port 25 to receive emails from peer mta or email clients. The messages transported via port 25 are not encrypted and easy to be sniffed, even tampered. Some email clients can use STARTTLS command to enter encrypted communication mode via port 25. But old email client does not support STARTTLS. Here we use smtps to implement the encrypted communication. SMTPS uses port 465 to receive packets over SSL. To enable postfix for smtps, edit /etc/postfix/master.cf to un-comment the line. O smtpd_tls_wrappermode = yes Now, you should see the server certification during the handshaking phase in the openssl command, although it complains “unable to verify the first certificate” because the server certification is issued by myself, not a real CA. This is a good signal indicating the TLS settings for postfix are ok. The bad news is that openssl still quits after ssl handshaking. Config SASL authentication By checking the postfix log file:/var/log.maillog, you will see the following error messages. Com Openssl waits for us to input commands. If you try to send an mail, you will fail after you input the “rcpt to:” command. The error is “Relay access denied”. This is caused by the smtpd_recipient_restrictions setting in main.cf. We do not allow email relay for unauthorized people. You need to complete the authentication before sending an email. If you follow the instruction in the guide to submit your login credentials, you will get the error: Error: authentication failed: authentication failure Meanwhile, you will see the following errors in /var/log/maillog. Chown postfix / etc / sasldb2 Now you should be able to complete the auth command and send emails in openssl. Occasionally, you may forget the password for a user account. How to see the password of a user in /etc/sasldb2? Unfortunately, I can not figure out how to recover the password. /etc/sasldb2 is a binary file, something like /etc/shadow. You can not see the password in it. But I have a way to. First, list the user account in /etc/sasldb2 using sasldblistusers2. The command’s output looks like: [email protected]: userPassword But userPassword is not the real password for the user [email protected]. To change the password, use “saslpasswd2 [email protected]” Please refer to the for sasl management. Receive emails using Cyrus-IMAP At this point, you can send emails using the postfix system without a problem. However, as to receiving emails, there are more configurations to be done. First, you should change the following line in main.cf. Service cyrus - imapd start Postfix will talk with this service to deliver received emails to mailbox. Will save the emails in /var/spool/imap(specified by the partition-default parameter in /etc/imapd.conf). Every email address has a directory under /var/spool/imap. Every email is saved as a file like 1., 2., 3.. Note that even there is no account in /etc/sasldb2, the emails postfix receives are still saved in /var/spool/imap, because for email destined to the server postfix controls, no authentication is required. • Type “ cd mame” to go into the “ C: mame” folder. Now to start mame, you type mame, then a space, then the game file you want to use: • Example: mame robby If you have a joystick or gamepad you wish to use, you have to use the -joystick switch: • Example: mame robby -joystick Now the game rom should run. • Type “ cd ” to go to the root directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |