Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hey guys, I wanted to try out SSL on my server so I decided to create some self-signed SSL certificates as outlined here. After going to the document-root, firefox did indeed allow me to accept the certificate and stuff. But when I actually tried to access files within the test directory, it kept throwing 404s. If I switched it to http instead of https, it worked.

I checked the access.log and it showed this:

my.ip server.ip - [05/Jan/2010:01:33:08 +0100] "GET /test/index.html HTTP/1.1" 404 345 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6"

So it seems like even though I am requesting as https, it is requesting the file as http. My document-root in lighttpd.conf is /var/www, but for the ssl section I set it as /var/www/test, could there be a conflict right there? Should I make them separate directories?

I also tried doing a redirect so that supposedly, http requests to the test directory would be sent as https, but I don't think it's working, maybe I did it wrong.

Here is the relevant information from my lighttpd.conf file, I would appreciate any help you guys can give. Thanks.

$SERVER["socket"] == "some.ip:443" {
  server.document-root = "/var/www/test/"
  var.basedir = "/var/www/test/"
  ssl.engine = "enable"
  ssl.pemfile = "/etc/lighttpd/ssl/some.ip/server.pem"
}

$HTTP["scheme"] == "http" {
  url.redirect = ("^/(test.*)" => "https://some.ip/$1")
}
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Does the file /var/www/test/test/index.html exist? If not, then accessing /test/index.html with a docroot of /var/www/test is going to rightly throw a 404. Try keeping everything the same between the HTTP and HTTPS vhosts, and work from there.

share|improve this answer
    
Wow, you just helped me realize that being that the document-root is /var/www/test so I had to access it at some.ip/index.html. It worked, can't believe I spent hours trying to figure that out. Thanks. –  Jorge Israel Peña Jan 5 '10 at 1:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.