instalación rápida debian 6 como seedbox

0.sh
apt-get update && apt-get upgrade
apt-get install vim
useradd -m -d /home/user user
useradd -m -d /home/www www-data
 
//su www-data & cd /home/www
mkdir -p /home/www/public
mkdir -p /home/www/private
mkdir -p /home/www/log
mkdir -p /home/www/auth
chown -R www-data:www-data /home/www
 
// ^D & su user & cd
mkdir -p /home/user/completo
mkdir -p /home/user/downloading
mkdir -p /home/user/torrent
chown -R user:user /home/user
 
ln -s /home/user/completo /home/www/public/completo
ln -s /home/user/downloading /home/www/public/descargando
ln -s /home/user/torrent /home/www/public/torrent
apt-get install sudo
vim /etc/sudoers
  • sudo apt-get install apache2 apache2-utils autoconf build-essential ca-certificates comerr-dev libapache2-mod-php5 libcloog-ppl-dev libcppunit-dev libcurl3 libcurl4-openssl-dev libncurses5-dev ncurses-base ncurses-term libterm-readline-gnu-perl libsigc++-2.0-dev libssl-dev libtool libxml2-dev ntp openssl patch libperl-dev php5 php5-cli php5-dev php5-curl php5-geoip php5-mcrypt php5-xmlrpc pkg-config python-scgi dtach ssl-cert subversion zlib1g-dev pkg-config unzip htop irssi curl cfv
  • módulos seguridad apache:
    • sudo a2enmod ssl && sudo a2enmod auth_digest && sudo a2enmod rewrite
    • sudo vim /etc/apache2/apache2.conf
      • cambiamos Timeout 30 (valor por defecto 300)
      • añadimos al final: ServerTokens Prod
  • sudo service apache2 restart
  • echo '<?php phpinfo(); ?>' | sudo tee /var/www/info.php
  • para comprobar:
  • crear certificado (válido 3650): sudo openssl req -new -x509 -days 3650 -nodes -newkey rsa:2048 -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem && chmod 600 /etc/apache2/apache.pem
  • activar usuario y contraseña para el directorio rutorrent: sudo htdigest -c /etc/apache2/htpasswd rutorrent user
010-p2p.conf
<VirtualHost *:80>
	RewriteEngine on
	RewriteCond %{SERVER_PORT} =80
	RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}
</VirtualHost>
 
<VirtualHost *:443>
	ServerAdmin webmaster@localhost
 
	SSLEngine on
	SSLCertificateFile /home/www/auth/Servidor_certificado.crt
	SSLCertificateKeyFile /home/www/auth/Servidor_privada.key
	SSLCACertificateFile /home/www/auth/CertificadosRaiz.crt
 
	DocumentRoot /home/www/public
	<Directory />
		Options FollowSymLinks
		AllowOverride All
	</Directory>
	<Directory /home/www/public>
		Options -Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
 
	ErrorLog /home/www/log/error.log
 
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
	LogLevel warn
 
	CustomLog /home/www/log/access.log combined
 
	<Location /rutorrent>
		AuthType Digest
		AuthName "rutorrent"
		AuthDigestDomain /home/www/public/rutorrent/ http://seedbox.torresegea.es/rutorrent
 
		AuthDigestProvider file
		AuthUserFile /home/www/auth/htpasswd
		Require valid-user
		SetEnv R_ENV "/home/www/public/rutorrent"
	</Location>
 
	<Location /completo>
		AuthType Digest
		AuthName "completos"
		AuthDigestDomain /home/www/public/completo/ http://seedbox.torresegea.es/completo
 
		AuthDigestProvider file
		AuthUserFile /home/www/auth/htpasswd2
		Require valid-user
		SetEnv R_ENV "/home/www/public/completo"
 
		Options Indexes
		Order allow,deny
		allow from all
	</Location>
 
</VirtualHost>

es necesario generar los ficheros de certificados y los de contraseñas (o copiarlos de dónde estén)

  • sudo a2ensite default-ssl
  • editamos sudo vim /etc/apache2/ports.conf
/etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
 
NameVirtualHost *:80
Listen 80
 
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
NameVirtualHost *:443
Listen 443
</IfModule>
 
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
  • linux/debian/install-6.txt
  • Darrera modificació: 01/02/2020 14:27
  • per mate