apfelcast

YOURLS Linux

Jan 16th, 2021
775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. #### Install YOURLS Ubuntu 20.04 ####
  2.  
  3. ## install LAMP stack ##
  4. apt install lamp-server^
  5.  
  6. # open SQL dialoge
  7. mysql
  8.  
  9. # create database calles nextcloud
  10. CREATE DATABASE yourls;
  11.  
  12. # create database user with password
  13. CREATE USER 'yourlsuser'@'localhost' IDENTIFIED BY 'password_here';
  14.  
  15. #grant accesss to databse
  16. GRANT ALL PRIVILEGES ON yourls.* TO 'yourlsuser'@'localhost';
  17.  
  18. #save changes and exit
  19. FLUSH PRIVILEGES;
  20. EXIT;
  21.  
  22. ## get YOURLS ##
  23. apt install git
  24.  
  25. cd /var/www/
  26. git clone https://github.com/YOURLS/YOURLS.git
  27.  
  28. mv YOURLS yourls
  29.  
  30. ## configure YOURLS ##
  31. cd yourls/user
  32. cp config-sample.php config.php
  33.  
  34. nano config.php
  35.  
  36. ## adjust permissions ##
  37. chown -R www-data:www-data /var/www/yourls
  38. chmod -R 775 /var/www/yourls
  39.  
  40. ## adjust apache settings ##
  41. nano /etc/apache2/apache2.conf
  42.  
  43. Change the: AllowOverride None to AllowOverride All
  44.  
  45. ## enable apache module ##
  46. a2enmod rewrite
  47.  
  48. ## add vHost ##
  49. nano /etc/apache2/sites-available/yourls.conf
  50.  
  51. <VirtualHost *:80>
  52. ServerName short.domain.com
  53. DocumentRoot "/var/www/yourls"
  54.  
  55. <Directory "/var/www/yourls">
  56. Require all granted
  57. Options Indexes FollowSymLinks
  58. AllowOverride All
  59. Order allow,deny
  60. Allow from all
  61. </Directory>
  62.  
  63. ErrorLog ${APACHE_LOG_DIR}/error.log
  64. CustomLog ${APACHE_LOG_DIR}/access.log combined
  65.  
  66. </VirtualHost>
  67.  
  68. ## enable site ##
  69. a2ensite yourls.conf
  70.  
  71. ## restart apache ##
  72. service apache2 restart
  73.  
  74. ## browse WebGUI ##
  75. http://domain.com/admin
  76.  
  77. ## adjust config permissions ##
  78. chmod 0600 /var/www/yourls/user/config.php
  79.  
  80. ## get free Let's Encrypt SSL Zertifikate ##
  81. apt install certbot python3-certbot-apache
  82.  
  83. certbot --apache -m [email protected] -d cloud.domain.com
Advertisement
Add Comment
Please, Sign In to add comment