GNU/Linux >> Belajar Linux >  >> Panels >> Panels

Siapkan Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda

Menyiapkan Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda

Termasuk:Shorewall, NAT, Caching NameServer, Server DHCP, Server VPN, Webmin, Munin, Apache (SSL diaktifkan), Squirrelmail, pengaturan Postfix dengan domain virtual, imap imap kurir pop3 pop3, otentikasi sasl untuk pejuang jalanan, MailScanner sebagai pembungkus untuk SpamAssassin, Razor, ClamAV, dll. Samba diinstal, tidak dikonfigurasi.

Membutuhkan sedikit perawatan dan dapat diperpanjang di luar imajinasi terliar Anda. Semua tergantung hardware yang digunakan tentunya.

Ini hanya cara COPY &PASTE. Untuk info lebih lanjut gunakan net. Saya melakukannya... Namun, kontribusi dan saran selalu diterima! Saya tahu ini bisa dilakukan dengan lebih baik, jadi silakan.

Seharusnya aku segera mendasarkan tuto ini pada 6.06 LTS, karena LTS. Maaf untuk itu. Karena beberapa perubahan kecil namun penting yang diperlukan untuk membuat ini berfungsi dengan Ubuntu 6.06 LTS,  saya menulisnya lagi.

Jika ada di antara Anda yang dapat menemukan waktu untuk menambahkan instalasi dan konfigurasi yang baik untuk snort AND snortsam, termasuk panel kontrol yang komprehensif, saya akan berterima kasih.

