Natvps.id – Kutt es un servicio Acortamiento de URL Moderno código abierto Lo que permite a los usuarios acortar la larga URL en un enlace corto, administrar el enlace y ver las estadísticas. KUTT admite el uso de campos personalizados, permite la gestión de usuarios y puede ser auto-anfitrión.
Este artículo se ocupa de los pasos para instalar KUTT en NAT VPS utilizando un Docker, así como la configuración de NGINX para reverso. Este artículo utiliza Ubuntu 22.04 como referencia, pero puede usar otras distribuciones como Debian y CentOS. Asegúrese de que el sistema operativo utilizado admite el Docker.
Configuración de transferencia de puertos
Como usamos las coulis, debemos agregar Configuración de transferencia de 2 puertos En el panel Virtualizor (u otros paneles VPS dependiendo del proveedor), a saber Transferencia de puerto http dan https Para el campo de kutt.
Por ejemplo, en este artículo utilizará un campo kutt.tutorial.mdinata.my.id Para acceder a Kutt. Usted es libre de cambiar el dominio según su elección. Registre este puerto y este campo, ya que lo usaremos nuevamente en el proceso de instalación.

No olvide agregar registros DNS para acceder a su IP pública NAT VPS, como esta:

Si está confundido, lea nuestro artículo sobre Transferencia de dominio Aquí: Explicación de la transferencia de dominio en NAT VPS.
Instalar Docker
Usaremos Docker y componiremos Docker para desplegar Cortar.
Primero, instalar bucle Uso del orden:
apt update && apt install curl -y

Luego corre guión Instalación automática de Docker Al ingresar:
curl -fsSL get.docker.com | sh
Espere hasta que termine el proceso de instalación.

Instalar
En primer lugar, el repositorio de clones Kutt.
git clone --depth 1 /opt/kutt cd /opt/kutt

Copiar la configuración .env En primer lugar antes de comenzar Kutt:
apt install nano -y # Jika belum cp .example.env .env nano .env
Algunas configuraciones que requieren atención:
JWT_SECRET: Key private a lo largo> = 32 caracteres para la autenticación. Para hacerlo, ingrese el pedidopwgen -s 40 1. Debe ser lleno.DEFAULT_DOMAIN: La dirección de su servidor. Ajuste a su campo, por ejemplo: kutt.tutorial.mdinata.my.id
# Optional - App port to run on PORT=3000 # Optional - The name of the site where Kutt is hosted SITE_NAME=Kutt # Optional - The domain that this website is on DEFAULT_DOMAIN=kutt.tutorial.mdinata.my.id # Required - A passphrase to encrypt JWT. Use a random long string JWT_SECRET= # Optional - Database client. Available clients for the supported databases: # pg | better-sqlite3 | mysql2 # other supported drivers that you can use but you have to manually install them with npm: # pg-native | sqlite3 | mysql DB_CLIENT=better-sqlite3 # Optional - SQLite database file path # Only if you're using SQLite DB_FILENAME=db/data # Optional - SQL database credential details # Only if you're using Postgres or MySQL DB_HOST=localhost DB_PORT=5432 DB_NAME=kutt DB_USER=postgres DB_PASSWORD= DB_SSL=false DB_POOL_MIN=0 DB_POOL_MAX=10 # Optional - Generated link length LINK_LENGTH=6 # Optional - Alphabet used to generate custom addresses # Default value omits o, O, 0, i, I, l, 1, and j to avoid confusion when reading the URL LINK_CUSTOM_ALPHABET=abcdefghkmnpqrstuvwxyzABCDEFGHKLMNPQRSTUVWXYZ23456789 # Optional - Tells the app that it's running behind a proxy server # and that it should get the IP address from that proxy server # if you're not using a proxy server then set this to false, otherwise users can override their IP address TRUST_PROXY=true # Optional - Redis host and port REDIS_ENABLED=false REDIS_HOST=127.0.0.1 REDIS_PORT=6379 REDIS_PASSWORD= # The number for Redis database, between 0 and 15. Defaults to 0. # If you don't know what this is, then you probably don't need to change it. REDIS_DB=0 # Optional - Disable registration. Default is true. DISALLOW_REGISTRATION=true # Optional - Disable anonymous link creation. Default is true. DISALLOW_ANONYMOUS_LINKS=true # Optional - This would be shown to the user on the settings page # It's only for display purposes and has no other use SERVER_IP_ADDRESS= SERVER_CNAME_ADDRESS= # Optional - Use HTTPS for links with custom domain # It's on you to generate SSL certificates for those domains manually, at least on this version for now CUSTOM_DOMAIN_USE_HTTPS=false # Optional - Email is used to verify or change email address, reset password, and send reports. # If it's disabled, all the above functionality would be disabled as well. # MAIL_FROM example: "Kutt <[email protected]>". Leave it empty to use MAIL_USER. # More info on the configuration on MAIL_ENABLED=false MAIL_HOST= MAIL_PORT=587 MAIL_SECURE=true MAIL_USER= MAIL_FROM= MAIL_PASSWORD= # Optional - Enable rate limitting for some API routes ENABLE_RATE_LIMIT=false # Optional - The email address that will receive submitted reports REPORT_EMAIL= # Optional - Support email to show on the app CONTACT_EMAIL=

