Tutorial Polr URL Shortener

Asphyxia

Server Monkey
Administrator
Joined
Apr 25, 2015
Messages
944
Likes
1,412
Points
217
Age
25
Location
North America
#1
If you have any questions on any step, please ask so I can make other tutorials - ask any questions!

Prerequisites:

Instructions:
  1. Either
    You do not have permission to view link Log in or register now.
    .
  2. Once logged in,
    You do not have permission to view link Log in or register now.
    .
  3. Select a country nearest you.
  4. Select 64 bit Ubuntu 18.10
  5. $10 or $20 a month server is a good idea!
  6. Step 8 hostname should be your domain like 0rcas.com
  7. Click "Deploy Now" bottom right!
  8. Connect to your server
    You do not have permission to view link Log in or register now.
    .
From within your PuTTY session, here are commands we should run!

Code:
apt update
apt upgrade -y
apt install apache2 php mysql-server composer php-curl php-json php-tokenizer php-mbstring php-mysql php-pdo -y
mysql_secure_installation
cd /var/www
git clone https://github.com/cydrobolt/polr.git --depth=1
chmod -R 755 polr
chown -R www-data polr
curl -sS https://getcomposer.org/installer | php
mv composer.phar ./polr/
apt install zip unzip -y
cd ./polr/
php composer.phar install --no-dev -o
nano /etc/apache2/sites-enabled/000-default.conf
From here, go ahead and Ctrl+K until your VirtualHost tags are wiped out.

Now paste in simply replacing all (2) the example.com with your own domain.
Code:
<VirtualHost *:80>
    ServerName example.com
    ServerAlias example.com

    DocumentRoot "/var/www/polr/public"
    <Directory "/var/www/polr/public">
        Require all granted
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
Now Ctrl+O and enter to save, Ctrl+X to exit.

Code:
a2enmod rewrite
systemctl restart apache2
mysql
Now we need to enter some SQL with our own username and password instead of asphyxia, r4p3nets:

Code:
create database polr;
CREATE USER 'asphyxia'@'localhost' IDENTIFIED BY 'r4p3nets';
GRANT ALL ON polr.* to 'asphyxia'@'localhost';
FLUSH PRIVILEGES;
exit;
Now for more PuTTY commands:
Code:
cd /var/www/polr
cp .env.setup .env
cd /var/www
chmod -R 755 polr
chown -R www-data polr
Yes inefficient/redundant but I am tired right now - it works. It's not like this is a huge program needing high efficiency, just quick automation.

Now load your website, with /setup so you should be able to configure your installation!
 
Last edited:

Top