-1

I was recently just installing SSL onto my server / website. Once I finished all the steps, I went to check my website using the https://www.breakwatersurfcompany.com which worked great, however. My www.breakwatersurf.com or www.breakwatersurfcompany.com now display the directory rather than the website. I was wondering if this has to do with my Virtual Host file?

I am running a VPS LAMP with ubuntu 12.0.4 - apache2. I can't seem to find out the cause of this, any thoughts?

PS: www.breakwatersurfcompany.com is the MAIN url which every other one of our urls redirects to eg (www.breakwatersurf.com redirects to www.breakwatersurfcompany.com).

Thanks for the help, Tantrik

Tantrik
  • 7
  • 2
  • 1
    Please post your config. – EEAA Jun 18 '15 at 21:28
  • http://pastebin.com/tWFQJnAG Here is my config – Tantrik Jun 18 '15 at 21:41
  • Put your config in the question. Also, put the _right_ config in the question. You're asking about http not working, and haven't provided the http config. Note that it looks like you've simply got the document root wrong since `http://breakwatersurfcompany.com/breakwatersurf.com/` is a html page. – AD7six Jun 18 '15 at 21:43
  • I do not have a httpd.conf file anywhere, this is what was controlling http before until I threw in SSL. - /var/www/breakwatersurf.com/ IS the correct doc root as well – Tantrik Jun 18 '15 at 21:45
  • Thanks everyone especially AD7six - was not aware apache requires both a HTTP and HTTPS virtual host, everything is running smoothly once I linked up another HTTP vhost. Going to write up a tutorial on doing this since there any clear one online - thanks everyone! – Tantrik Jun 18 '15 at 21:53

3 Answers3

1

If your http directory root is same as https then following vhost should work for you or you may need to make changes appropriately. This will overwrite whatever Doc root you have for default:80 in http.conf.

  <VirtualHost *:80>
   #Admin email, Server Name (domain name), and any aliases
  ServerAdmin webadmin@breakwatersurf.com
  ServerName  www.breakwatersurf.com
  ServerAlias breakwatersurf.com

   # Index file and Document Root (where the public files are located)
   DirectoryIndex index.html index.php
   DocumentRoot /var/www/breakwatersurf.com/
   # Log file locations
   LogLevel warn
   ErrorLog  /var/www/breakwatersurf.com/log/error_nonssl.log
   CustomLog /var/www/breakwatersurf.com/log/access_nonssl.log combined

chetangb
  • 145
  • 6
0

Yes, it might have to do with your conf files. Check to make sure the DocumentRoot is the same for the https and non-https virtual hosts. If you aren't sure how to find out what that is, you can enable mod_info (see the top of http://httpd.apache.org/docs/2.2/mod/mod_info.html) and then pull up the info page and see what the DocumentRoot is set to, then correct as needed.

sa289
  • 1,318
  • 2
  • 18
  • 44
  • I do not have a non-https version of the virtual hosts - is that my problem? Do I need to make a copy of the enabled config and set it to be non-https? – Tantrik Jun 18 '15 at 21:36
  • @Tantrik Yes and it should listen on port 80 instead of 443 and of course have the proper ServerName and optionally ServerAlias directives. Also, it of course wouldn't contain the SSL-related directives. – sa289 Jun 18 '15 at 21:45
0

Check the vhost config you have for *:80 , it seems you have Indexing enabled. You need to add DirectoryIndex index.html so that it results in you index.html. If a URL which maps to a directory is requested, and there is no DirectoryIndex (e.g., index.html) in that directory, then mod_autoindex will return a formatted listing of the directory. Refer: http://httpd.apache.org/docs/2.2/mod/core.html#options

chetangb
  • 145
  • 6
  • I only have a vhost config for *:443 - is that the problem? Do I need to make a copy of the vhost and change that to *:80 because I know that was the default , I just wasn't aware I might need 2 vhost files. DirectoryIndex index.html index.php is set already – Tantrik Jun 18 '15 at 21:38