Cakupan:membuat firewall/(mail)gateway untuk jaringan kecil (misalnya 10 hingga 15 pengguna atau lebih pada ram PIII 450MHz, 512 MB dan dua kartu antarmuka jaringan yang identik, koneksi broadband, fitur lengkap, untuk lingkungan bisnis. Spesifikasi lebih baik perangkat keras Anda (terutama jumlah ram) akan meningkatkan kinerja server Anda secara signifikan.Spesifikasi yang disebutkan adalah minimal untuk pelanggan yang tidak terlalu menuntut, hanya untuk menunjukkan bahwa jika Anda benar-benar menginginkannya, itu memang dapat dilakukan (perlu dilakukan beberapa penyesuaian setelahnya).

Audiens yang diharapkan:(awal) sysop.

Tuto ini mengarah pada sistem 'siap pakai' yang solid. Bagian yang menyenangkan, saya pikir, (tweak dan tuning dll) dimulai ketika Anda selesai. Anda mungkin ingin memeriksa log Anda untuk menemukan petunjuk di mana penyetelan harus dimulai. Munin mungkin akan memberi tahu Anda banyak hal.

Selamat bersenang-senang!

Pertama, lakukan instalasi bersih menggunakan Ubuntu-Server 6.06 LTS. Selama instalasi, pengaturan yang tepat untuk eth0 akan terdeteksi secara otomatis. Jika gagal, ubah kabel jaringan Anda dan coba lagi. Ada kemungkinan yang sangat kecil bahwa ISP Anda tidak menjalankan server DHCP (tidak pernah melihat itu terjadi), atau mungkin sedang down (terlihat beberapa kali, mereka juga kadang-kadang mengacaukan DNS mereka), di kasus mana yang Anda gunakan, sebaiknya tunggu sampai mereka selesai memperbaikinya. Jadi kita mulai dengan alamat yang ditetapkan DHCP untuk eth0. Ini hanyalah cara mudah untuk mengetahui NIC mana yang sebenarnya eth0. Jika Anda sudah tahu mana yang sebaiknya Anda mulai dengan alamat statis untuk eth0. Jika ISP Anda tidak jelek, Anda memiliki pengaturan yang tepat untuk itu.

Sekarang lanjutkan dan terima semua default (tetapi Anda mungkin ingin melakukan partisi sendiri), jangan instal LAMP.

Sekarang login sebagai pengguna baru yang baru saja Anda buat dan lakukan:

sudo passwd

Sekarang masukkan kata sandi Anda lagi. Selanjutnya masukkan kata sandi baru untuk pengguna "root" dan konfirmasi. Jadi kami menghapus pengalaman sudo yang buruk (agak aneh di server, bukan?) Sekarang logout dan login lagi sebagai root dengan kata sandi root baru.

Menggunakan vim (atau editor favorit Anda) edit /etc/apt/sources.list. Beri komentar pada repositori cd. Selanjutnya tambahkan "universe" (tanpa tanda kutip) ke semua baris yang tidak dikomentari dan batalkan komentar pada repositori backport. Simpan file.

Edit /etc/network/interfaces dan tambahkan berikut ini di bagian bawah:

auto eth1iface eth1 inet alamat statis 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 jaringan 192.168.1.0

Perhatikan bahwa sisa tuto ini mengasumsikan bahwa Anda benar-benar membuat pengaturan untuk eth1 seperti yang ditunjukkan.

Full/etc/network/interfaces saya terlihat seperti ini:

# File ini menjelaskan antarmuka jaringan yang tersedia di sistem Anda# dan cara mengaktifkannya. Untuk informasi lebih lanjut, lihat antarmuka (5).# Antarmuka jaringan loopbackauto loiface lo inet loopback# Antarmuka jaringan utamaauto eth0iface eth0 inet dhcpauto eth1iface eth1 inet alamat statis 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0

Seperti yang Anda lihat, eth0 saya mendapatkan pengaturannya menggunakan DHCP.

Simpan file. Selanjutnya:

apt-get update
apt-get install openssh-server
apt-get upgrade

Selama proses pemutakhiran, gambar kernel baru diinstal. Jadi selanjutnya lakukan:

boot ulang

Sisanya dapat Anda lakukan dari workstation Anda, baik linux atau yang lain (harus memiliki dempul), sehingga Anda benar-benar dapat menyalin dan menempel. Cukup login ke 192.168.1.1 sebagai root dan lanjutkan.

Pastikan pengaturan jaringan workstation Anda sesuai dengan pengaturan eth1 server Anda

Jika Anda bingung di sini, konfigurasikan terlebih dahulu dan mulai server DHCP Anda seperti yang ditunjukkan dalam artikel ini, dan biarkan workstation Anda mendeteksi pengaturan yang tepat secara otomatis.

Mengatur Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda - Halaman 2

Sekarang lakukan:

apt-get install libmd5-perl libnet-ssleay-perl libauthen-pam-perl libio-pty-perl shorewall dnsmasq openssl
wget http://surfnet.dl.sourceforge.net/sourceforge/webadmin/webmin_1.390_all.deb

"surfnet" adalah server belanda. Ubah menjadi "heanet"(untuk Irlandia), "belnet"(untuk Belgia), "mesh" (untuk Jerman) dan seterusnya.

dpkg -i webmin_1.390_all.deb
cp /usr/share/doc/shorewall/examples/two-interfaces/* /etc/shorewall/
cd /etc/shorewall
gunzip interfaces.gz masq.gz rules.gz

Sekarang buka browser Anda dan login ke webmin di https://192.168.1.1:10000 sebagai root dengan kata sandi root Anda dan, menggunakan modul shorewall webmin, ubah kebijakan dan aturan firewall Anda sesuai kebutuhan (untuk saat ini, saya hanya menetapkan aturan file ke contoh seperti yang ditunjukkan, Anda dapat menyalin dan menempelkan file aturan saya sebagai permulaan, jika Anda tidak menyukai webmin).

Setel juga di /etc/shorewall/shorewall.conf  baris "IP_FORWARDING=Keep"  ke  "IP_FORWARDING=On" (tanpa tanda kutip)
dan aktifkan firewall di /etc/default/shorewall.

/etc/shorewall/rules  saya sekarang terlihat seperti ini:

################################################################ ############################################################# ############
#ACTION SOURCE PROTO DEST SUMBER DEST ORIGINAL RATE PENGGUNA/
# PORT PORT(S) DEST LIMIT GROUP
# PORT PORT(S) DEST LIMIT GROUP
#
# Terima koneksi DNS dari firewall ke jaringan
#
DNS/TERIMA $FW net
TERIMA $FW net all
TERIMA $FW loc all
TERIMA loc $FW all
#
# Terima koneksi SSH dari jaringan lokal untuk administrasi
#
SSH/ACCEPT loc $FW
#
# Izinkan Ping dari jaringan lokal
#
Ping/ACCEPT loc $FW
#
# Tolak Ping dari zona net "buruk".. dan cegah agar log Anda tidak kebanjiran..
#
Ping/TOLAK net $FW
TERIMA $FW loc icmp
TERIMA $FW net icmp
#LAST LINE - - TAMBAHKAN ENTRI ANDA SEBELUM YANG INI -- JANGAN HAPUS
Selanjutnya lakukan:
rm /etc/shorewall/README.txt Makefile
/etc/init.d/shorewall start

Anda seharusnya sekarang dapat menjelajahi internet.

JANGAN MELANJUTKAN SAMPAI ANDA SUKSES BERSELANJUT DI NET. KARENA INI ADALAH KERANGKA KERJA ANDA. HARUS BAIK.

Mengatur Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda - Halaman 3

Jadi sekarang kita membutuhkan beberapa paket. Lakukan (semua dalam satu baris!):

apt-get install clamav-daemon xfsdump razor pyzor mailscanner spamc spamassassin postfix kurir-authmysql kurir-pop kurir-pop-ssl kurir-imap kurir-imap-ssl libsasl2-modul-sql sasl2-bin libpam-mysql build-essential dpkg-dev fakeroot debhelper libdb4.2-dev libgdbm-dev libldap2-dev libpcre3-dev libmysqlclient12-dev libssl-dev libsasl2-dev postgresql-dev po-debconf kebun binatang dpatch unzip devarj rdate fetchmail zip ncftp fileutils curl imagemagick squirrelmail squirrelmail-locales munin munin-node ntp nfs-kernel-server samba unzoo mysql-server mysql-client libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-curl php4 domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl php-pear mailx libzzip-dev libgmp3c2 libgmp3-dev pra pptp3
 Terima semua default.

Sekarang lakukan:

mysqladmin -u root password yourrootsqlpassword

GUNAKAN PASSWORD NYATA DI SINI!

Sekarang konfigurasikan Apache dan Squirrelmail.

/usr/sbin/squirrelmail-configure

Atur ke kurir (opsi D) dan buat ik sesuai keinginan Anda.
Jangan lupa untuk mengaktifkan beberapa plugin dan mengatur bahasa default jika diinginkan. Saya juga menyarankan untuk mengatur ini:

$show_contain_subfolders_option =true;

My/etc/squirrelmail/config.php sekarang terlihat seperti ini:(Hanya konfigurasi saya saat ini. Jangan salin ini, gunakan sebagai referensi.)


/**
* File Konfigurasi SquirrelMail
* Dibuat menggunakan skrip configure, conf.pl
*/

global $version;
$config_version ='1.4.0';
$config_use_color =2;

$org_name ="Lürsen";
$org_logo =SM_PATH . 'images/sm_logo.png';
$org_logo_width ='564';
$org_logo_height ='261';
$org_title ="Lürsen";
$signout_page ='https ://lursen.net/webmail';
$frame_top ='_top';

$provider_uri ='http://www.squirrelmail.org/';

$provider_name ='SquirrelMail';

$motd ="";

$squirrelmail_default_language ='nl_NL';
$default_charset ='iso-8859 -1';
$lossy_encoding =false;

$domain ='lursen.net';
$imapServerAddress ='localhost';
$imapPort =143;
$useSendmail =false;
$smtpServerAddress ='localhost';
$smtpPort =25;
$sendmail_path ='/usr/sbin/sendmail';
$ sendmail_args ='-i -t';
$pop_before_smtp =false;
$imap_server_type ='courier';
$invert_time =false;
$optional_delimiter ='.';
$encode_header_key ='';

$default_folder_prefix ='INBOX.';
$trash_folder ='Sampah';
$sent_folder ='Terkirim';
$draft_folder ='Draf';
$default_move_to_trash =true;
$default_move_to_sent =true;
$default_save_as_draft =true;
$show_prefix_option =false;
$list_special_folders_first =true;
$use_special_folder_color =true;
$auto_expunge =true;
$default_sub_of_inbox =false;
$show_contain_subfolders_option =true;
$default_unseen_notify =2;
$default_unseen_type =1;
$ auto_create_special =true;
$delete_folder =true;
$noselect_fix_enable =false;

$data_dir ='/var/lib/squirrelmail/data/';
$ attachment_dir ='/var/spool/squirrelmail/attach/';
$dir_hash_level =0;
$default_left_size ='150';
$force_username_lowercase =false;
$default_use_priority =true;
$hide_sm_attributions =false;
$default_use_mdn =true;
$edit_identity =true;
$edit_name =true;
$hide_auth_header =false;
$allow_thread_sort =false;
$allow_server_sort =false;
$allow_charset_search =true;
$uid_support =true;

$plugins[0] ='abook_take';
$plugins[1] ='delete_move_next';
$plugins[2] =' calendar';
$plugins[3] ='filters';
$plugins[4] ='message_details';
$plugins[5] ='mail_fetch';
$ plugins[6] ='newmail';

$theme_css ='';
$theme_default =0;
$theme[0]['PATH'] =SM_PATH . 'themes/default_theme.php';
$theme[0]['NAME'] ='Default';
$theme[1]['PATH'] =SM_PATH . 'themes/plain_blue_theme.php';
$theme[1]['NAME'] ='Plain Blue';
$theme[2]['PATH'] =SM_PATH . 'themes/sandstorm_theme.php';
$theme[2]['NAME'] ='Badai Pasir';
$theme[3]['PATH'] =SM_PATH . 'themes/deepocean_theme.php';
$theme[3]['NAME'] ='Deep Ocean';
$theme[4]['PATH'] =SM_PATH . 'themes/slashdot_theme.php';
$theme[4]['NAME'] ='Slashdot';
$theme[5]['PATH'] =SM_PATH . 'themes/purple_theme.php';
$theme[5]['NAME'] ='Ungu';
$theme[6]['PATH'] =SM_PATH . 'themes/forest_theme.php';
$theme[6]['NAME'] ='Hutan';
$theme[7]['PATH'] =SM_PATH . 'themes/ice_theme.php';
$theme[7]['NAME'] ='Ice';
$theme[8]['PATH'] =SM_PATH . 'themes/seaspray_theme.php';
$theme[8]['NAME'] ='Sea Spray';
$theme[9]['PATH'] =SM_PATH . 'themes/bluesteel_theme.php';
$theme[9]['NAME'] ='Blue Steel';
$theme[10]['PATH'] =SM_PATH . 'themes/dark_grey_theme.php';
$theme[10]['NAME'] ='Abu-abu Gelap';
$theme[11]['PATH'] =SM_PATH . 'themes/high_contrast_theme.php';
$theme[11]['NAME'] ='Kontras Tinggi';
$theme[12]['PATH'] =SM_PATH . 'themes/black_bean_burrito_theme.php';
$theme[12]['NAME'] ='Burrito Kacang Hitam';
$theme[13]['PATH'] =SM_PATH . 'themes/servery_theme.php';
$theme[13]['NAME'] ='Servery';
$theme[14]['PATH'] =SM_PATH . 'themes/maize_theme.php';
$theme[14]['NAME'] ='Jagung';
$theme[15]['PATH'] =SM_PATH . 'themes/bluesnews_theme.php';
$theme[15]['NAME'] ='BluesNews';
$theme[16]['PATH'] =SM_PATH . 'themes/deepocean2_theme.php';
$theme[16]['NAME'] ='Deep Ocean 2';
$theme[17]['PATH'] =SM_PATH . 'themes/blue_grey_theme.php';
$theme[17]['NAME'] ='Blue Grey';
$theme[18]['PATH'] =SM_PATH . 'themes/dompie_theme.php';
$theme[18]['NAME'] ='Dompie';
$theme[19]['PATH'] =SM_PATH . 'themes/methodical_theme.php';
$theme[19]['NAME'] ='Methodical';
$theme[20]['PATH'] =SM_PATH . 'themes/greenhouse_effect.php';
$theme[20]['NAME'] ='Efek Rumah Kaca (Perubahan)';
$theme[21]['PATH'] =SM_PATH . 'themes/in_the_pink.php';
$theme[21]['NAME'] ='In The Pink (Perubahan)';
$theme[22]['PATH'] =SM_PATH . 'themes/kind_of_blue.php';
$theme[22]['NAME'] ='Jenis Biru (Perubahan)';
$theme[23]['PATH'] =SM_PATH . 'themes/monostochastic.php';
$theme[23]['NAME'] ='Monostochastic (Perubahan)';
$theme[24]['PATH'] =SM_PATH . 'themes/shades_of_grey.php';
$theme[24]['NAME'] ='Shades of Grey (Perubahan)';
$theme[25]['PATH'] =SM_PATH . 'themes/spice_of_life.php';
$theme[25]['NAME'] ='Bumbu Kehidupan (Perubahan)';
$theme[26]['PATH'] =SM_PATH . 'themes/spice_of_life_lite.php';
$theme[26]['NAME'] ='Spice of Life - Lite (Perubahan)';
$theme[27]['PATH'] =SM_PATH . 'themes/spice_of_life_dark.php';
$theme[27]['NAME'] ='Spice of Life - Dark (Perubahan)';
$theme[28]['PATH'] =SM_PATH . 'themes/christmas.php';
$theme[28]['NAME'] ='Liburan - Natal';
$theme[29]['PATH'] =SM_PATH . 'themes/darkness.php';
$theme[29]['NAME'] ='Darkness (Changes)';
$theme[30]['PATH'] =SM_PATH . 'themes/random.php';
$theme[30]['NAME'] ='Acak (Mengubah setiap login)';
$theme[31]['PATH'] =SM_PATH . 'themes/midnight.php';
$theme[31]['NAME'] ='Midnight';
$theme[32]['PATH'] =SM_PATH . 'themes/alien_glow.php';
$theme[32]['NAME'] ='Alien Glow';
$theme[33]['PATH'] =SM_PATH . 'themes/dark_green.php';
$theme[33]['NAME'] ='Hijau Tua';
$theme[34]['PATH'] =SM_PATH . 'themes/penguin.php';
$theme[34]['NAME'] ='Penguin';
$theme[35]['PATH'] =SM_PATH . 'themes/minimal_bw.php';
$theme[35]['NAME'] ='Minimal BW';
$theme[36]['PATH'] =SM_PATH . 'themes/redmond.php';
$theme[36]['NAME'] ='Redmond';
$theme[37]['PATH'] =SM_PATH . 'themes/netstyle_theme.php';
$theme[37]['NAME'] ='Net Style';
$theme[38]['PATH'] =SM_PATH . 'themes/silver_steel_theme.php';
$theme[38]['NAME'] ='Silver Steel';
$theme[39]['PATH'] =SM_PATH . 'themes/simple_green_theme.php';
$theme[39]['NAME'] ='Simple Green';
$theme[40]['PATH'] =SM_PATH . 'themes/wood_theme.php';
$theme[40]['NAME'] ='Kayu';
$theme[41]['PATH'] =SM_PATH . 'themes/bluesome.php';
$theme[41]['NAME'] ='Bluesome';
$theme[42]['PATH'] =SM_PATH . 'themes/simple_green2.php';
$theme[42]['NAME'] ='Simple Green 2';
$theme[43]['PATH'] =SM_PATH . 'themes/simple_purple.php';
$theme[43]['NAME'] ='Simple Purple';
$theme[44]['PATH'] =SM_PATH . 'themes/autumn.php';
$theme[44]['NAME'] ='Autumn';
$theme[45]['PATH'] =SM_PATH . 'themes/autumn2.php';
$theme[45]['NAME'] ='Autumn 2';
$theme[46]['PATH'] =SM_PATH . 'themes/blue_on_blue.php';
$theme[46]['NAME'] ='Blue on Blue';
$theme[47]['PATH'] =SM_PATH . 'themes/classic_blue.php';
$theme[47]['NAME'] ='Classic Blue';
$theme[48]['PATH'] =SM_PATH . 'themes/classic_blue2.php';
$theme[48]['NAME'] ='Biru Klasik 2';
$theme[49]['PATH'] =SM_PATH . 'themes/powder_blue.php';
$theme[49]['NAME'] ='Powder Blue';
$theme[50]['PATH'] =SM_PATH . 'themes/techno_blue.php';
$theme[50]['NAME'] ='Techno Blue';
$theme[51]['PATH'] =SM_PATH . 'themes/turquoise.php';
$theme[51]['NAME'] ='Turquoise';

$default_use_javascript_addr_book =false;
$abook_global_file ='';
$abook_global_file_writeable =false;

$addrbook_dsn ='';
$addrbook_table ='address';

$prefs_dsn ='';
$prefs_table ='userprefs';
$prefs_user_field ='user';
$prefs_key_field ='prefkey';
$prefs_val_field ='prefval';
$addrbook_global_dsn =' ';
$addrbook_global_table ='global_abook';
$addrbook_global_writeable =false;
$addrbook_global_listing =false;

$no_list_for_subscribe =false;
$smtp_auth_mech ='none';
$imap_auth_mech ='login';
$use_imap_tls =false;
$use_smtp_tls =false;
$session_name ='SQMSESSID';

$config_location_base ='';

@include SM_PATH . 'config/config_local.php';

/**
* Pastikan tidak ada karakter setelah tag penutup PHP
* di bawah (termasuk karakter baris baru dan spasi).
* Jika tidak, karakter itu akan menyebabkan header
* dikirim dan output reguler dimulai, yang akan mengacaukan
* masalah saat kita mencoba mengirim lebih banyak header nanti.
*/
?>

Selanjutnya lakukan:

apache2-ssl-certificate -days 3650

Isi nama server yang benar!!!

Yaitu:alamat yang Anda rencanakan untuk memberi pengguna Anda akses ke Squirrelmail atau layanan lain apa pun oleh apache pada port 443. Hanya domain yang akan melakukannya (HARUS ADA DI DNS). Bukan domain/mail web.

Jika ada yang tidak beres, hapus saja sertifikatnya dan ulangi langkah ini.

Sekarang masukkan:

a2enmod ssl
a2enmod menulis ulang
a2enmod termasuk
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/https
ln -s /etc/Apache2/sites-available/https /etc/Apache2/sites-enabled/https
ln -s /etc/squirrelmail/apache.conf /etc/apache2/sites-enabled/squirrelmail

Mengatur Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda - Halaman 4

Selanjutnya edit /etc/courier/imapd-ssl dan ubah yang berikut ini:

TLS_CERTFILE=/etc/apache2/ssl/apache.pem

Sekarang lakukan hal yang sama dengan /etc/courier/pop3d-ssl Anda.

Sekarang edit /etc/Apache2/sites-available/default. Bagian atas harus diubah sehingga berbunyi:

NameVirtualHost *:80

Edit /etc/Apache2/sites-available/https juga, bagian atas file akan terbaca:

NameVirtualHost *:443

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
Edit /etc/squirrelmail/apache.conf Seharusnya terlihat seperti ini:
Alias ​​/webmail /usr/share/squirrelmail


php_flag register_globals off
Indeks Opsi FollowSymLinks

DirectoryIndex index.php


# akses ke configtest dibatasi secara default untuk mencegah kebocoran informasi

perintah tolak, izinkan
tolak dari semua
izinkan dari 127.0.0.1


# pengguna akan lebih memilih URL sederhana seperti http://webmail.example.com
#
# DocumentRoot /usr/share /squirrelmail
# ServerName webmail.example.com
#

# redirect ke https bila tersedia (terima kasih [email protected])
#
# Catatan:Ada beberapa cara untuk melakukannya, dan mana yang cocok untuk
# konfigurasi situs Anda bergantung. Lihat dokumentasi Apache jika
# Anda tidak yakin, karena contoh ini mungkin tidak berfungsi di semua tempat.
#



RewriteEngine di
RewriteCond %{HTTPS} !^on$ [NC]
RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]



