password protection for vhost

Discussion in 'Install/Configuration' started by sofatime, May 22, 2013.

  1. sofatime

    sofatime Well-Known Member


    I have a very simple problem but cannot figure it out. I would like to password protect a vhost. This vhost is instaniated. I don't want to do it with .htaccess. I have created the realm and the context, but I always get "Authentication failed with user xxx". This is the relevant configuration:



    I have also created the users file and made sure the password is really correct.

    Any hints?

  2. sofatime

    sofatime Well-Known Member

    I have now tried to do the same with .htaccess: Does not work either with the same users file. But if I create a .htpasswd with the password unencrypted it works. So it apparently has to do with the users file. I have created the users file normally using the lsws admin and it looks good. The only thing that's new to me is a ":" at the end of the user entry (after the password).

  3. NiteWave

    NiteWave Administrator

    the apache document is here:

    so in your config file,
    should be something like
    <required>user xxx</required>

    /path/to/users should be a file, an sample:
    #cat /path/to/users
  4. sofatime

    sofatime Well-Known Member

    Thank you. I already tried "user xxx", but did not work. Also the lsws documentation says that "required" can be left empty and then every user would be valid (the same as "valid-user").
    The users file exists and contains the correct user.

  5. NiteWave

    NiteWave Administrator

    compared with an local test box of mine,
    can you set some values of:
    for example, 200, 60 respectively.
  6. sofatime

    sofatime Well-Known Member

    Ok, I did, but still does not work.
    I have now solved the problem with .htaccess und .htpasswd with an unencrypted password. But still would be good if I could do that on the server level.

  7. NiteWave

    NiteWave Administrator

    can you try to install standard version on the same vhost but in another location instead of default /usr/local/lsws. then access the homepage, there is a demo page for Authentication, see if that works for you. the line read:
    "Authentication: Password protected content, use user name: test, password: test123"
  8. sofatime

    sofatime Well-Known Member

    No, I can't do this, as this server is productive. This is a pretty standard installation with lsws 4.2.2 64bit Enterprise on Ubuntu 12 64bit. How would installing lsws standard help?

  9. mistwang

    mistwang LiteSpeed Staff

    which tool is used to generate the encrypt password file?
    You can try Apache's htpasswd utility.
  10. sofatime

    sofatime Well-Known Member

    I have used lsws to create the users file.
  11. mistwang

    mistwang LiteSpeed Staff

    We will look into the code in our web console regarding this.
    Can you also try Apache htpasswd, see if the password file generated works with LSWS.

Share This Page