Question

Domain pointing to wrong file/folder

Im pretty new to serverside and just made my first droplet, so please forgive me if I’ve missed something obvious here.

My problem is that when i type domain into browser it doesent go to proper (var/www/mydomain/public_html) index.html file and it just goes to index of /. I can see the right folder but and with clicking the right index.html file appears on the browser.

So far i have made theese things:

  1. setup dns settings
  2. put website folder var/www
  3. removed default .conf file and added mydomain.conf
  4. symlink with putty for /etc/apache2/sites-available
  5. restarted apache server

Conf file looks like this:

<VirtualHost *:80>

  ServerAdmin webmaster@localhost
  
  DocumentRoot /var/www/mydomain/public_html
  ServerName mydomain.com
  ServerAlias www.mydomain.com
 
  ErrorLog	/var/www/suomenyachtcenter/logs/error.log
 
  #  Possible values include: debug, info, notice, warn, error, crit,
  #  alert, emerg.
  LogLevel warn
  
  CustomLog /var/www/suomenyachtcenter/logs/access.log combined
  
</VirtualHost>

Ive tried to find answer for question from this nice community but couldnt find similiar thread so would be really happy for some help! Thank you for advance :)


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

For so far I know how your directory setup is, this vhost loosks good. Probably something went wrong with created a symlink manually. You don’t have to do this, just create a vhost file in the apache sites-available and then use

sudo a2ensite <vhost file name>

Then when your site is enabled, restart apache sudo /etc/init.d/apache2 restart

Hope this will work for you now.