Sekarang pastikan bahwa baris DirectoryIndex di /etc/apache2/apache2.conf berbunyi:

DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

Edit /etc/Apache2/ports.conf dan tambahkan Listen 443:

Dengarkan 80Dengarkan 443

Mengatur Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda - Halaman 5

Sekarang buat squirrelmail berbicara bahasa Anda. Jika Anda hanya menggunakan bahasa Inggris, Anda dapat melewati baris terakhir dalam file tentunya.

Edit /var/lib/locales/supported.d/local.

Seharusnya terlihat seperti ini:(jika Anda orang Belanda, jika tidak sesuaikan sesuai keinginan). Hal utama adalah mengaktifkan lokal Anda dengan charset ISO-8859-1.

en_US.UTF-8 UTF-8en_US.ISO-8859-1 ISO-8859-1nl_NL.ISO-8859-1 ISO-8859-1

dpkg-konfigurasi ulang lokal

Sekarang kita mengkonfigurasi postfix.

postconf -e 'mynetworks =127.0.0.0/8, 192.168.1.0/24'
postconf -e 'smtpd_sasl_local_domain ='
postconf -e 'smtpd_sasl_auth_enable =yes'
postconf -e 'smtpd_sasl_security_options =noanonymous'
postconf -e 'broken_sasl_auth_clients =yes'

postconf -e 'smtpd_recipient_restrictions =permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'

postconf -e 'inet_interfaces =semua'
echo 'pwcheck_method:saslauthd'>> /etc/postfix/sasl/smtpd.conf
echo 'mech_list:login biasa'>> /etc/postfix/sasl/smtpd.conf
postconf -e 'smtpd_tls_auth_only =tidak'
postconf -e 'smtp_use_tls =yes'
postconf -e 'smtpd_use_tls =yes'
postconf -e 'smtp_tls_note_starttls_offer =yes'
postconf -e 'smtpd_tls_key_file =/etc/apache2/ssl/apache.pem'
postconf -e 'smtpd_tls_cert_file =/etc/apache2/ssl/apache.pem'
postconf -e 'smtpd_tls_loglevel =1'
postconf -e 'smtpd_tls_received_header =yes'
postconf -e 'smtpd_tls_session_cache_timeout =3600s'
postconf -e 'tls_random_source =dev:/dev/urandom'
postconf -e 'home_mailbox =Maildir/'
postconf -e 'mailbox_command ='
postconf -e 'header_checks =regexp:/etc/postfix/header_checks'
postconf -e 'relayhost ='
postconf -e 'virtual_alias_domains =hash:/etc/postfix/virtual'
postconf -e 'virtual_alias_maps =hash:/etc/postfix/virtual'
postconf -e 'smtp_never_send_ehlo =yes'
sentuh /etc/postfix/header_checks
sentuh /etc/postfix/virtual

