Question
How to create a subdomain in Apache?
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.
×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.
×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
This contains various problems:
Hello, i have droplet. So now i want to create sudomain by api( or some method)
So how can i do task.
thank!