Guarde el archivo con Ctrl-X, yENTONCES Enter.
Finalmente, realiza kutt:
docker compose up -d
Espere el proceso desplegar finalizado. La implementación primero puede tomar unos minutos porque debe descargar todo imagen Kutt y configurar recipiente Desde el principio.

Configuración de Nginx (proxy inverso)
Para que podamos acceder a la URL a través de un área como kutt.tutorial.mdinata.my.idPodemos usar proxy inverso Como nginx.
En primer lugar, instalar Nginx a través del comando:
# Hapus Apache2 dan pendukungnya (biasanya terpasang secara bawaan di VPS OpenVZ) apt purge apache2* -y # Install NGINX apt install nginx -y

Cree una nueva configuración de host específicamente para KUTT:
nano /etc/nginx/sites-available/kutt
Luego pegue la siguiente configuración:
#
proxy_cache_path /root/.nginxcache levels=1:2 keys_zone=my_cache:10m max_size=10g
inactive=60m use_temp_path=off;
server {
server_name kutt.tutorial.mdinata.my.id;
listen 80;
listen [::]:80;
location / {
proxy_cache my_cache;
proxy_cache_revalidate on;
proxy_cache_min_uses 3;
proxy_cache_background_update on;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
proxy_pass
proxy_http_version 1.1;
}
location /api/url/sharex {
proxy_pass
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Content-Type application/json;
proxy_set_body $http_target;
}
} Cambiar kutt.tutorial.mdinata.my.id con tu dominio.

Active la configuración con:
ln -sf /etc/nginx/sites-available/kutt /etc/nginx/sites-enabled/kutt systemctl restart nginx # Restart NGINX
Generar Serifikat SSL (vamos)
Para que nuestro campo sea accesible a través de HTTPS, debemos establecer un certificado SSL. Podemos usar un certificado SSL gratuito de Let’s Cifrypt a través de CertBot.
Instalar El complemento CERTBOT y NGINX usa el comando:
apt install python3-certbot python3-certbot-nginx

ENTONCES, generar Certificado a través de CertBot con el comando
certbot --nginx -d kutt.tutorial.mdinata.my.id
Cambiar kutt.tutorial.mdinata.my.id con tu dominio.

¡Feliz! Se puede acceder a su dominio actual a través de una conexión HTTPS segura.
Acceder a kutt
Se puede acceder a Kutt a través de su campo anterior. Ejemplo: https://kutt.tutorial.mdinata.my.id.

Crear una cuenta administrar Para conectarse por primera vez.

¡Felicitaciones, Kutt está listo para usar!
Frazada
Por lo tanto, este artículo se refiere a los pasos para instalar KUTT en NAT VPS. Si está confundido o dudoso, no dude en hacer preguntas en el grupo Telegram @ IPv6indonia. ¡GRACIAS!
Gentong Pos
Review Film
Berita Terkini
Berita Terkini
Berita Terkini
review anime
Gaming Center
Berita Olahraga
Lowongan Kerja
Berita Terkini
Berita Terbaru
Berita Teknologi
Seputar Teknologi
Berita Politik
Resep Masakan
Pendidikan