Mengatur Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda - Halaman 6

Sekarang edit etc/postfix/header_checks.

Seharusnya terlihat seperti ini:

/^Diterima:/ TAHAN

cd /root
Sekarang konfigurasikan MailScanner.
chown postfix.postfix /var/spool/MailScanner/incoming
chown postfix.postfix /var/spool/MailScanner/quarantine
mkdir /var/spool/MailScanner/spamassassin
ln -s /etc/MailScanner/spam.assassin.prefs.conf /etc/spamassassin/mailscanner.cf
chown postfix.postfix /var/spool/MailScanner/spamassassin

Sekarang edit /etc/MailScanner/MailScanner.conf dan atur baris berikut seperti yang ditunjukkan:

Run As User =postfix
Run As Group =postfix
Interval Pemindaian Antrian =120
Dir Antrian Masuk =/var/spool/postfix/hold
Dir Antrian Keluar =/var/spool/postfix/incoming
MTA =postfix
Virus Scanners =clamav
Selalu Sertakan SpamAssassin Report =yes
SpamAssassin Status Pengguna Dir =/var/spool/MailScanner/spamassassin
Batalkan komentar pada baris # run_mailscanner=1 di /etc/default/mailscanner Anda.

Sekarang buat tugas cron dari /usr/sbin/check_mailscanner dan jalankan setiap 20 menit.

Sekarang kita akan menipu skrip startup MailScanner. Ini diperlukan karena MailScanner menolak untuk memulai, karena skrip yang ditujukan untuk exim, saya kira (saya tidak pernah benar-benar menggunakan Exim, jadi saya tidak yakin tentang itu). Saya tidak ingin mengubah skrip itu sendiri, karena mungkin akan diganti dengan pembaruan 'tidak memulai' lainnya di masa mendatang. Hanya untuk berada di sisi yang aman.

sentuh /etc/init.d/mailscanner_pre

Edit /etc/init.d/mailscanner_pre. Seharusnya terlihat seperti ini:

#!/bin/sh
mkdir /var/lock/subsys
mkdir /var/lock/subsys/MailScanner
mkdir /var/run/MailScanner
chown postfix .postfix /var/run/MailScanner
chown postfix.postfix /var/lock/subsys/MailScanner

chmod 755 /etc/init.d/mailscanner_pre
mv /etc/rc2.d/S20mailscanner /etc/rc2.d/S99mailscanner
mv /etc/rc3.d/S20mailscanner /etc/rc3.d/S99mailscanner
mv /etc/rc4.d/S20mailscanner /etc/rc4.d/S99mailscanner
mv /etc/rc5.d/S20mailscanner /etc/rc5.d/S99mailscanner
ln -s /etc/init.d/mailscanner_pre /etc/rc2.d/S20mailscanner_pre
chown postfix.postfix /var/spool/MailScanner
chown postfix.postfix /var/lib/MailScanner

