Question
Can't get subdomain to work via virtual hosts - Ubuntu
Hey all,
I'm new to working with webservers manually and I am trying to setup a subdomain via apache's virtual hosts but I can't get it to work. This is the tutorial I followed https://www.digitalo...buntu-12-04-lts
Here is some initial info:
I have my website running just fine with the main domain http://shayConcepts.com and it's running from /home/scDev/public_html
I'm trying to create a test sub domain, ftest.shayconcepts.com. Located at /home/scDev/ftest
My domain is not through digital ocean
And here's exactly what I did
sudo chown -R $USER:$USER /home/scDev/ftest
(I also tried sudo chown -R www-data:www-data /home/scDev/ftest
sudo chmod -R 755 /home/scDev/ftest
created an index.html in ftest
cd /etc/apache2/sites-available
sudo cp ./default.conf ./xftest.conf
Here's the contents of xftest.conf
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin andrewshay@shayconcepts.com
ServerName ftest.shayconcepts.com
DocumentRoot /home/scDev/ftest
Options FollowSymLinks
AllowOverride None
AllowOverride None
Order allow,deny
Allow from all
Require all granted
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
sudo a2ensite xftest.conf
sudo service apache2 reload
sudo service apache2 restart
Add a comment
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.
×