Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have a droplet in Ubuntu 14.04,what I want to do is create a subdomain and host it in the same droplet.
My main domain : example.com Subdomain created : api.example.com
**What I tried so far: **
Created a “A” record for api.example.com in Networking section
Created a CNAME record for www.api.example.com
Set up the virtual host for api.example.com following this How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
**Below is the step I tried to set up the virtual host **
The droplet is installed Apache2 before,so I didnt install again
Create the directory for my api.example.com by using this command
sudo mkdir -p /var/www/api.example.com/public_html
Create a demo page by using this command nano /var/www/api.example.com/public_html/index.html
and add a simple html code inside it .
I copy the 000-default.conf to my new created conf like this sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/api.example.com.conf
I change the api.example.com.conf to the following:
<VirtualHost *:80>
ServerAdmin myemailaddress@example.com
ServerName api.example.com
ServerAlias www.api.example.com
DocumentRoot /var/www/api.example.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite api.example.com.conf and restart the apache by sudo service apache2 restartAfter all this step, I test my subdomain,but it doesnt work.It said refused to connect
so what I missing here?? Can somebody help??
gerard
Jon Harris
orbitstorm88
rem3n
yolanda smith
301276acdc124dd982fe86364ba8c4
30ddab6038c044188d489290785dcb
699c9bc0a2c34f248e792cb8d2c6ab
Kent Morlan
sylvaticus
agitechcr
8b8f3c8ea96345bf8ddb0a59a008e2