Itu harus berhasil sekarang, setuju kan?

Mengatur Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda - Halaman 7

Sekarang konfigurasikan otentikasi sasl.

mkdir -p /var/spool/postfix/var/run/saslauthd

Sekarang kita harus mengedit /etc/default/saslauthd. Seharusnya terlihat seperti ini:

# Ini harus dihapus komentarnya sebelum saslauthd dijalankan secara otomatisSTART=yesPARAMS="-m /var/spool/postfix/var/run/saslauthd -r"# Anda harus menentukan mekanisme otentikasi yang ingin Anda gunakan.# Ini default ke "pam" untuk dukungan PAM, tetapi mungkin juga menyertakan# "shadow" atau "sasldb", seperti ini:# MECHANISMS="pam shadow"MECHANISMS="pam"
Selanjutnya edit /etc/init.d/saslauthd dan ubah lokasi file PID saslauthd. Ubah nilai PIDFILE menjadi /var/spool/postfix/var/run/${NAME}/saslauthd.pid, sehingga berbunyi:
PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"

Sekarang isi sistem Anda dengan pengguna nyata. Setel shell pengguna ke /bin/false untuk menghindari lubang keamanan.

Selanjutnya isi /etc/postfix/virtual sesuka anda. Saya suka Webmin untuk ini. Anda dapat mengeditnya secara langsung juga, tentu saja. Namun, webmin melakukan pekerjaan dengan baik.

Gotcha!:"some.domain" dll. tidak boleh sama dengan apa pun yang disebutkan di baris "mydestination" di

/etc/postfix/main.cf

/etc/postfix/virtual saya memiliki struktur berikut:

beberapa.domain domain virtual beberapa.domain lain.domain virtual domainsome.really.other.domain virtual [email protected] pengguna [email protected] pengguna [email protected] pengguna [email protected]@unixlinux.contohpenggunaonline@unixlinux. seseorang yang tidak menyukai contoh online@unixlinux. seseorang yang tidak menyukai contoh [email protected] [email protected] pengguna yang berbeda secara [email protected] seseorang yang tidak [email protected] seseorang tidak menyukai [email protected]
dan seterusnya. Jadi saya hanya perlu mengatur alias untuk root dan postmaster di /etc/aliasesSemua alias lain harus ada di file ini. Meneruskan dan mengirim email ke beberapa alamat sehingga benteng dapat (dan saya yakin) dapat diatur dalam file ini juga.

Perhatikan bahwa dalam pengaturan seperti ini, pengguna Anda dapat memiliki alias sebanyak yang mereka suka (sampai Anda bosan dengan mereka), tetapi untuk setiap pengguna Anda masih harus menambahkan pengguna asli, dengan direktori home.

Jangan lupa lakukan

postmap /etc/postfix/virtual

setelah selesai.

Sekarang kami ingin beberapa aturan agar spamassassin bekerja lebih baik.

Pertama edit /etc/MailScanner/spam.assassin.prefs.conf.

Komentari dcc_path /usr/bin/dccproc. Beri komentar juga razor_timeout 10 dan
skor RCVD_IN_RSL 0.

Selanjutnya:

cd ..
wget http://www.fsl.com/support/Rules_Du_Jour.tar.gz
tar -zxvf Rules_Du_Jour.tar.gz
aturan cd_du_jour
mkdir /etc/rulesdujour
cp config /etc/rulesdujour/config
aturan cp_du_jour /usr/bin
aturan cp_du_jour_wrapper /etc/cron.daily
/etc/cron.daily/rules_du_jour_wrapper

Selanjutnya kita konfigurasi server DHCP.

Edit /etc/dhcp3/dhcpd.conf. Milik saya sekarang terlihat seperti ini:

# Jaringan Lokalsubnet 192.168.1.0 netmask 255.255.255.0 { opsi netbios-name-server 192.168.1.1; opsi domain-nama-server 192.168.1.1; opsi nama domain "domain.anda.di sini"; pilihan alamat siaran 192.168.1.255; pilihan router 192.168.1.1; kisaran 192.168.1.100 192.168.1.130; }

Edit /etc/default/dhcp3-server. Seharusnya terbaca

INTERFACES=eth1

Selanjutnya:

/etc/init.d/dhcp3-server start

Selanjutnya instal dcc dari sumber

cd /root
wget http://www.dcc-servers.net/dcc/source/dcc.tar.Z
gunzip dcc.tar.Z
tar -xvf dcc.tar
cd dcc*
./configure
buat
lakukan pemasangan
shutdown -r sekarang

dan tunggu hingga aktif kembali.

Mengatur Ubuntu-Server 6.06 LTS Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda - Halaman 8

Sekarang Anda harus mengirim pesan selamat datang kepada setiap pengguna sebenarnya, sehingga membuat struktur Maildir awal di direktori home mereka diperlukan untuk dapat masuk ke akun mereka. Anda dapat menggunakan modul postfix webmin untuk ini. Tidak perlu mengirim apa pun ke alias mereka. Anda mungkin ingin menggunakan akun email eksternal untuk mengirim pesan selamat datang tersebut, namun, Anda harus membuka port 25 di firewall Anda terlebih dahulu untuk melakukannya, seperti yang ditunjukkan pada halaman tuto ini.

Perhatikan bahwa Anda juga harus mengirim pesan ke setiap pengguna baru yang ditambahkan setelah penyiapan awal ini.

Server Webmail Anda terletak di https://domain.anda/webmail (kirim pesan tersebut terlebih dahulu!)

Munin ada di http://domain.anda/munin

Webmin ada di https://your.domain:1000

Jika Anda belum menyetel domain apa pun, gunakan https://192.168.1.1/webmail dll.

Periksa apakah Anda dapat masuk ke email web Anda dan benar-benar mengirim dan menerima email dalam jaringan lokal Anda. Jika Anda puas, buka port 25 pada firewall Anda untuk lalu lintas tcp masuk (postfix) dan port 6277 untuk lalu lintas udp masuk (dcc). Anda mungkin ingin membuat server email web Anda tersedia bagi pengguna Anda dari dunia luar. Buka port 443 untuk lalu lintas tcp masuk juga (apache ssl). Membuka port 993 juga merupakan ide yang baik untuk koneksi tcp masuk, karena memfasilitasi imaps.

