Hi, I’ve set up a LAMP server on an Ubuntu VPS, installed webmin, created DNS records in DigitalOcean panel as instructed by the tutorials. Everything works just fine on the main domain name, but at this point I want to make a test subdomain: text.example.com to lead to /var/www/test/
I’ve been trying for a while now and I don’t know how to do it. Got lost in CNAME records, A records and settting up virtual hosts in webmin.
Does anybody have any pointers or any good tutorial on it? Thanks.
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!
shivpatelspp suggests we add the new subdomain settings to the file:
“/etc/apache2/sites-available/default file”
if I want to add, let’s say, the subdomain “stage.mydomain.com” , can I add it to the “/etc/apache2/sites-available/mydomain.com.conf” file ? I actually tried that and apache could not restart and I got the error “Syntax error on line 219 of /etc/apache2/apache2.conf” . The error went away when I removed the subdomain settings from “mydomain.com.conf”.
So apparently I cannot have my subdomain in the same conf file as my domain?
Can/should I create a new .conf file for my subdomain or should it be in the 000-default.conf file?
Thank you very much
We need to add a helper section to the DNS manager which will give a brief write-up on how to use DNS. <br> <br>A lot of new customers that aren’t familiar with some of the DNS settings don’t know these things and it would help them out in getting the configs right the first time.
Question: <br>When setting up a subdomain on LAMP, does each subdomain have its own conf file <br>eg: <br>/etc/apache2/sites-available/site.com <br>/etc/apache2/sites-available/sub.site.com <br> <br>or do all the rules go in the same conf file for site.com? <br>eg. <br><VirtualHost *:80> <br> ServerName site.com <br> DocumentRoot … <br></VirtualHost > <br><VirtualHost *:80> <br> ServerName sub.site.com <br> DocumentRoot … <br></VirtualHost >
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.