Herramientas de usuario

Herramientas del sitio


manuales:urlshortener

Sistemas Acortar URLs

Los que se han probado de la lista encontrada son:

Cabe destacar que para que el acortador de URL fucione, necesita:

  1. Tener un servidor GNU/Linux con una IP publica
  2. Tener un dominio asociado con la ip publica, que para efectos del ejemplo se ha dejado como localhost o domain.

URL-shortener

apt install git apache2 mariadb-server php libapache2-mod-php php7.0-mysql
cd /var/www/
git clone https://github.com/sapioit/URL-shortener
 
mysql
mysql> create database url;
mysql>CREATE user  dnsurl@localhost IDENTIFIED by 'root';
mysql>GRANT ALL PRIVILEGES on url.* to dnsurl@localhost idenfied by 'root';
mysql>flush privileges;
mysql -u dnsurl -p url
 
nano /etc/apache2/sites-enabled/000-default.conf
   DocumentRoot /var/www/URL-shortener
chown -R www-data:www-data /var/www/    
systemctl restart apache2
 
nano URL-shortener/lib/db.php
$db_connection = mysqli_connect(
  'localhost', 'dnsurl', 'root', 'url')
 
http://domain/

YOURLS

apt install git apache2 mariadb-server php libapache2-mod-php php7.0-mysql
cd /var/www/
git clone https://github.com/YOURLS/YOURLS
cp YOURLS/user/config-sample.php YOURLS/user/config.php
nano YOURLS/user/config.php
  define( 'YOURLS_DB_USER', 'dnsurl' );
  define( 'YOURLS_DB_PASS', 'root' );
  define( 'YOURLS_DB_NAME', 'yours' );
  define( 'YOURLS_SITE', 'http://dnsurl.localhost.com' );
  define( 'YOURLS_LANG', 'es' ); 
  $yourls_user_passwords = array(
        'usuario' => 'misuperclave',
 
mysql
mysql> create database yours;
mysql>CREATE user  dnsurl@localhost IDENTIFIED by 'root';
mysql>GRANT ALL PRIVILEGES on yours.* to dnsurl@localhost idenfied by 'root';
mysql>flush privileges;
nano /etc/mysql/mariadb.conf.d/50-server.cnf
...
    [mysqld]
    innodb_file_format = Barracuda
    innodb_file_per_table = on
    innodb_default_row_format = dynamic
    innodb_large_prefix = 1
    innodb_file_format_max = Barracuda
...
systemctl restart mysql
mysql -u dnsurl -p yours
 
 
nano /etc/apache2/sites-enabled/000-default.conf
    DocumentRoot /var/www/YOURLS 
    <Directory /var/www/YOURLS/>
        Options -Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
 
chown -R www-data:www-data /var/www/    
a2enmod  rewrite
systemctl restart apache2
 
nano /var/www/YOURLS/includes/functions-install.php
...
     '`keyword` varchar(600) BINARY NOT NULL,'.
...
 
http://domain/admin/install.php

Kutt

apt install git apache2 postgresql redis-server exim4
nano /etc/postgresql/9.6/main/pg_hba.conf 
  local   all             all                                     md5
systemctl  restart postgresql
 
postgres=# create user dnsurl with encrypted password 'root';
postgres=# create database url with owner dnsurl;
postgres=# alter user dnsurl with superuser;
postgres=# \q
psql -h localhost -U dnsurl -W -d url
 
 
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt-get install -y nodejs
nodejs -v
 
cd /var/www
git clone https://github.com/thedevs-network/kutt
cd kutt
cp .example.env .env
nano .env 
  DEFAULT_DOMAIN="dnsurl.localhost.com"
 
  DB_HOST=localhost
  DB_PORT=5432
  DB_NAME=url
  DB_USER=dnsurl
  DB_PASSWORD=root
  ...
  ADMIN_EMAILS=admin@gmail.com
  ...
  MAIL_HOST=localhost
  MAIL_PORT=25
  MAIL_SECURE=false
  MAIL_USER=root
  MAIL_FROM=root
  MAIL_PASSWORD=pepe
  REPORT_EMAIL=root@localhost
  CONTACT_EMAIL=root@localhost
  ...
 
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html
nano /etc/apache2/sites-enabled/000-default.conf
        DocumentRoot /var/www/html/
 
        ProxyPreserveHost On
	ProxyPass / http://0.0.0.0:3000/
	ProxyPassReverse / http://0.0.0.0:3000/
 
systemctl restart apache2
 
npm install
npm run dev & # and register on the site
 
psql
postgres=# \c  url
postgres=# select * from users;
postgres=# update  users set verified=true where email='admin@gmail.com';
postgres=# update  users set verification_expires=NULL where email='admin@gmail.com';
postgres=# \q
#Login in kutt

Referencias

manuales/urlshortener.txt · Última modificación: por manuel.floresv