/etc/shorewall/rules saya sekarang terlihat seperti ini:(sebagai permulaan, semua pengaturan firewall yang ditampilkan dalam artikel ini hanya untuk membuat Anda aktif dan berjalan, Anda mungkin ingin menyesuaikan pengaturan ini setelah selesai!)

################################################################ ############################################################# ############
#ACTION SOURCE PROTO DEST SUMBER DEST ORIGINAL RATE PENGGUNA/
# PORT PORT(S) DEST LIMIT GROUP
# PORT PORT(S) DEST LIMIT GROUP
TERIMA net $FW tcp 25
TERIMA net $FW tcp 443
TERIMA net $FW tcp 993
TERIMA net $FW udp 6277
#
# Terima koneksi DNS dari firewall ke jaringan
#
DNS/TERIMA $FW net
TERIMA $FW net semua
TERIMA $FW loc all
TERIMA loc $FW all
#
# Menerima koneksi SSH dari jaringan lokal untuk administrasi
#
SSH/ACCEPT loc $FW
#
# Izinkan Ping dari jaringan lokal
#
Ping/ACCEPT loc $FW
#
# Tolak Ping dari zona net "buruk".. dan cegah log Anda dari banjir..
#
Ping/TOLAK net $FW
TERIMA $FW loc icmp
TERIMA $FW net icmp
#LINE TERAKHIR -- TAMBAHKAN ENTRI ANDA SEBELUM YANG INI -- LAKUKAN BUKAN RE PINDAHKAN
Mulai ulang firewall:
/etc/init.d/shorewall mulai ulang

Selanjutnya:

/var/dcc/libexec/updatedcc

Sekarang kami mengonfigurasi Server VPN Anda.

Edit /etc/pptpd.conf. Seharusnya terlihat seperti ini sekarang:

################################################################ ###############################
# $Id:pptpd.conf 4255 2004-10-03 18 :44:00Z rene $
#
# Contoh file konfigurasi Poptop /etc/pptpd.conf
#
# Perubahan efektif saat pptpd di-restart.
## ############################################################# ###########################

# TAG:ppp
# Path ke program pppd, default '/usr/sbin/pppd' on Linux
#
#ppp /usr/sbin/pppd

# TAG:option
# Specifies the location of the PPP options file.
# By default PPP looks in '/etc/ppp/options'
#
option /etc/ppp/pptpd-options

# TAG :debug
# Turns on (more) debugging to syslog
#
#debug

# TAG:stimeout
# Specifies timeout (in seconds) on starting ctrl connection
#
# stimeout 10

# TAG:noipparam
# Suppress the passing of the client's IP address to PPP, which is
# done by default otherwise.
#
#noipparam

# TAG:logwtmp
# Use wtmp(5) to record client connections and disconnections.
#
logwtmp

# TAG:bcrelay
# Turns on broadcast relay to clients from interface
#
#bcrelay eth1

# TAG:localip
# TAG:remoteip
# Specifies the local and remote IP address ranges.
#
# Any addresses work as long as the local machine takes care of the
# routing. But if you want to use MS-Windows networking, you should
# use IP addresses out of the LAN address space and use the proxyarp
# option in the pppd options file, or run bcrelay.
#
# You can specify single IP addresses seperated by commas or you can
# specify ranges, or both. For example:
#
# 192.168.0.234,192.168.0.245-249,192.168.0.254
#
# IMPORTANT RESTRICTIONS:
#
# 1. No spaces are permitted between commas or within addresses.
#
# 2. If you give more IP addresses than MAX_CONNECTIONS, it will
# start at the beginning of the list and go until it gets
# MAX_CONNECTIONS IPs. Others will be ignored.
#
# 3. No shortcuts in ranges! yaitu. 234-8 does not mean 234 to 238,
# you must type 234-238 if you mean this.
#
# 4. If you give a single localIP, that's ok - all local IPs will
# be set to the given one. You MUST still give at least one remote
# IP for each simultaneous client.
#
# (Recommended)
localip 192.168.1.1
remoteip 192.168.1.10-30
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245

Next edit /etc/ppp/options.It should look like this:
asyncmap 0
noauth
lock
hide-password
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
noipx

Edit /etc/ppp/pptpd-options. It should look like this:
###############################################################################
# $Id:pptpd-options 4643 2006-11-06 18:42:43Z rene $
#
# Sample Poptop PPP options file /etc/ppp/pptpd-options
# Options used by PPP when a connection arrives from a client.
# This file is pointed to by /etc/pptpd.conf option keyword.
# Changes are effective on the next connection. See "man pppd".
#
# You are expected to change this file to suit your system. As
# packaged, it requires PPP 2.4.2 and the kernel MPPE module.
###############################################################################


# Authentication

# Name of the local system for authentication purposes
# (must match the second field in /etc/ppp/chap-secrets entries)
name pptp-vpn

# Optional:domain name to use for authentication
# domain mydomain.net

# Strip the domain prefix from the username before authentication.
# (applies if you use pppd with chapms-strip-domain patch)
#chapms-strip-domain


# Encryption
# Debian:on systems with a kernel built with the package
# kernel-patch-mppe>=2.4.2 and using ppp> =2.4.2, ...
# {{{
refuse-pap
refuse-chap
refuse-mschap
# Require the peer to authenticate itself using MS-CHAPv2 [Microsoft
# Challenge Handshake Authentication Protocol, Version 2] authentication.
require-mschap-v2
# Require MPPE 128-bit encryption
# (note that MPPE requires the use of MSCHAP-V2 during authentication)
require-mppe-128
# }}}




# Network and Routing

