Herramientas de usuario

Herramientas del sitio


para_instalar_tomcat_7_en_debian

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
Próxima revisiónAmbos lados, revisión siguiente
para_instalar_tomcat_7_en_debian [2015/10/29 17:29] jlameiropara_instalar_tomcat_7_en_debian [2015/10/29 20:14] jlameiro
Línea 11: Línea 11:
 [[para_instalar_tomcat_7_en_debian#1. Instalar JAVA.|1. Instalar JAVA.]] [[para_instalar_tomcat_7_en_debian#1. Instalar JAVA.|1. Instalar JAVA.]]
  
-[[para_configurar_ispconfig#2. Synchronize the System Clock.|2. Synchronize the System Clock.]]+[[para_instalar_tomcat_7_en_debian#2. Instalar TOMCAT 7.|2. Instalar TOMCAT 7.]]
  
-[[para_configurar_ispconfig#3. Install Postfix, Dovecot, MySQL, phpMyAdmin, rkhunter, binutils.|3. Install Postfix, Dovecot, MySQL, phpMyAdmin, rkhunter, binutils.]] 
- 
-[[para_configurar_ispconfig#4. Install Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And mcrypt.|4. Install Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And mcrypt.]] 
-   
-[[para_configurar_ispconfig#4.1. Xcache.|4.1. Xcache.]] 
- 
-[[para_configurar_ispconfig#4.2. PHP-FPM.|4.2. PHP-FPM.]] 
-   
-[[para_configurar_ispconfig#5. Install PureFTPd And Quota.|5. Install PureFTPd And Quota.]] 
- 
-[[para_configurar_ispconfig#6. Install Vlogger, Webalizer, And AWstats.|6. Install Vlogger, Webalizer, And AWstats.]] 
-    
-[[para_configurar_ispconfig#7. Install fail2ban.|7. Install fail2ban.]] 
- 
-[[para_configurar_ispconfig#8. Install ISPConfig 3.|8. Install ISPConfig 3.]] 
-   
-[[para_configurar_ispconfig#9. ISPConfig 3 Manual.|9. ISPConfig 3 Manual.]] 
- 
-[[para_configurar_ispconfig#10. Warning.|10. Warning.]] 
-   
 === 1. Instalar JAVA. === === 1. Instalar JAVA. ===
  
-  Se recomienda instalar la última versión de JAVA la cual está disponible en la siguiente dirección: +Se recomienda instalar la última versión de JAVA la cual está disponible en la siguiente dirección: https://www.reucon.com/cdn/java/, en el momento en que fue confeccionado el presente manual la ultima versión estable erajdk-8u66-linux-x64.tar.gz, descargar y copiar en la carpeta /optDescomprimir el archivo descargado
-  https://www.reucon.com/cdn/java/ +<code> 
-  dpkg-reconfigure dash +#tar xzf jdk-8u66-linux-x64.tar.gz 
-   +</code>   
-Use dash as the default system shell (/bin/sh)? <- no +Abrimos la ubicación del directorio recién creado  
- +
-If you don't do thisthe ISPConfig installation will fail. +
- +
-=== 2. Synchronize the System Clock. === +
- +
-Como es un contenedor para establecer el uso horario y demás empleamos el siguiente comando: +
- +
-  dpkg-reconfigure tzdata +
-   +
-=== 3. Install Postfix, Dovecot, MySQL, phpMyAdmin, rkhunter, binutils. === +
- +
-We can install Postfix, Dovecot, MySQL, rkhunter, and binutils with a single command: +
- +
-  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 +
-   +
-You will be asked the following questions: +
- +
-General type of mail configuration: <-- Internet Site +
- +
-System mail name: <-- server1.example.com +
- +
-New password for the MySQL "root" user: <-- yourrootsqlpassword +
- +
-Repeat password for the MySQL "root" user: <-- yourrootsqlpassword +
- +
-Now edit the following file: +
- +
-  nano /etc/postfix/master.cf +
-   +
-Uncomment the submission and smtps sections as follows (leave -o milter_macro_daemon_name=ORIGINATING as we don't need it)+
- +
-  [...] +
-  submission 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=ORIGINATING +
-  smtps     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 +
-  [...] +
-   +
-Restart Postfix afterwards: +
- +
-  /etc/init.d/postfix restart +
-   +
-We want MySQL to listen on all interfaces, not just localhost, therefore we edit /etc/mysql/my.cnf and comment out the line bind-address = 127.0.0.1: +
- +
-  nano /etc/mysql/my.cnf +
-  +
 <file> <file>
-[...] +cd /opt/jdk1.8.0_66/ 
-# Instead of skip-networking the default is now to listen only on +</file>   
-# localhost which is more compatible and is not less secure. +Instalamos JAVA, mediante los siguientes comandos:
-#bind-address           = 127.0.0.1 +
-[...] +
-</file> +
-Then we restart MySQL:+
 <code> <code>
-/etc/init.d/mysql restart +#update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_66/bin/java 2 
-</code> +#update-alternatives --config java 
-Now check that networking is enabled. Run:+#update-alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_66/bin/jar 2 
 +#update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_66/bin/javac 2 
 +#update-alternatives --set jar /opt/jdk1.8.0_66/bin/jar 
 +#update-alternatives --set javac /opt/jdk1.8.0_66/bin/javac 
 +</code>   
 +Nos aseguramos que se haya instalado JAVA de manera satisfactoria
 <code> <code>
-netstat -tap | grep mysql +#java -version 
-</code> +</code>   
-=== 4. Install Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And mcrypt. === +Se debe mostrar lo siguiente:
- +
-Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, and mcrypt can be installed as follows: +
-<code> +
-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 memcached +
-</code> +
-You will see the following question: +
- +
-Web server to reconfigure automatically: <- apache2 +
- +
-Configure database for phpmyadmin with dbconfig-common? <- no +
- +
-Then run the following command to enable the Apache modules suexec, rewrite, ssl, actions, and include (plus dav, dav_fs, and auth_digest if you want to use WebDAV): +
-<code> +
-a2enmod suexec rewrite ssl actions include +
-</code> +
-<code> +
-a2enmod dav_fs dav auth_digest +
-</code> +
-Next open /etc/apache2/mods-available/suphp.conf. +
-<code> +
-nano /etc/apache2/mods-available/suphp.conf +
-</code> +
-... and comment out the <FilesMatch "\.ph(p3?|tml)$"> section and add the line AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml - otherwise all PHP files will be run by SuPHP:+
 <file> <file>
-<IfModule mod_suphp.c> +java version "1.8.0_66" 
-    #<FilesMatch "\.ph(p3?|tml)$"> +Java(TMSE Runtime Environment (build 1.8.0_66-b17) 
-    #    SetHandler application/x-httpd-suphp +Java HotSpot(TM64-Bit Server VM (build 25.66-b17, mixed mode)
-    #</FilesMatch> +
-        AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml +
-        suPHP_AddHandler application/x-httpd-suphp +
- +
-    <Directory /> +
-        suPHP_Engine on +
-    </Directory> +
- +
-    # By default, disable suPHP for debian packaged web applications as files +
-    # are owned by root and cannot be executed by suPHP because of min_uid. +
-    <Directory /usr/share> +
-        suPHP_Engine off +
-    </Directory> +
- +
-# # Use a specific php config file (a dir which contains a php.ini file) +
-#       suPHP_ConfigPath /etc/php5/cgi/suphp/ +
-# # Tells mod_suphp NOT to handle requests with the type <mime-type>. +
-#       suPHP_RemoveHandler <mime-type> +
-</IfModule>+
 </file> </file>
-Restart Apache afterwards+Configurando las variables de entorno
-<code> +Editamos el fichero /etc/profileagregando las lineas siguientes al final del fichero:
-/etc/init.d/apache2 restart +
-</code> +
-=== 4.1. Xcache. === +
- +
-Xcache is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cacherssuch as eAccelerator and APC. It is strongly recommended to have one of these installed to speed up your PHP page. +
- +
-Xcache can be installed as follows: +
-<code> +
-apt-get install php5-xcache +
-</code> +
-Now restart Apache: +
-<code> +
-/etc/init.d/apache2 restart +
-</code> +
-=== 4.2. PHP-FPM. === +
- +
-Starting with ISPConfig 3.0.5, there is an additional PHP mode that you can select for usage with Apache: PHP-FPM. +
- +
-To use PHP-FPM with Apache, we need the mod_fastcgi Apache module (please don't mix this up with mod_fcgid - they are very similar, but you cannot use PHP-FPM with mod_fcgid). We can install PHP-FPM and mod_fastcgi as follows: +
-<code> +
-apt-get install libapache2-mod-fastcgi php5-fpm +
-</code> +
-Make sure you enable the module and restart Apache: +
-<code> +
-a2enmod actions fastcgi alias +
-/etc/init.d/apache2 restart +
-</code> +
-=== 5. Install PureFTPd And Quota. === +
- +
-PureFTPd and quota can be installed with the following command: +
-<code> +
-apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool +
-</code> +
-Edit the file /etc/default/pure-ftpd-common... +
-<code> +
-nano /etc/default/pure-ftpd-common +
-</code> +
-... and make sure that the start mode is set to standalone and set VIRTUALCHROOT=true:+
 <file> <file>
-[...] +# Environment Variables 
-STANDALONE_OR_INETD=standalone +JAVA_HOME=/opt/jdk1.8.0_66 
-[...] +JRE_HOME=/opt/jdk1.8.0_66/jre 
-VIRTUALCHROOT=true +# PATH=$PATH:/opt/jdk1.8.0_66/bin:/opt/jdk1.8.0_66/jre/bin 
-[...]+export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
 </file> </file>
-Now we configure PureFTPd to allow FTP and TLS sessions. FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure. 
  
-If you want to allow FTP and TLS sessions, run: +=== 2. Instalar TOMCAT 7===
-<code> +
-echo 1 > /etc/pure-ftpd/conf/TLS +
-</code> +
-In order to use TLS, we must create an SSL certificate. I create it in /etc/ssl/private/, therefore I create that directory first: +
-<code> +
-mkdir -p /etc/ssl/private/ +
-</code> +
-Afterwards, we can generate the SSL certificate as follows: +
-<code> +
-openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem  +
--out /etc/ssl/private/pure-ftpd.pem +
-</code> +
-Country Name (letter code) [AU]: <-- Enter your Country Name (e.g., "DE").+
  
-State or Province Name (full name) [Some-State]: <-- Enter your State or Province Name. +Se recomienda instalar la última versión de TOMCATla cual está disponible en la siguiente direcciónhttp://www.us.apache.org/dist/tomcat/tomcat-7/v7.0.65/bin/en el momento en que fue confeccionado el presente manual la ultima versión estable eraapache-tomcat-7.0.65.tar.gz, descargar y copiar en la carpeta /tmpDescomprimir el archivo descargado:
- +
-Locality Name (egcity) []<-- 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"IT Department"). +
- +
-Common Name (egYOUR name) []<-- Enter the Fully Qualified Domain Name of the system (e.g"server1.example.com"). +
- +
-Email Address []: <-- Enter your Email Address. +
- +
-Change the permissions of the SSL certificate:+
 <code> <code>
-chmod 600 /etc/ssl/private/pure-ftpd.pem+#tar xzf apache-tomcat-7.0.65.tar.gz
 </code> </code>
-Then restart PureFTPd:+Por motivos de comodidad se cambió el nombre a tomcat, mover esta carpeta al directorio /usr.
 <code> <code>
-/etc/init.d/pure-ftpd-mysql restart +#mv tomcat /usr/tomcat  
-</code> +
-Edit /etc/fstab. Mine looks like this (I added ,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 to the partition with the mount point /): +
-<code> +
-nano /etc/fstab+
 </code> </code>
 +Abrimos la ubicación del directorio recién creado:   
 <file> <file>
-/etc/fstab: static file system information. +cd /usr/tomcat/
-+
-# 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). +
-+
-#                 +
-/dev/mapper/server1-root /               ext4    errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0       1 +
-# /boot was on /dev/sda1 during installation +
-UUID=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+
 </file> </file>
-=== 6. Install Vlogger, Webalizer, And AWstats. === +E iniciamos tomcat
- +
-Vlogger, webalizer, and AWstats can be installed as follows:+
 <code> <code>
-apt-get install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl+# ./bin/startup.sh
 </code> </code>
-Open /etc/cron.d/awstats afterwards... +Debe mostrarse en la consola la información siguiente:
-<code> +
-nano /etc/cron.d/awstats +
-</code> +
-... and comment out everything in that file:+
 <file> <file>
-#MAILTO=root +Using CATALINA_BASE:   /usr/local/tomcat7 
- +Using CATALINA_HOME:   /usr/local/tomcat7 
-#*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh +Using CATALINA_TMPDIR: /usr/local/tomcat7/temp 
- +Using JRE_HOME:        /opt/jdk1.8.0_60 
-# Generate static reports: +Using CLASSPATH      /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar 
-#10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.sh+Tomcat started.
 </file> </file>
-=== 7. Install fail2ban. === +Accediendo al servidor web desde el explorador, por defecto tomcat inicia a través del puerto 8080 
- +http://direccionip:8080 
-This is optional but recommended, because the ISPConfig monitor tries to show the log: +Finalmente agregamos el usuario a administrar el servidor, editamos el fichero
-<code> +
-apt-get install fail2ban +
-</code> +
-To make fail2ban monitor PureFTPd and Dovecot, create the file /etc/fail2ban/jail.local+
-<code> +
-nano /etc/fail2ban/jail.local +
-</code>+
 <file> <file>
-[pureftpd] +conf/tomcat-users.xml
-enabled  = true +
-port     = ftp +
-filter   = pureftpd +
-logpath /var/log/syslog +
-maxretry = 3 +
- +
-[dovecot-pop3imap] +
-enabled = true +
-filter = dovecot-pop3imap +
-action = iptables-multiport[name=dovecot-pop3imap, port="pop3,pop3s,imap,imaps", protocol=tcp] +
-logpath = /var/log/mail.log +
-maxretry = 5 +
- +
-[sasl] +
-enabled  = true +
-port     = smtp +
-filter   = sasl +
-logpath  = /var/log/mail.log +
-maxretry = 3+
 </file> </file>
-Then create the following two filter files: +Por ejemplo de la forma siguiente:
-<code> +
-nano /etc/fail2ban/filter.d/pureftpd.conf +
-</code>+
 <file> <file>
-[Definition] +<!-- user manager can access only manager section --> 
-failregex .*pure-ftpd: \(.*@<HOST>\) \[WARNING\] Authentication failed for user.* +<role rolename="manager-gui" /> 
-ignoreregex =+<user username="manager" password="_SECRET_PASSWORD_" roles="manager-gui" /> 
 + 
 +<!-- user admin can access manager and admin section both --> 
 +<role rolename="admin-gui" /> 
 +<user username="admin" password="_SECRET_PASSWORD_" roles="manager-gui,admin-gui" />
 </file> </file>
 +Reiniciamos el tomcat
 <code> <code>
-nano /etc/fail2ban/filter.d/dovecot-pop3imap.conf+# ./bin/shutdown.sh 
 +# ./bin/startup.sh
 </code> </code>
-<file> +   
-[Definition] +Tomado dehttp://tecadmin.net/steps-to-install-java-on-centos-5-6-or-rhel-5-6/
-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 = +
-</file> +
-Restart fail2ban afterwards: +
-<code> +
-/etc/init.d/fail2ban restart +
-</code> +
-=== 8. Install ISPConfig 3. ===+
  
-To install ISPConfig 3 from the latest released version, do this: +Tomado de: http://tecadmin.net/steps-to-install-tomcat-server-on-centos-rhel/
-<code> +
-cd /tmp +
-wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz +
-tar xfz ISPConfig-3-stable.tar.gz +
-cd ispconfig3_install/install/ +
-</code> +
-The next step is to run +
-<code> +
-php -install.php +
-</code> +
-This will start the ISPConfig 3 installer. The installer will configure all services like Postfix, Dovecot, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. +
-<file> +
--------------------------------------------------------------------------------- +
- _____ ___________   _____              __ _         ____ +
-|_   _/  ___| ___ \ /  __ \            / _(_)       /__ +
-  | | \ `--.| |_/ / | /  \/ ___  _ __ | |_ _  __ _    _/ / +
-  | |  `--. \  __/  | |    / _ \| '_ \|  _| |/ _` |  |_ | +
- _| |_/\__/ / |     | \__/\ (_) | | | | | | | (_| | ___\ \ +
- \___/\____/\_|      \____/\___/|_| |_|_| |_|\__, | \____/ +
-                                              __/ | +
-                                             |___/ +
--------------------------------------------------------------------------------- +
- +
->> Initial configuration +
- +
-Operating System: Debian or compatible, unknown version. +
-</file> +
-Following will be a few questions for primary configuration so be careful. +
- +
-Default values are in [brackets] and can be accepted with . +
- +
-Tap in "quit" (without the quotes) to stop the installer. +
- +
-Select language (en,de) [en]: <-- ENTER +
- +
-Installation mode (standard,expert) [standard]: <-- ENTER +
- +
-Full qualified hostname (FQDN) of the server, eg server1.domain.tld  [server1.example.com]: <-- ENTER +
- +
-MySQL server hostname [localhost]: <-- ENTER +
- +
-MySQL root username [root]: <-- ENTER +
- +
-MySQL root password []: <-- yourrootsqlpassword +
- +
-MySQL database to create [dbispconfig]: <-- ENTER +
- +
-MySQL charset [utf8]: <-- ENTER +
- +
-Country Name (2 letter code) [AU]: <-- ENTER +
- +
-State or Province Name (full name) [Some-State]: <-- ENTER +
- +
-Locality Name (eg, city) []: <-- ENTER +
- +
-Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- ENTER +
- +
-Organizational Unit Name (eg, section) []: <-- ENTER +
- +
-Common Name (e.g. server FQDN or YOUR name) []: <-- ENTER +
- +
-Email Address []: <-- ENTER +
- +
-ISPConfig Port [8080]: <-- ENTER +
- +
-Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: <-- ENTER +
- +
-The installer automatically configures all underlying services, so no manual configuration is needed. +
- +
-Afterwards you can access ISPConfig 3 under http(s)://server1.example.com:8080/ or http(s)://192.168.0.100:8080/ ( http or https depends on what you chose during installation). Log in with the username admin and the password admin (you should change the default password after your first login): +
- +
-=== 9. ISPConfig 3 Manual. === +
-In order to learn how to use ISPConfig 3, I strongly recommend to https://www.howtoforge.com/download-the-ispconfig-3-manual +
- +
-=== 10. Warning. === +
- +
-En algunas ocasiones, el enlace entre el ISPConfig y la aplicación phpMyadmin, no es creado por el proceso de instalación, para lo cual se requiere crear de manera manual, dicho enlace: +
- +
-En etc/apache2/conf.d agregar enlace simbolico a etc/phpmyadmin/apache.conf +
- +
-   +
-Tomado de: https://www.howtoforge.com/perfect-server-debian-wheezy-apache2-bind-dovecot-ispconfig-3+
para_instalar_tomcat_7_en_debian.txt · Última modificación: 2022/11/02 17:58 por 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki