Launching LancerLab: How This Site is Set Up on a Home Mini-Server
In this post, we will discuss how the LancerLab site was launched and configured on a home mini-server with Ubuntu (wplanc) alongside a Docker container for n8n. We will look at the technology stack used, the issues encountered during setup, and how they were resolved.
The Idea: A Personal Business Card Site and Lab
The main idea behind the LancerLab project was to create a personal business card site that would also serve as a lab for testing various technologies and tools. We decided to host it on our own mini-server with Ubuntu, which gave us full control over all aspects of the system.
Additionally, we wanted to integrate a Docker container for n8n to automate various tasks and processes. This allowed us to create a flexible and scalable infrastructure that easily adapts to our needs.
Technology Stack
For implementing the project, we chose the following technology stack:
- Nginx: Web server for handling HTTP requests and load balancing.
- PHP 8.5 FPM: PHP processor with FastCGI support, ensuring high performance.
- MariaDB: A relational database management system compatible with MySQL.
- WordPress 7.1: Content Management System (CMS) for creating and managing the site.
For WordPress, we chose the lightweight block theme Twenty Twenty-Five, which provides good performance and flexibility in configuration. Custom mu-plugins lancerlab-styles.php and lancerlab-i18n.php were also created to add unique styles and support multilingualism.
Real Problems During Setup
During the site setup process, we encountered several issues that had to be resolved. Let’s look at them in more detail:
Lost Nginx Config After Package Reinstallation for n8n and Restoring Port 8081
While installing the Docker container for n8n, we accidentally deleted the Nginx configuration files. This caused our site to stop working. To restore site functionality, we had to:
- Restore a backup of the Nginx configuration files.
- Restart the Nginx service using the command:
sudo systemctl restart nginx - Check log files to identify and resolve potential errors.
We also had to change the port configuration to avoid conflicts with n8n. We redirected traffic to port 8081:
server {
listen 8081;
server_name wplanc.lancerlab.com;
location / {
proxy_pass http://localhost:8080;
...
}
}
IPv6 Proxy KeenDNS Issue (403 from 2a01:4f8:271:5a5c:: when attempting to issue Let’s Encrypt through Certbot)
When trying to obtain an SSL certificate through Certbot, we encountered a 403 error related to the IPv6 proxy KeenDNS. To resolve this issue:
- Checked DNS settings to ensure they are correct.
- Updated Certbot configuration to use IPv4:
sudo certbot --nginx -d wplanc.lancerlab.com - Check Certbot log files to identify and resolve potential errors.
Implementing WP-CLI, Multilingual Support (UA/RU/EN with Auto-Detection of Ukraine), and Integration with GitHub (lancerlab-wp)
To simplify site management, we implemented the WP-CLI tool. This allows us to perform various WordPress operations via the command line, significantly speeding up development and administration processes.
We also added support for Ukrainian (UA), Russian (RU), and English (EN) languages. For this, we used the WPML plugin with settings to automatically detect the language based on the user’s location.
For integration with GitHub, we created a repository lancerlab-wp that contains all site files and allows easy tracking of changes and collaboration with other developers.
Example WP-CLI Command for Publishing a Post
To publish a new post via WP-CLI, you can use the following command:
wp post create --post_title="New Post" --post_content="Post content" --post_status=publish
Plans to Move to a Custom Domain with HTTPS
In the near future, we plan to move the site to its own domain and secure it using the HTTPS protocol. This will allow us to improve the security and reliability of the site, as well as increase user trust.
Moving to a custom domain and switching to HTTPS are important steps in the development of LancerLab. We are confident that these changes will help us create a more stable and secure platform for our users.
We hope this post was helpful and gave you an idea of how the LancerLab site is set up and what issues we had to resolve during its creation. If you have any questions or suggestions, feel free to leave them in the comments!
Добавить комментарий