To run a website on your Ubuntu 18.04 VPS, you will need to install a group of open source software including Apache, PHP, and MySQL. These applications are very useful when it comes to running dynamic websites that rely on databases and server-side scripting languages.
Apache is fast, secure and consistently a high-quality web server software which is the most popular since 1996.
PHP (Hypertext Preprocessor) is a general-purpose server-side scripting language designed for web developments since 1994.
MySQL is a relational database server designed by Oracle and is used by high-profile and large-scale websites including Google, Youtube, and Twitter. Its development began in 1994.
With a Linux distribution such as Ubuntu 18.04, it’s entirely possible to create fully functional LAMP (Linux Apache, MySQL, and PHP) server.
In this guide, we are going to show you how to install Apache, MySQL, and PHP on your Ubuntu 18.04 server.
Special Note: regardless of the Linux distribution you chose for your website, if you use Linux - you should use the Best Linux Hosting Providers. HostAdvice helps you to choose from the top Linux hosting providers: read the expert and user reviews and reach your own conclusions.
Prerequisites
- An Ubuntu 18.04 VPS plan.
- A non-root user that can perform sudo tasks.
Step 1: Install Apache
Ubuntu 18.04 maintains a central repository where you can install most applications from using the apt command. To install Apache, run the command below:
- $ sudo apt-get install apache2
Press ‘Y’ when you are prompted to confirm the Apache installation.Once the installation is complete, enter your VPS machine public IP address on your browser. You should see the default Apache web page as shown below: