sleed Posted January 25, 2014 Report Posted January 25, 2014 Aveti un calculator vechi si nu stiti ce sa faceti cu el ? Aveti resurse bunicele , cat sa va tina un server ? Vreti sa va jucati , si sa invatati in acelasi timp? Bun , deviza mea este : SA TRECEM LA TREABA.Sa TRecem la Treaba.DE ce avem nevoie?0.1).Distro Debian , se gaseste aici : Debian -- Getting DebianHaideti sa configuram Network Interfaces : Deschide ti consola si : nano /etc/network/interfacesV-oi folosi ip ul 192.168.0.100 , deoarece asa e configurat la mine pe eth0. Adaugam lista in interfaces : # This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interface#allow-hotplug eth0#iface eth0 inet dhcpauto eth0iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1Restart la net : /etc/init.d/networking restart Modificam hosts nano /etc/hosts127.0.0.1 localhost.localdomain localhost192.168.0.100 serverumeu.nektsistems.com server1# The following lines are desirable for IPv6 capable hosts::1 localhost ip6-localhost ip6-loopbackff02::1 ip6-allnodesff02::2 ip6-allroutersAcuma scriem in consola : echo serverumeu.nektsistems.com > /etc/hostname/etc/init.d/hostname.sh startRulam : hostname in consola , apoi hostname -f Sa aveti neaparat aceste librarii instalate in sources list : scriem in consola nano /etc/apt/sources.listsi adaugam :deb Index of /debian wheezy main contrib non-freedeb-src Index of /debian wheezy main contrib non-freedeb Debian -- Security Information wheezy/updates main contrib non-freedeb-src Debian -- Security Information wheezy/updates main contrib non-free# wheezy-updates, previously known as 'volatile'deb Index of /debian wheezy-updates main contrib non-freedeb-src Index of /debian wheezy-updates main contrib non-freeRulam in consola apt-get update , apoi apt-get upgrade Reconfiguram shellu cu comanda : dpkg-reconfigure dashUpdatam timpul , clock : apt-get install ntp ntpdate0.2) Instalam : Postfix, Dovecot, MySQL, phpMyAdmin, rkhunter, binutilsIn consola scriem : apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve sudo General type of mail configuration: <-- Internet SiteSystem mail name: <-- serverumeu.nektsistems.comNew password for the MySQL "root" user: <-- parola pentru root...Repeat password for the MySQL "root" user: <-- repetam parola Bun acum ne "jucam" cu TSL/SSL ports, nano /etc/postfix/master.cfsubmission inet n - - - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject# -o milter_macro_daemon_name=ORIGINATINGsmtps inet n - - - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject# -o milter_macro_daemon_name=ORIGINATING[...]Nu stergi nimic , adaugi ce este aici .Restart postfix : /etc/init.d/postfix restartCa mysql sa de-a listen la toate interfetele , in : /etc/mysql/my.cnfcautam linia si modificam asa : #bind-address = 127.0.0.1, adica bind adress , sa fie localhost Apoi dam restart la mysql : /etc/init.d/mysql restart SI vedem procesul : netstat -tap | grep mysql0) Instalam :Amavisd-new, SpamAssassin, And Clamavapt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perlUpdate la spam assasin : /etc/init.d/spamassassin stopupdate-rc.d -f spamassassin remove1)Instalam Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And mcrypt apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libruby libapache2-mod-ruby libapache2-mod-python php5-curl php5-intl php5-memcache php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl memcachedWeb server to reconfigure automatically: <-- apache2Configure database for phpmyadmin with dbconfig-common? <-- No Apoi , sa adaugam niste module in apache , scriem in consola : a2enmod suexec rewrite ssl actions includea2enmod dav_fs dav auth_digestApoi , deschidem cu nano /etc/apache2/mods-available/suphp.confcautam linia <FilesMatch "\.ph(p3?|tml)$"> , ADAUGAM DUPA ACEASTA LINIE : AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtmlRestart apache : /etc/init.d/apache2 restartAdaugam modulul RUBY : , scriem in consola : nano /etc/mime.types, si adaugam #application/x-ruby rbRESTART APACHE : /etc/init.d/apache2 restart2) Instalam Xcacheapt-get install php5-xcacheRestart apachE /etc/init.d/apache2 restart3) Instalam PHP+FPM[PEntru ISPCONFIG]apt-get install libapache2-mod-fastcgi php5-fpm Scriem in consola urmatoarele comenzi : Prima: a2enmod actions fastcgi aliasA 2-a: /etc/init.d/apache2 restart 4)Instalam MAILMANDeschidem consola,scriemapt-get install mailmanLanguages to support: <-- en (English)Missing site list <-- Ok Scriem in consola , newlist mailmanroot@server1:~# newlist mailmanEnter the email of the person running the list: <-- admin email address, e.g. listadmin@JEPELE.comInitial mailman password: <-- admin password for the mailman listTo finish creating your mailing list, you must edit your /etc/aliases (orequivalent) file by adding the following lines, and possibly running the`newaliases' program:Enter , si done.Scrii in consola : nano /etc/aliases,si adaugi urmatoarele : ## mailman mailing listmailman: "|/var/lib/mailman/mail/mailman post mailman"mailman-admin: "|/var/lib/mailman/mail/mailman admin mailman"mailman-bounces: "|/var/lib/mailman/mail/mailman bounces mailman"mailman-confirm: "|/var/lib/mailman/mail/mailman confirm mailman"mailman-join: "|/var/lib/mailman/mail/mailman join mailman"mailman-leave: "|/var/lib/mailman/mail/mailman leave mailman"mailman-owner: "|/var/lib/mailman/mail/mailman owner mailman"mailman-request: "|/var/lib/mailman/mail/mailman request mailman"mailman-subscribe: "|/var/lib/mailman/mail/mailman subscribe mailman"mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"Scrii newaliases , Restart /etc/init.d/postfix restartApoi activam apache mailman modu: ln -s /etc/mailman/apache.conf /etc/apache2/conf.d/mailman.confRestart apache : /etc/init.d/apache2 restart Activam Daemon Mailman : /etc/init.d/mailman startXIV)Instalam PureFTPd And QuotaOpen consola -> apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatoolapoi deschidem consola,tastam nano /etc/default/pure-ftpd-commonsi ne asiguram ca aceste setari sunt exact asa : STANDALONE_OR_INETD=standalone[...]VIRTUALCHROOT=trueNe asiguram ca ssl mod merge : echo 1 > /etc/pure-ftpd/conf/TLSmkdir -p /etc/ssl/private/Generam un certificat SSL : openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pemCountry Name (2 letter code) [AU]: <-- Enter your Country Name (e.g., "DE").State or Province Name (full name) [some-State]: <-- Enter your State or Province Name.Locality Name (eg, city) []: <-- Enter your City.Organization Name (eg, company) [internet Widgits Pty Ltd]: <-- Enter your Organization Name (e.g., the name of your company).Organizational Unit Name (eg, section) []: <-- Enter your Organizational Unit Name (e.g. "NEKT DEPARTAMENT").Common Name (eg, YOUR name) []: <-- Enter the Fully Qualified Domain Name of the system (e.g. "serverumeu.nektsistems.com").Email Address []: <-- Enter your Email Address.Schimbam permisiile pentru certificat : consola , scriem : chmod 600 /etc/ssl/private/pure-ftpd.pemApoi restart pure ftpd restart/etc/init.d/pure-ftpd-mysql restartDeschidem in consola :nano /etc/fstabNe asiguram ca este ca aici : # /etc/fstab: static file system information.## Use 'blkid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## <file system> <mount point> <type> <options> <dump> <pass>/dev/mapper/server1-root / ext4 errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 1# /boot was on /dev/sda1 during installationUUID=46d1bd79-d761-4b23-80b8-ad20cb18e049 /boot ext2 defaults 0 2/dev/mapper/server1-swap_1 none swap sw 0 0/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0Daca nu , in consola , tastam : mount -o remount /quotacheck -avugmquotaon -avugVX)Instalam BIND DNS SERVERapt-get install bind9 dnsutils5) Instalam Vlogger, Webalizer, And AWstats apt-get install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perlScriem in consola : nano /etc/cron.d/awstatsSi comentam la liniile urmatoare : #MAILTO=root#*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh# Generate static reports:#10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.shSA FIE EXACT ASA.6) Instalam JAILKITapt-get install build-essential autoconf automake1.9 libtool flex bison debhelper binutils-goldcd /tmpwget http://olivier.sessink.nl/jailkit/jailkit-2.15.tar.gztar xvfz jailkit-2.15.tar.gzcd jailkit-2.15./debian/rules binarySau.deb , asacd ..dpkg -i jailkit_2.15-1_*.debrm -rf jailkit-2.15*7) Instalam Fail2BANConsola ->apt-get install fail2banTot in consola ,nano /etc/fail2ban/jail.localNe asiguram ca configuratiile urmatoare suntin fisier :[pureftpd]enabled = trueport = ftpfilter = pureftpdlogpath = /var/log/syslogmaxretry = 3[dovecot-pop3imap]enabled = truefilter = dovecot-pop3imapaction = iptables-multiport[name=dovecot-pop3imap, port="pop3,pop3s,imap,imaps", protocol=tcp]logpath = /var/log/mail.logmaxretry = 5[sasl]enabled = trueport = smtpfilter = sasllogpath = /var/log/mail.logmaxretry = 3 Facem 2 filtere :Deschidem consola nano /etc/fail2ban/filter.d/pureftpd.confAdaugam : [Definition]failregex = .*pure-ftpd: \(.*@<HOST>\) \[WARNING\] Authentication failed for user.*ignoreregex =Din nou , deschidem : nano /etc/fail2ban/filter.d/dovecot-pop3imap.confAdaugam : [Definition]failregex = (?: pop3-login|imap-login): .*(?:Authentication failure|Aborted login \(auth failed|Aborted login \(tried to use disabled|Disconnected \(auth failed|Aborted login \(\d+ authentication attempts).*rip=(?P<host>\S*),.*ignoreregex =REstart fail2ban : /etc/init.d/fail2ban restart 8) Instalam SquirellMailapt-get install squirrelmailsquirrelmail-configure , sa configuram,Comanda -> D -> dovecot -> S -> QHaideti sa adaugam la apache , configuratia de la Squirell : Tastam in consola : cd /etc/apache2/conf.d/ln -s ../../squirrelmail/apache.conf squirrelmail.conf/etc/init.d/apache2 reloadDeschidem consola , scriem: nano /etc/apache2/conf.d/squirrelmail.conf[...]<Directory /usr/share/squirrelmail> Options FollowSymLinks <IfModule mod_php5.c> AddType application/x-httpd-php .php php_flag magic_quotes_gpc Off php_flag track_vars On php_admin_flag allow_url_fopen Off php_value include_path . php_admin_value upload_tmp_dir /var/lib/squirrelmail/tmp php_admin_value open_basedir /usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/etc/hostname:/etc/mailname php_flag register_globals off </IfModule> <IfModule mod_dir.c> DirectoryIndex index.php </IfModule> # access to configtest is limited by default to prevent information leak <Files configtest.php> order deny,allow deny from all allow from 127.0.0.1 </Files></Directory>[...]Adaugam ce este cu albastru!Cream directoru temp , la squirell , mkdir /var/lib/squirrelmail/tmpTastam in consola : chown www-data /var/lib/squirrelmail/tmpRestart apache : /etc/init.d/apache2 reload DE AICI POTI SA ITI ACCESEZI SQUIRELL MAIL : http://192.168.0.100/squirrelmailhttp://www.example.com/squirrelmailSi PASUL FINAL , ISPCONFIG/CPANEL, CE DORITI,am sa pun ISPCONFIGDeschidem alta consola , scriem : cd /tmpwget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gztar xfz ISPConfig-3-stable.tar.gzcd ispconfig3_install/install/php -q install.php ---> Ca sa functioneze in concordanta cu PHP uSelect language (en,de) [en]: <-- ENTERInstallation mode (standard,expert) [standard]: <-- ENTERFull qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.example.com]: <-- ENTERMySQL server hostname [localhost]: <-- ENTERMySQL root username [root]: <-- ENTERMySQL root password []: <-- yourrootsqlpasswordMySQL database to create [dbispconfig]: <-- ENTERMySQL charset [utf8]: <-- ENTERGenerating a 4096 bit RSA private key.............................................................++.........................................................................................................................++writing new private key to 'smtpd.key'-----You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [AU]: <-- ENTERState or Province Name (full name) [some-State]: <-- ENTERLocality Name (eg, city) []: <-- ENTEROrganization Name (eg, company) [internet Widgits Pty Ltd]: <-- ENTEROrganizational Unit Name (eg, section) []: <-- ENTERCommon Name (e.g. server FQDN or YOUR name) []: <-- ENTEREmail Address []: <-- ENTERConfiguring JailkitConfiguring DovecotConfiguring SpamassassinConfiguring AmavisdConfiguring GetmailConfiguring PureftpdConfiguring BINDConfiguring ApacheConfiguring VloggerConfiguring Apps vhostConfiguring Bastille FirewallConfiguring Fail2banInstalling ISPConfigISPConfig Port [8080]: <-- ENTERDo you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: <-- ENTERGenerating RSA private key, 4096 bit long modulus.................................................................................................++........++e is 65537 (0x10001)You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [AU]: <-- ENTERState or Province Name (full name) [some-State]: <-- ENTERLocality Name (eg, city) []: <-- ENTEROrganization Name (eg, company) [internet Widgits Pty Ltd]: <-- ENTEROrganizational Unit Name (eg, section) []: <-- ENTERCommon Name (e.g. server FQDN or YOUR name) []: <-- ENTEREmail Address []: <-- ENTERPlease enter the following 'extra' attributesto be sent with your certificate requestA challenge password []: <-- ENTERAn optional company name []: <-- ENTERwriting RSA keyConfiguring DBServerInstalling ISPConfig crontabno crontab for rootno crontab for getmailRestarting services ...Stopping MySQL database server: mysqld.Starting MySQL database server: mysqld ..Checking for tables which need an upgrade, are corrupt or werenot closed cleanly..Stopping Postfix Mail Transport Agent: postfix.Starting Postfix Mail Transport Agent: postfix.Stopping amavisd: amavisd-new.Starting amavisd: amavisd-new.Stopping ClamAV daemon: clamd.Starting ClamAV daemon: clamd .Restarting IMAP/POP3 mail server: dovecot.[Tue May 07 02:36:22 2013] [warn] NameVirtualHost *:443 has no VirtualHosts[Tue May 07 02:36:22 2013] [warn] NameVirtualHost *:80 has no VirtualHosts[Tue May 07 02:36:23 2013] [warn] NameVirtualHost *:443 has no VirtualHosts[Tue May 07 02:36:23 2013] [warn] NameVirtualHost *:80 has no VirtualHostsRestarting web server: apache2 ... waiting .Restarting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -H -O clf:/var/log/pure-ftpd/transfer.log -Y 1 -D -u 1000 -A -E -b -8 UTF-8 -BInstallation completed.root@server....:/tmp/ispconfig3_install/install#Ca sa intri pe Panoul de control , intri de aici : http(s)://192.168.0.100:8080/ , sau HTTPS://IP-ULTAU:8080Asta a fost cam tot , va multumesc pentru vizualizare:) Sper sa va placa .Source /Sursa : 1) SURSA 12) Sursa 23) Sursa 3TESTAT DE MINE + WORKING 100% , DACA SUNT PROBLEME , ASTEPT P.M , SAU COMENTATI MAI JOS. MULTUMESC PENTRU VIZUALIZARE Quote
Kalashnikov. Posted January 25, 2014 Report Posted January 25, 2014 de modificat in titlu: Tutorial instalare server apache pe debian Quote
kp112 Posted February 26, 2014 Report Posted February 26, 2014 (edited) [ ok ] Restarting authentication failure monitor: fail2ban.fail2ban eroare am editat/etc/fail2ban/jail.localfilter = pureftpdonfilter = pure-ftpdsi tot degeaba, am incercat si asta editat si /etc/fail2ban/filter.d/sasl.conffailregex = (?i): warning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failedEditare /etc/fail2ban/jail.local:[sasl]..logpath = /var/log/mail.warnsi degeaba Edited February 26, 2014 by kp112 Quote
quantum Posted February 26, 2014 Report Posted February 26, 2014 Si PASUL FINAL , ISPCONFIG/CPANEL, CE DORITI,am sa pun ISPCONFIGPentru instalare CPANEL se recomanda o versiune minima a sistemul de operare plus ca cpanel suporta doar - CentOS versions 5.x, 6.x - Red Hat® Enterprise Linux® versions 5.x, 6.x - CloudLinux 5.x, 6.x [3]System Requirements | cPanel, Inc. Quote
kp112 Posted March 14, 2014 Report Posted March 14, 2014 totu merge parfum doar la mail este o problema de trimis trimite dar la reply da eroare Quote
Corex Posted March 24, 2014 Report Posted March 24, 2014 Tin sa aduc aminte ca acest tut merge si pe ubuntu. Quote
sleed Posted March 24, 2014 Author Report Posted March 24, 2014 Da , merge , e important sa va uitati si pe tutoriale pentru securizare.. Daca vrei 4fun, recomand /etc/apache2 start, & mysql start cu phpmyadmin pentru testari de framework etc.. Daca vreti ceva mai serios trebuie bind server, mail , ispconfig [pentru buna gestionare] , instalare Selinux, kernelu sa fie la zi ,pam module,implementarea kerberos, chroot , incapsulare criptografica ...etc Quote