Portál AbcLinuxu, 10. května 2025 06:41
if ($host ~ ^localhost\.) ...
).
/etc/hosts
$ cat /usr/local/sbin/update-hosts #!/bin/bash virtuals=$(find /srv/www -maxdepth 1 -mindepth 1 \! -name localhost -printf ' %f') sed 's/^\(127\.0\.0\.1.*[ \t]loc\>\).*/\1 '"$virtuals"'/' -i /etc/hosts /etc/init.d/lighttpd restartPřed prvním použitím přidej do /etc/hosts řádek "127.0.0.1 loc", aby bylo co doplňovat.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.