ubuntu - Apache2 virtual host missing Document Root -


thank in advance.

i following tutorial digitalocean : https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts . completed instruction when start test configuration , add record parking domain, let example.com , digitalocean vps address 192.168.10.2. in schenario add these 3 virtual host 3 different documentroot:

  1. /var/www/domainone.example.com/index.html
  2. /var/www/domaintwo.example.com/index.html
  3. /var/www/domainthree.example.com/index.html

then in parking domain add 3 different record below :

  1. name : domainone.example.com address : 192.168.10.2
  2. name : domaintwo.example.com address : 192.168.10.2
  3. name : domainthree.example.com address : 192.168.10.2

when execute, happens follow :

  1. url domainone.example.com goes /var/www/domainone.example.com/index.html
  2. url domaintwo.example.com goes /var/www/domaintwo.example.com/index.html
  3. but url domainthree.example.com goes /var/www/domaintwo.example.com/index.html

i sure wrote correct documentroot @ /etc/apache2/sites-available/(for each domain).config , restart apache2 service

thank again

edit

  1. this /etc/apache2/sites-available/domaintwo.example.com.conf

    <virtualhost *:80>     # servername directive sets request scheme, hostname , port     # server uses identify itself. used when creating     # redirection urls. in context of virtual hosts, servername     # specifies hostname must appear in request's host: header     # match virtual host. default virtual host (this file)     # value not decisive used last resort host regardless.     # however, must set further virtual host explicitly.     #servername www.example.com      serveradmin localhost@admin     documentroot /var/www/domaintwo.example.com/public     servername domaintwo.example.com     serveralias www.domaintwo.example.com      # available loglevels: trace8, ..., trace1, debug, info, notice, warn,     # error, crit, alert, emerg.     # possible configure loglevel particular     # modules, e.g.     #loglevel info ssl:warn      errorlog ${apache_log_dir}/error.log     customlog ${apache_log_dir}/access.log combined      # configuration files conf-available/,     # enabled or disabled @ global level, possible     # include line 1 particular virtual host. example     # following line enables cgi configuration host     # after has been globally disabled "a2disconf".     #include conf-available/serve-cgi-bin.conf     sslengine on 

    sslcertificatefile /etc/apache2/ssl/apache.crt sslcertificatekeyfile /etc/apache2/ssl/apache.key

  2. this /etc/apache2/sites-available/domainthree.example.com.conf

        <virtualhost *:80>     # servername directive sets request scheme, hostname , port     # server uses identify itself. used when creating     # redirection urls. in context of virtual hosts, servername     # specifies hostname must appear in request's host: header     # match virtual host. default virtual host (this file)     # value not decisive used last resort host regardless.     # however, must set further virtual host explicitly.     #servername www.example.com      serveradmin localhost@admin     documentroot /var/www/domainthree.example.com/public     servername domainthree.example.com     serveralias www.domainthree.example.com      # available loglevels: trace8, ..., trace1, debug, info, notice, warn,     # error, crit, alert, emerg.     # possible configure loglevel particular     # modules, e.g.     #loglevel info ssl:warn      errorlog ${apache_log_dir}/error.log     customlog ${apache_log_dir}/access.log combined      # configuration files conf-available/,     # enabled or disabled @ global level, possible     # include line 1 particular virtual host. example     # following line enables cgi configuration host     # after has been globally disabled "a2disconf".     #include conf-available/serve-cgi-bin.conf     sslengine on     sslcertificatefile /etc/apache2/ssl/apache.crt     sslcertificatekeyfile /etc/apache2/ssl/apache.key     </virtualhost> 


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -