theonemule / simple-openvpn-server

A setup script and simple web UI for setting up an OpenVPN Server
MIT License
232 stars 115 forks source link

New lighttpd.conf #7

Closed barongello closed 2 years ago

barongello commented 4 years ago

The new lighttpd.conf should be like this:

server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
        "mod_redirect",
    "mod_cgi",
    "mod_auth",
        "mod_openssl"
)

cgi.assign = ( ".sh" => "/bin/bash" )

server.document-root        = "/var/www/html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 443

ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/ssl/server.pem"

index-file.names            = ("index.sh", "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.conf.pl"
include "/etc/lighttpd/conf-enabled/*.conf"

auth.debug = 2
auth.backend = "plain"
auth.backend.plain.userfile = "/etc/lighttpd/.lighttpdpassword"

auth.require = ( "/" =>
    (
        "method" => "basic",
        "realm" => "Password protected area",
        "require" => "user=admin"
    )
)

Thanks for your work :D

ehamwey commented 4 years ago

This seems to be necessary when installing on Ubuntu 20.04, although once lighttpd.service starts I get 403 Forbidden errors on the web configuration screen. Current lighttpd.conf works perfectly on Ubuntu 18.04.

theonemule commented 4 years ago

I'll keep this in mind for 20.04. I built this on 16.04 LTS is still supported. 20.04 is still pretty new. I tried it for a few other things, but the changes were many.

spatemp commented 2 years ago

theonemule,

It would be great if you could get this working on 20.04. I have been using it on 16.04 all this time and recently decided to upgrade it to 20.04. Now it's not working for me :(

This was very easy to setup and so awesome job for putting this together for 16.04LTS.

Thanks again.

spatemp commented 2 years ago

theonemule,

It would be great if you could get this working on 20.04. I have been using it on 16.04 all this time and recently decided to upgrade it to 20.04. Now it's not working for me :(

This was very easy to setup and so awesome job for putting this together for 16.04LTS.

Thanks again.

I currently have it working with proposed createclient.sh script that I extracted out from index.sh. Although, it is manual but it works and does not require lighthttpd configured or working.

theonemule commented 2 years ago

Update to run on 20.4. Replaced Lighttpd with nginx