Installing second website to single Ubuntu VPS running apache2

This is a test environment so i dont have a domain.

I have a VPS with apache2 installed and i have a website located at /var/www/html . I access it via going to my ipaddress/index.php

I want to set up another website let’s say at /var/www/site2 and be able to acceess at ipaddress/site2/index.php

How can i achieve this? The guides didn’t really help me i think im losing it somewhere in the /etc/apache2/sites-available configuration.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @brightfuture,

If you want to use the IP address, you can create another folder located in /var/www/html, let’s say exampleFolder. It will be located in /var/www/html/exampleFolder. Additionally, if you want to browse the folder, you’ll need to open ipaddress/exampleFolder.

Now, if you want to open another directory, you won’t be able to use an IP address. Having said that, you can configure a domain of your liking and then edit the host file on your computer to point the domain you have used to your droplet. If you like this idea, let me know and I’ll walk you through it!

Regards, KFSys