HTMLy Tutorial

How to Install HTMLy on Ubuntu/Debian with SSL

Prerequisites

  • Ubuntu 20.04/22.04 LTS or Debian 10/11
  • Root or sudo access
  • Domain name pointed to your server
  • Minimum 1GB RAM (2GB recommended)

Step 1: Update System

sudo apt update && sudo apt upgrade -y

Step 2: Install LAMP Stack

Install Apache:

sudo apt install -y apache2

Install MySQL:

sudo apt install -y mysql-server
sudo mysql_secure_installation

Install PHP and extensions:

sudo apt install -y php libapache2-mod-php php-mysql php-curl php-gd php-mbstring php-xml php-zip unzip

Step 3: Create Database

sudo mysql -u root -p
CREATE DATABASE htmly_db;
CREATE USER 'htmly_user'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON htmly_db.* TO 'htmly_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 4: Install HTMLy

cd /var/www
sudo wget https://github.com/danpros/htmly/releases/latest/download/htmly.zip
sudo unzip htmly.zip
sudo mv htmly yourdomain.com
sudo chown -R www-data:www-data /var/www/yourdomain.com
sudo chmod -R 755 /var/www/yourdomain.com

Step 5: Configure Apache

sudo nano /etc/apache2/sites-available/yourdomain.com.conf

Paste (update domain):

<VirtualHost *:80>
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    DocumentRoot /var/www/yourdomain.com
    
    <Directory /var/www/yourdomain.com>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/yourdomain.com_error.log
    CustomLog ${APACHE_LOG_DIR}/yourdomain.com_access.log combined
</VirtualHost>

Step 6: Enable Site

sudo a2ensite yourdomain.com.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

Step 7: Install SSL with Let’s Encrypt

sudo apt install -y certbot python3-certbot-apache
sudo certbot --apache -d yourdomain.com -d www.yourdomain.com

Step 8: Complete Installation

  1. Visit https://yourdomain.com
  2. Follow the setup wizard
  3. Enter database details:
    • Database: htmly_db
    • Username: htmly_user
    • Password: your_secure_password
    • Host: localhost

Step 9: Secure Your Installation

sudo chmod -R 750 /var/www/yourdomain.com/
sudo chmod 640 /var/www/yourdomain.com/.htaccess

Troubleshooting

403 Forbidden: Check directory permissions

500 Error: Verify PHP extensions are installed

SSL Issues: Run sudo certbot renew --dry-run

Maintenance

Auto-renew SSL:

sudo certbot renew --quiet --no-self-upgrade

Backup:

sudo tar -czf htmly_backup_$(date +%F).tar.gz /var/www/yourdomain.com

Views: 11

Xog Ops