The easiest way to do this would be to use the VNC Console tab in your control panel, but it would be smarter to use SSH, with a client such as Putty, available here.
The first thing you'll want to do is make sure that everything is updated on the operating system. Go ahead and enter this command:
Code: Select all
sudo apt-get update
Apache2
Once that's done its business, you can start installing Apache2 with this command:
Code: Select all
sudo apt-get install apache2
When this finishes, Apache2 will already be running and your webserver will be active. You can go to "http://www.xxx.yyy.zzz/" - where "www.xxx.yyy.zzz" is the IP address for your VDS - in your web browser and see the Apache test page.
MySQL
Next, we want to install MySQL. We'll use the following command to install MySQL Server 5.7, and the tools it needs to talk to Apache and PHP:
Code: Select all
sudo apt-get install mysql-server
Now you'll want to do a bit of housekeeping for MySQL:
Code: Select all
sudo mysql_secure_installation
Next, we'll need to alter the root user account, to switch from auth_socket authentication to mysql_native_password, to allow local, root logins from phpMyAdmin later.
First, open a local MySQL connection using:
Code: Select all
sudo mysql
Code: Select all
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password_here';
Code: Select all
FLUSH PRIVILEGES;
Code: Select all
exit
To install PHP, run the following command:
Code: Select all
sudo apt-get install php libapache2-mod-php php-mysql
Now, you'll want to make sure .php files take priority over .html when not specifying, so you'll want to use this:
Code: Select all
sudo nano /etc/apache2/mods-enabled/dir.conf
Code: Select all
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
Now we need to restart Apache, using this:
Code: Select all
sudo service apache2 restart
Now we want to install phpMyAdmin, to give you a web-based UI to interact with the MySQL server. To do this, you'll run:
Code: Select all
sudo apt-get install phpmyadmin
Another purple screen will pop up, and Apache2 will be highlighted, but not selected. You need to hit the SPACE key to select it, then press Enter. After a moment, you'll see another purple screen, asking if you need to configure the database for phpmyadmin with dbconfig-common. Select Yes and create a password for the phpMyAdmin user for MySQL. You don't need to use this user account to login, this is used for phpMyAdmin for some underlying operations.
When this is complete, you can go to http://www.xxx.yyy.zzz/phpmyadmin/ and access the installation of phpMyAdmin!
NOTE: The root directory of your webserver will be in /var/www/html/ and files can be uploaded there to be viewed in the browser.
Also, you do not want to use the root account on MySQL, generally. Log into phpMyAdmin with the root account, and create a secondary account and then use that account. It's useful for keeping your server secure.