By elgarrai03
I have followed these steps ( https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts ) to create a virtual host, It’s work on simple domains ( example.com ) but on the subdomains ( sub.example.com ) does not work for me. Any help Please!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Very simple. Just do these: <br> <br>1. In the sites-available directory of Apache, make a copy of yoursite.com file and rename it subdomain.yoursite.com. Replace “subdomain” with the name your want to call the subdomain. <br> <br>2. Edit subdomain.yoursite.com and modify the ServerName line to show the url of the subdomain and the DocumentRoot line to show where the files for the website will be. <br> <br>3. enable the subdomain using a2ensite subdomain.yoursite.com <br> <br>4. Restart Apache. <br> <br>5. try to access the site from a browser. <br> <br>
The procedure is very simple. <br> <br>There are two things to do. <br> <br>first, you need to create a DNS record for your subdomain under your domain like this: <br> <br>Create A record: hostname -->subdomain and IP address is your droplet IP <br> <br>Create CName: Name --> *.subdomain and Hostname is (in this example case) --> subdomain.domain.com. <br> <br>And the second part to create a vhost for your Apache at site-available <br> <br>if you use new version of Apache, then you may need .conf at the end of your site vhost link <br> <br>remember to give your DNS some time about few minutes to 2 hours to propagate so it becomes valid. <br> <br>Good luck!!
what about the DNS ? I handle subdomains by DO DNS system and works fine
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.