You are not logged in.

#1 2019-08-08 16:23:47

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,799
Website

[ Solved ] Lighttpd no tilde in specific $user path

So I have userdir enabled and my few users have $HOME/public_html dirs..., now for a single user (ticho), I'd like to resolve urls also without tilde (~), how to proceed?

So I have url

http://server.local/~ticho

but would also like to have

http://server.local/ticho

working.

Tried with mod-rewrite and several versions of this (in lighttpd.conf):

# tilde rewrite
url.rewrite = (
  
  "/ticho/(*)" => "~/ticho/$1"

)

and they pretty much all failed, which might be my not undertanding the regex syntax or else.

Also userdir docs don't seem to have any indication on how to get rid of tilde.

Last edited by brontosaurusrex (2019-08-08 18:59:13)

Offline

#2 2019-08-08 18:16:25

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,464

Re: [ Solved ] Lighttpd no tilde in specific $user path

How about not doing the userdir thing at all then and just routing /ticho to /full/path/to/ticho/public_html on the file system? It has been a long time since I used lighttpd, but on nginx this could be done with "alias" (as opposed "root").

So let the userdir module coexist with regular request routing.


A silent kite against the blue, blue sky

Offline

#3 2019-08-08 18:43:07

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,799
Website

Re: [ Solved ] Lighttpd no tilde in specific $user path

Good idea, however I get this cryptic error

sudo service lighttpd restart
Job for lighttpd.service failed because the control process exited with error code.
See "systemctl status lighttpd.service" and "journalctl -xe" for details.

~/www 
∵ticho@i5> sudo service lighttpd status 
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-08-08 20:40:10 CEST; 3s ago
  Process: 16057 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTIO

Aug 08 20:40:10 i5 systemd[1]: lighttpd.service: Service RestartSec=100ms expired, scheduling restart.
Aug 08 20:40:10 i5 systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Aug 08 20:40:10 i5 systemd[1]: Stopped Lighttpd Daemon.
Aug 08 20:40:10 i5 systemd[1]: lighttpd.service: Start request repeated too quickly.
Aug 08 20:40:10 i5 systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Aug 08 20:40:10 i5 systemd[1]: Failed to start Lighttpd Daemon.

with

# alias
alias.url = ( "/woot/" => "/home/ticho/www/" )

Edit: However the way of the shell

cd /var/www/html 
sudo ln -s /home/ticho/public_html t  

seems to be working smile, so my valid link is now also

http://server.local/t

Last edited by brontosaurusrex (2019-08-09 08:25:21)

Offline

Board footer

Powered by FluxBB