title: How do I set a domain name to an OpenCPU app?
body: <p>I have a Ubuntu 18.4 LTS server running <code>OpenCPU</code>, and am able to run the application <code>myapp</code> by pointing my browser to the address <code>http://myip/ocpu/library/myapp/www/</code>. I wish to make the app available via the domain name <code>mydomain.name</code>, and have set up DNS records to point to <code>myip</code>.</p>
  
  <p>On the server side, I created a file <code>/etc/apache2/sites-available/myapp.conf</code>, which looks like</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName mydomain.name
      DocumentRoot /ocpu/lib/myapp/www
      LogLevel info
      ErrorLog /var/log/myapp/apache_error.log
      CustomLog /var/log/myapp/apache_access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>However, <code>sudo systemctl reload apache2</code> throws an error since it cannot find the documentRoot <code>/ocpu/lib/myapp/www</code>. In fact, there is no directory <code>ocpu</code> on the server. </p>
  
  <p>I suspect that I need to set up a <code>.conf</code> file in <code>/etc/opencpu/server.conf.d</code>, but the structure of those files look very different from <code>myapp.conf</code> as given above, and I do not see an entry for a <code>ServerName</code>.</p>
  
  <p>How do I redirect <code>mydomain.name</code> to <code>http://myip/ocpu/library/myapp/www/</code>?</p>