Hello @sierracircle I followed your advice and also a couple of DO tutorials the DNS and the Virtualhost ones, oh and one from symfony2 for server setup. But I am still not being able to make my subdomains work properly. I wanted to ask you for some help.
I tried various DNS configurations, switched DNS from my registar to DO and tried with A and CNAME records, here’s how my zone file looks like:
$ORIGIN kludgecruft.com.
$TTL 1800
kludgecruft.com. IN SOA ns1.digitalocean.com. hostmaster.kludgecruft.com. 1421532591 10800 3600 604800 1800
kludgecruft.com. 1800 IN NS ns1.digitalocean.com.
kludgecruft.com. 1800 IN NS ns2.digitalocean.com.
kludgecruft.com. 1800 IN NS ns3.digitalocean.com.
kludgecruft.com. 1800 IN A 104.236.80.93
www.kludgecruft.com. 1800 IN CNAME kludgecruft.com.
calis.kludgecruft.com. 1800 IN CNAME kludgecruft.com.
orlybg.kludgecruft.com. 1800 IN A 104.236.80.93
I have my domain kuldgecruft.com and have 2 test subdomains orlybg (A), calis (CNAME) and WWW as an alias for the main domain so to speak.
Here are my apache vhost files (one for each), all 3 are enabled, I’ve restarted apache in various ways, I changed the name of the flle of the ‘main vhost’ to 000main.conf because it wasn’t being taken as the first host.
****000main.conf
<VirtualHost 104.236.80.93:80>
ServerName kludgecruf.com
DocumentRoot /var/www/html
<Directory /var/www/html>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
****orlybg
<VirtualHost 104.236.80.93:80>
ServerName orlybg.kludgecruf.com
DocumentRoot /var/www/html/myproject
<Directory /var/www/html/myproject>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error_orlybg.log
CustomLog ${APACHE_LOG_DIR}/access_orlybg.log combined
</VirtualHost>
****calis
<VirtualHost 104.236.80.93:80>
ServerName calis.kludgecruf.com
DocumentRoot /var/www/html/calis
<Directory /var/www/html/calis>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error_calis.log
CustomLog ${APACHE_LOG_DIR}/access_calis.log combined
</VirtualHost>
I think maybe this can help:
apachectl -t -D DUMP_VHOSTS
VirtualHost configuration:
104.236.80.93:80 is a NameVirtualHost
default server kludgecruf.com (/etc/apache2/sites-enabled/000main.conf:1)
port 80 namevhost kludgecruf.com (/etc/apache2/sites-enabled/000main.conf:1)
port 80 namevhost calis.kludgecruf.com (/etc/apache2/sites-enabled/calis.conf:1)
port 80 namevhost orlybg.kludgecruf.com (/etc/apache2/sites-enabled/orlybg.conf:1)
I’m not well versed in apache, I am a PHP developer, and I can find my way in linux, and everything looks find to me, I can’t figure out why every URL of my domain responses the same thing.
Thanks in advance! cheers