# run Pi-hole and Own/Nextcloud alongside

**URL:** https://dietpi.com/forum/t/run-pi-hole-and-own-nextcloud-alongside/5449
**Category:** Troubleshooting
**Created:** [20 June 2021 13:33 UTC](https://dietpi.com/forum/t/run-pi-hole-and-own-nextcloud-alongside/5449 "2021-06-20T13:33:46Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [20 June 2021 21:13 UTC](https://dietpi.com/forum/t/run-pi-hole-and-own-nextcloud-alongside/5449/7 "2021-06-20T21:13:48Z")

</div>

pls replace web server configuration as follow as user root

```nohighlight
mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.save
nano /etc/lighttpd/lighttpd.conf

```

simply mark whole block and copy following inside

```nohighlight
server.modules = (
        "mod_indexfile",
        "mod_setenv",
        "mod_access",
        "mod_alias",
        "mod_redirect",
        "mod_accesslog",
)

server.document-root = "/var/www"
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 = 80
accesslog.filename = "/var/log/lighttpd/access.log"

# strict parsing and normalization of URL for consistency and security
# https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_http-parseoptsDetails
# (might need to explicitly set "url-path-2f-decode" = "disable"
# if a specific application is encoding URLs inside url-path)
server.http-parseopts = (
  "header-strict" => "enable",# default
  "host-strict" => "enable",# default
  "host-normalize" => "enable",# default
  "url-normalize-unreserved"=> "enable",# recommended highly
  "url-normalize-required" => "enable",# recommended
  "url-ctrls-reject" => "enable",# recommended
  "url-path-2f-decode" => "enable",# recommended highly (unless breaks app)
 #"url-path-2f-reject" => "enable",
  "url-path-dotseg-remove" => "enable",# recommended highly (unless breaks app)
 #"url-path-dotseg-reject" => "enable",
 #"url-query-20-plus" => "enable",# consistency in query string
)

index-file.names = ( "index.php", "index.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
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"

#server.compat-module-load = "disable"
server.modules += (
        "mod_compress",
        "mod_dirlisting",
        "mod_staticfile",
)

```

and restart the web server

```nohighlight
systemctl restart lighttpd.service

```

let’s check available as well as enabled configuration

```nohighlight
ls -la /etc/lighttpd/conf-{available,enabled}

```

---

_[View the full topic](https://dietpi.com/forum/t/run-pi-hole-and-own-nextcloud-alongside/5449)._
