Use dpkg to manage packages on Debian-based Linux distributions
dpkg is the low-level package manager for Debian-based Linux operating systems (including derivatives like Ubuntu). It is used to install, remove, and build software packages.
website·Indexed 29 days ago
https://www.subarkah.comA collection of tutorials and guides focusing on website development and system administration. Content includes WordPress custom code, plugin development, LEMP stack setup on Ubuntu 24.04, server security, and tools like Composer and dpkg.
sites-available to sites-enabled to activate the configuration, then test and restart Nginx.# Enable the site
sudo ln -s /etc/nginx/sites-available/uio.my.id /etc/nginx/sites-enabled/uio.my.id
# Test configuration
sudo nginx -t
# Restart Nginx
sudo service nginx restart/etc/nginx/nginx.conf should be updated to handle WebP mapping, SSL protocols (TLSv1 through TLSv1.3), Gzip compression, and specific client body size limits.# Add repository and install
sudo add-apt-repository ppa:ondrej/nginx -y
sudo apt update
sudo apt install nginx -y
# Verify installation
nginx -vuser www-data; worker_processes 1; pid /run/nginx.pid; error_log /var/log/nginx/error.log; include /etc/nginx/modules-enabled/*.conf;
events { worker_connections 1024; multi_accept on; }
http { map $http_accept $webp_suffix{ default ""; "~*webp" ".webp"; }
keepalive_timeout 15;
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
client_max_body_size 64m;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;}
# Switch to the site user
sudo su uio
cd /home/uio
# Install Bedrock via Composer
composer create-project roots/bedrock uio.my.id
# Create logs directory
sudo mkdir -p /home/uio/uio.my.id/logscurl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
# Test installation
wp --info# Install UFW
sudo apt install ufw
# Allow SSH, HTTP, and HTTPS
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
# Review added rules
sudo ufw show added
# Enable the firewall
sudo ufw enable
# Verify active status
sudo ufw status verboseUse a separate domain for a microsite when the project meets one of the following criteria:
www-data group for web server access, and set up the directory structure for public files and logs. Ensure the user owns their home directory.# Create the user
sudo useradd mitra
# Add user to www-data group
sudo usermod -a -G mitra www-data
# Create public and log directories
sudo mkdir -p /home/mitra/mitra.web.id/public
sudo mkdir -p /home/mitra/mitra.web.id/logs
# Set ownership of the home directory
sudo chown -R mitra:mitra /home/mitra# Switch to site user and enter public directory
sudo su mitra
cd /home/mitra/mitra.web.id/public
# Download WordPress
wp core download
# Configure database
wp core config --dbname=mitra_db --dbuser=mitra_user --dbpass='Workshop@WPBogor2025'
# Install WordPress
wp core install --skip-email --url=https://www.mitra.web.id --title='Workshop WPBogor' --admin_user=akah --admin_email=[email protected] --admin_password='password'
# Cleanup unnecessary plugins and themes
wp plugin delete akismet
wp plugin delete hello
wp theme delete twentytwentyfour
wp theme delete twentytwentythreeCREATE DATABASE uio_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
CREATE USER 'uio_user'@'localhost' IDENTIFIED BY 'YourStrongPassword';
GRANT ALL PRIVILEGES ON uio_db.* TO 'uio_user'@'localhost';
FLUSH PRIVILEGES;sudo apt install mariadb-server
sudo systemctl enable mariadb
sudo systemctl start mariadb
# Secure the installation
sudo mysql_secure_installationwww-data group, and set up their home directory with correct ownership.# Create the user
sudo useradd uio
# Add user to www-data group
sudo usermod -a -G uio www-data
# Create home directory
sudo mkdir -p /home/uio
# Set ownership
sudo chown -R uio:uio /home/uio