# If pppd is acting as a server for Microsoft Windows clients, this
# option allows pppd to supply one or two DNS (Domain Name Server)
# addresses to the clients. The first instance of this option
# specifies the primary DNS address; the second instance (if given)
# specifies the secondary DNS address.
# Attention! This information may not be taken into account by a Windows
# client. See KB311218 in Microsoft's knowledge base for more information.
#ms-dns 10.0.0.1
ms-dns 192.168.0.1

# If pppd is acting as a server for Microsoft Windows or "Samba"
# clients, this option allows pppd to supply one or two WINS (Windows
# Internet Name Services) server addresses to the clients. The first
# instance of this option specifies the primary WINS address; the
# second instance (if given) specifies the secondary WINS address.
#ms-wins 10.0.0.3
ms-wins 192.168.0.1

# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system. This will have the effect of making the peer appear to other
# systems to be on the local ethernet.
# (you do not need this if your PPTP server is responsible for routing
# packets to the clients -- James Cameron)
proxyarp

# Debian:do not replace the default route
nodefaultroute


# Logging

# Enable connection debugging facilities.
# (see your syslog configuration for where pppd sends to)
#debug

# Print out all the option values which have been set.
# (often requested by mailing list to verify options)
#dump


# Miscellaneous

# Create a UUCP-style lock file for the pseudo-tty to ensure exclusive
# access.
lock

# Disable BSD-Compress compression
nobsdcomp
auth

Next, edit /etc/ppp/chap-secrets. It should look like this:

# Secrets for authentication using CHAP# client server secret IP addressesuser pptp-vpn abcdefg "*"
Now do:
/etc/init.d/pptpd restart

You must be able now to setup a vpn connection to your new server from the inside of your firewall as "user" with password "abcdefg" (without the quotes) Change this initial username and password and add some users, if you like. Maybe you'll have to reboot some machines to make it work.

Now open your firewall for incoming vpn connections. To do this, set your /etc/shorewall/rules as shown.

My /etc/shorewall/rules at this time:

#############################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/
# PORT PORT(S) DEST LIMIT GROUP
# PORT PORT(S) DEST LIMIT GROUP
ACCEPT net $FW tcp 25
ACCEPT net $FW tcp 443
ACCEPT net $FW tcp 993
ACCEPT net $FW udp 6277
DNAT net fw:192.168.1.1 tcp 1723
DNAT net fw:192.168.1.1 47
#
# Accept DNS connections from the firewall to the network
#
DNS/ACCEPT $FW net
ACCEPT $FW net all
ACCEPT $FW loc all
ACCEPT loc $FW all
#
# Accept SSH connections from the local network for administration
#
SSH/ACCEPT loc $FW
#
# Allow Ping from the local network
#
Ping/ACCEPT loc $FW
#
# Reject Ping from the "bad" net zone.. and prevent your log from being flooded..
#
Ping/REJECT net $FW
ACCEPT $FW loc icmp
ACCEPT $FW net icmp
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
To complete this step, do:
/etc/init.d/shorewall restart

So now your customers will be able to do their (computer network related) job at home as well.

Note, that this only makes sense when your server has a reliable broadband connection to the internet, which in The Netherlands is the defacto standard, even for very tiny offices and most home addresses. In this respect we are way ahead of the rest of the world.

Now edit your /etc/MailScanner/spam.assassin.prefs.conf and add the following lines at the bottom:

score RCVD_IN_SORBS_WEB 10
score RCVD_IN_WHOIS_INVALID 10
score RCVD_IN_WHOIS_BOGONS 10
score RCVD_IN_NJABL_PROXY 10
score RCVD_IN_DSBL 10
score RCVD_IN_XBL 10
score RCVD_IN_BL_SPAMCOP_NET 10
score RCVD_IN_SORBS_DUL 10
score SARE_LWSYMFMT 3
score SARE_MLB_Stock4 3
score SARE_BAYES_5x8 3
score SARE_BAYES_6x8 3
score URIBL_SC_SURBL 10
score URIBL_WS_SURBL 10
score URIBL_PH_SURBL 10
score URIBL_OB_SURBL 10
score URIBL_AB_SURBL 10
score URIBL_JP_SURBL 10
score URIBL_SBL 10
score ALL_TRUSTED 0

Sekarang bersihkan direktori /root Anda. Di situlah semua unduhan dilakukan.

Samba sudah terpasang. Karena setiap pengaturan Samba adalah unik, saya tidak dapat membantu Anda di sini. Tidak tahu bagaimana melakukannya? Ini adalah titik awal yang baik.

To complete all of this, do:

/etc/init.d/mailscanner restart

Now watch the spam reports in the headers of incoming mail (but make sure your users agree to this, as you will be violating some postal and maybe other laws) to adjust the last edit (and add some) to make it work as you like. Especially false negatives and even more false positives should draw your attention. When you are done you may wish to send most spam, if not all, to /dev/null.

Make this spy yob easy:Create a special account to which you send a copy of all mail handled by your server. Let's assume you create this user and call it "spy" (without quotes) and you have given spy a line in /etc/postfix/virtual, (like "[email protected]    spy", without quotes). Selanjutnya:

postmap /etc/postfix/virtual

Now send spy a welcome message, as a rule of thumb, and check that spy's account is fully operational. Selanjutnya:

postconf -e 'always_bcc =spy' 

DONE!


Panels
  1. 5 Solusi Perangkat Lunak Panggilan Terbaik untuk Bisnis Anda

  2. Siapkan Ubuntu-Server 6.10 Sebagai Firewall/Gateway Untuk Lingkungan Bisnis Kecil Anda

  3. Cloud Database Hosting untuk Bisnis Kecil:Mengapa Ini Ideal

  1. Cara mengatur pengalihan untuk situs web Anda di cPanel

  2. Cara Mengatur Firewall dengan UFW di Ubuntu 16.04

  3. 7 Manfaat Menggunakan Virtual Private Server untuk Bisnis Anda

  1. Cara Memilih Paket VPS yang Tepat untuk Bisnis Anda

  2. Cara Mengatur Variabel Lingkungan untuk Layanan systemd di CentOS/RHEL 7

  3. Bagaimana cara mengatur nick default untuk koneksi irssi baru?