So I just created my Ubuntu server and everything is working fine. I set up the virtual host on my Apache following this tutorial (https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts). My question is: how can I create a subdomain? I want that when you go to subdomain.mydomain.com Apache goes to /var/www/subdomain/public_html (or something like that…).
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!
Hello Support,
We don’t have bind server in our server. How can we configure the DNS Server to poin that CNAME.
First of all:
1- Configure the BIN9 at /etc/bind
If yout domain is www.domain.com, go to /etc/bind/db.domain.com and add the subdomain name
subdomainname IN A 1.1.1.1. <= Repalce with IP
2- Go to Apache2 at /etc/apache2 Look for /etca/apache2/sitesavailable
Add new file named as: subdomainname.domainname.com and link it in apache2/sitesenabled
examble:
<VirtualHost *>
DocumentRoot /var/www/domainname
ServerName subdomainname.domainname.com
<Directory /var/www/domainname/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error-logfile.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access-logfile.log combined
</VirtualHost>
Dorival Cardozo VirusCore AntiVirus Server manager
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.