Jump to content
php.lv forumi

lighttpd vairāki domēni


Recommended Posts

Esmu dumjš nixos (un ne tikai), tāpēc vajag palīdzību kā nokonfigurēt lighttpd serveri, lai domēnam un subdomēnam servē failus no dažādām mapēm un (ja iespējams) lai katrā no gadījumiem darbojas ar dažādu lietotāju privilēģijām.

 

Mēģināju nokonfigurēt šādi:

 

$HTTP["host"] =~ "(^|\.)domain\.(ua|com|ru|pl|co\.uk)$" {
 server.document-root = "/var/www/production/www"
 server.errorlog = "/var/www/production/logs/error.log"
 accesslog.filename = "/var/www/production/logs/access.log"
 server.username = "productionuser"
 server.groupname = "lighttpd"
 server.error-handler-404 = "/fileserver/err.php"
}


$HTTP["host"] =~ "(^|\.)dev\.domain\.(ua|com|ru|pl|co\.uk)$" {
 	   server.document-root = "/var/www/development/www"
 	   server.errorlog = "/var/www/development/logs/error.log"
 	   accesslog.filename = "/var/www/development/logs/access.log"
 	   server.username = "developmentuser"
 	   server.groupname = "lighttpd"
 	   server.error-handler-404 = "/fileserver/err.php"
}

 

developmentuser un productionuser eksistē un faili iekš documentrootiem pieder attiecīgi developmentuser:lighttpd un productionuser:lighttpd

 

Aizkomentējot pirmo pusi viss strādā. Atkomentējot pirmo un aizkomentējot otro direktīvu pusi arī- t.i. atsevišķi abas šīs daļas strādā normāli.

 

Kad ir atkomentētas abas puses- lighttpd piešķiļas normāli, taču neko neservē.

 

Development saita error.log failā :

 

2009-06-04 03:23:19: (mod_accesslog.c.535) opening access-log failed: Permission denied /var/www/production/logs/access.log 

2009-06-04 03:23:19: (server.c.908) Configuration of plugins failed. Going down.

 

 

 

Kādam ir nojausma, kā šo lietu varētu atrisināt? Problēma laikam ir tur, ka access.log tiek vērts vaļā rakstīšanai ar ne to useri. Log failos ir tiesības rakstīt arī grupai.

Edited by fest
Link to comment
Share on other sites

Gint, izskatās, ka vaina bija tur, ka esmu pieradis darboties ar apachi- jebšu:

This is wrong, the server.username/groupname setting is not for usage with vhosts. Lighttpd uses one process and the settings named here are for setting the user/group this one process runs as. It can't change the user per request. Apache can do that, not lighty.

http://redmine.lighttpd.net/boards/2/topics/322#message-323

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...