Greetings!
I have made the decision to switch from hosting to VDS, but I am facing some difficulties with regards to how to position my sites on VDS and ensure access (such as via ftp) to a specified site for a certain user or group.
In essence, I am unable to decide if it is necessary to create one user for each project (site), or if it would be better to establish a separate user whereby all projects are stored in their home folder (where ftp access can already be granted for "user-project folders"), or if projects should be kept anywhere in /var/www.
Could you recommend a best practice for organizing servers of this kind?
You can utilize remote management techniques such as ssh with keys and rsync/git for updating content.
If FTP is necessary, one option is to use vsftpd. Additionally, learning a tool like ansible for quick deployment based on a template can be helpful. If dealing with untrusted users, implementing chroot at the service level that supports it may be necessary.
It is easier to install a control panel, such as Ispmanager Lite, which costs around $20-30 with an eternal license, instead of creating a custom solution for each user.
Paying for the control panel once is nothing to be ashamed of.
In order to accomplish this task, VDS needs to be ready to deploy LAMP, specifically, PHP, Linux, Apache, and MYSQL. These are all necessary components for ensuring the proper operation of dynamic websites and special applications.
The easiest way to proceed is by installing LAMP during the creation of VDS via the control panel, which involves naming the server, selecting the desired operating system or software, specifying the required configuration, adding an SSH key (if available), activating DDOS protection, and paying the applicable tariff. This results in a VDS and optimal configuration for working on any internet projects.
Alternatively, if the user already has a server, they can manually install LAMP and its necessary components after authorizing with their specified username and password that are sent to their email during server creation.
The installation process involves installing the Apache Virtual Server, enabling automatic downloads, specifying the password, configuring protection settings through a wizard, answering important questions, choosing plugins (if necessary), and installing PHP. Note that this list may vary slightly depending on specific circumstances.
One recommended best practice is to create separate user accounts for each project (site). This approach provides a level of isolation between projects, which can be advantageous for security and resource management. Each user account would have its own home directory where the associated project files are stored. Access to these directories can be managed using permissions, and FTP access can be granted on a per-user basis.
Another option is to utilize a single user account for all projects, with each project stored in its own directory within the user's home folder. This simplifies user management, as you only need to administer one account, but it may present challenges in terms of access control and potential security risks if permissions are not properly configured.
An alternative approach involves storing all projects in a common location such as /var/www and managing access through group permissions. This method allows for centralized management of website files but requires careful attention to group settings to ensure that users have appropriate access to their respective projects.
Ultimately, the best practice for organizing servers of this kind may vary depending on your specific needs and preferences. Consider factors such as the number of projects, the level of isolation required between them, and the ease of management when making your decision.
Choose the right VPS.
Connect to your VPS.
Setting up website hosting.
Install and configure your web server.
Install your preferred CMS / or migrate existing site.
Set up your website on WordPress (or other CMS)
Test your website.
Point your domain name (Via DNS) to your VPS to make it live.