If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

From shared hosting to VDS

Started by organictextiles, Dec 25, 2022, 08:48 AM

Previous topic - Next topic

organictextilesTopic starter

Hey there!

Initially, like most people, I created websites on a whim and uploaded files and folders to hosting separately. However, life became much easier when I discovered FTP. And it got even easier when I learned about git and SSH.

But now, FTP and git don't cut it for me anymore. I want to move on to VPS - but where do I start? Whenever I try to read up on it, I'm bombarded with different operating systems, settings, and parameters. It's overwhelming.

I understand that you may think it's a simple question, but believe me, it's not. Even transferring files to hosting used to be daunting for me. So please, be patient with me as I try to understand.

For the record, I primarily use php (Laravel) for backend and Vue for frontend.
  •  


tomjohn

It's important to consider the time and financial investment of a potential move.
Think about how long it will take to learn new systems such as ubuntu, nginx, RDBMS, php-fpm, and memcache, without relying on pre-existing scripts or panels. Also, consider how backups will be handled and what steps to take if there is a hacking incident. Losing customers during the transition should also be factored in.
Additionally, it's crucial to plan for email sending and determine if there are any ways to improve current systems before making the move.
You should only consider moving after evaluating the potential benefits, such as saving time and resources or increasing hourly rates.
Without clear answers to these questions, it's not advisable to make a move.
However, it should be noted that moving blogs and other resources to UPU can still be a valuable learning opportunity.
  •  

aleksis

To start, it's recommended to study on an inexpensive VPS with KVM virtualization.
Install CentOS and take steps to secure it, such as configuring iptables, fail2ban, changing the ssh port, disabling root access, and implementing key-based authentication.
Afterwards, install a control panel and analyze how security is implemented within it.
Explore backup options and attempt to restore the server from a backup.
Once this is all set up, install LAMP, configure it, and install your chosen engine for launching a trial site with SSL certification and email functionality.
Make sure to set up backups for the site and test restoring it from a backup.
This process of learning can take anywhere from a week to 2-3 weeks, so be prepared to spend a lot of time studying and Googling different aspects of the setup.
  •  

bayilucu

It's important to understand that a VPS (virtual private server) is a personal virtual server that offers many of the benefits of a physical one.
When comparing hosting providers, it's clear that VPS is more expensive than virtual hosting due to the increased volume of resources it offers for professional site support.
One key benefit of VPS is that resources are guaranteed and not shared with other users on the same server. In contrast, virtual hosting shares resources among clients hosted on the same server, which can lead to restrictions but also lower costs.
Another key difference between VPS and virtual hosting is functionality. While virtual hosting typically relies on a control panel provided by the hosting provider, VPS allows you to install software on a virtual server that you are comfortable using. Overall, VPS offers more flexibility and control, which can be beneficial for advanced users.
  •  

ErichViell

First off, it is perfectly okay to feel overwhelmed, especially when you're moving on to new technologies. Virtual Private Servers (VPS) do indeed come with a lot more complexity when compared to traditional shared hosting or even managed hosting solutions, but they also offer greater control, higher performance, and the ability to customize your environment to fit your specific needs.

Here is a step-by-step guide to getting started with VPS:

Choose the right VPS provider for your needs: There are numerous VPS providers available, so you'll want to find one that best meets your performance, budget, and reliability needs. Some established VPS providers are AWS, Google Cloud, DigitalOcean, Linode, and Vultr. Check out their prices, the type of support they offer, whether they have data centers in your (or your users') region, and any reviews or feedback available online.

Select an operating system: The primary choices here are some variant of Linux (like Ubuntu, CentOS, Debian) or Windows. Laravel and Vue.js are both platform-neutral, meaning they can run on any operating system. However, most PHP developers lean towards Linux because it's usually easier and cheaper to get a PHP environment running on a Linux server than it is on a Windows server.

Configure your server and install necessary software: After spinning up a VPS instance with your chosen provider and OS, you'll need to SSH into your server and install the necessary software. This typically includes installing a webserver (like Apache or Nginx), PHP, a database (such as MySQL or PostgreSQL), and sometimes additional software like Composer, Node.js/NPM for your Vue.js development, and a caching solution like Redis or Memcached if necessary.

Set up your PHP (Laravel) application: Since you're using Laravel, you'll want to get your Laravel application setup on your VPS. This usually involves:

Copying your Laravel application files to your VPS. You can SCP or use Git to clone your files into your server.
Configuring your web server to point to your Laravel application's public directory.
Modifying your Laravel environment configuration (.env file) to use your server's database.
Set up your Vue.js application: If your Vue.js application is separate from your Laravel application (e.g. you're running a SPA or a decoupled frontend/backend), you may need to build it locally and then deploy the built files to your server.

Set up a FTP/SFTP client: You can also set up an FTP/SFTP client like FileZilla, which can make transferring files to and from your server much easier.

Security: Ensure basic server security like setting up a firewall, configuring SSH key-based authentication, updating and patching the software and the OS, disabling root logins etc.

Set up a backup solution: Never forget to set up your backups - whether provided by your hosting solution or set up manually.

Please note that these are the basic steps and every step involves some learning. Thankfully, the web is plentiful of tutorials specifically on these topics and most VPS providers offer comprehensive guides to help in every step. Also, it's a good idea to practice these steps on a non-production server first to get acquainted with the process.

Speaking of Laravel and VPS, Laravel Forge might be an interesting service for you to take a look at. It's a tool to automatically deploy your PHP applications onto your VPS and take care of the server management, allowing you to focus more on your coding and less on server administration.


Breakdown with a bit more depth:

Choosing a VPS provider: This step is largely about doing your research. Consider the pricing model, the performance of the servers, the location of the datacenter, available customer support, backup options, and reputation of the provider.

Select an Operating System: Linux distributions are generally more popular for web servers and applications. Ubuntu and CentOS are two very popular options, with many community and official resources available to help guide you. Ubuntu is known for its user-friendliness, which might make it a good choice for your first VPS.

Configure your Server: Once you've spun up your VPS and selected your OS, you'll typically be given SSH access. SSH, or Secure Shell, allows you to control your server remotely from the command line. If you've never used the command line before, you might want to familiarize yourself with some basic commands first.

You'll start with updating your server with the latest packages. On an Ubuntu server, you'd use the following commands:

sudo apt update
sudo apt upgrade
Next, you'll want to install the necessary software. A common web server like Nginya can be installed with:

sudo apt install nginx
After this, install PHP:

sudo apt install php-fpm php-mysql
And you can install MySQL with:

sudo apt install mysql-server
Remember that npm and composer should also be installed for your Javascript and PHP dependencies.

Set up your Laravel Application: This step assumes that you've already developed your Laravel application on your local machine. If so, you can push your application to a Git repository, like GitHub or GitLab, and then clone it to your VPS.

For this, use the git clone command, like so:

git clone https://github.com/username/repository.git
Then configure your web server to point to your Laravel application's public directory, which involves modifying the default Nginx configuration file.
5. Set up your Vue.js application: You might have Vue.js within your Laravel project or separately. If it's separate, follow the same process as in step 4. Otherwise, ensure you build your application properly before deployment.

Setup an SFTP client: For using SFTP with your server, you can use FileZilla. You can configure it using the public IP address of your server, your username and password. This will give you a GUI to upload and download files from your server and you will not have to use the command line for this part.

Security: When it comes to security, the basic steps are to setup a firewall using a solution like UFW (Uncomplicated Firewall). You can install it with:

sudo apt install ufw
Then, allow connections only on necessary ports, like 22 for SSH or 80 and 443 for HTTP and HTTPS.

For SSH security, setup key-based authentication and disable password only logins. This includes generating a new SSH key pair and copying the public key to your server.

Set up backup solutions: You can manually create backups of important data or automate this process. Many VPS providers give in-built tools for taking regular backups of your server.


I recommend taking additional training courses focused on system administration and web servers. Here are a few ideas:

Linux Command Line Basics: This is something you need to get comfortable with, as it is the method you'll use to interact with your server most of the time. There are many online courses available that can guide you through this process like those on Codecademy, Udemy, Coursera etc.

Web Server Configuration: You should gain a solid understanding of how web servers like Apache and Nginx work. Learning how to install them, manage server blocks/virtual hosts, applying directives, and troubleshooting common issues will make your life much easier as you set up your VPS. Courses on these topics are also available online.

SSL/TLS and HTTPS: Secure communication is an essential part of modern web development. You should learn about SSL/TLS certificates, how to install them, how to configure your web server to use them, and how to automate their renewal.

Database Management: Most applications you'll deploy will require a database backend. Understanding how to manage MySQL, Postgres, or whichever database server you're using will be quite beneficial.

Software-specific Training: Depending on the software stack you're using (like PHP for Laravel, JavaScript for Vue.js), it may benefit you to take courses focused specifically on those technologies.

System Security Basics: Understanding basic troubleshooting steps, working knowledge of how to secure a system, patch management, and firewall setup is critical when managing a VPS environment.

Network Basics: It's important to have a basic understanding of network concepts, such as DNS, public and private IP addresses, ports, etc.

Backup and Recovery: Learn how to regularly backup your data and how to recover it in case of a loss. Consider courses or guides that also teach disaster recovery strategies.

Most importantly, don't be hard on yourself. Skills take time to develop and managing a VPS is not a small task that can be learned in a day or two. Start small: perhaps by installing and setting up a simple HTML page, then move on to deploying your actual applications.

For a real word project, you might want to consider hiring a professional devops engineer or systems administrator, or use a managed solution until you are more confident in your skills.
  •  

Bhvzdamkybdd

Another developer who thinks they're ready for a VPS. It's not just about uploading files to a server, it's about becoming a part-time sysadmin. You'll need to learn about Linux, networking, and security - and that's just the beginning. But hey, if you're up for the challenge, go for it.

Just don't say I didn't warn you when you're stuck debugging a server issue at 3am. As a Laravel and Vue developer, you'll probably want to start with a managed VPS like WP Engine or Kinsta, but don't expect it to be a walk in the park. You'll still need to learn about server management, even if someone else is handling the heavy lifting. So, buckle up and get ready for a wild ride.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...