2016-07-01 7 views
0
여기

내가 내가 내가 실행하려면 독립형하는 웹 사이트가이 Lighttpd 사용자 지정 구성 MySQL의 가상 호스트

을 수행 할 것입니다 : siteA.maindomain, COM 및 사이트 B 내가 들어 siteB.maindomain.com

mod_mysql_vhos를 사용하여 vdom subdomainX.siteB.maindomain.com에 접속할 수 있기를 원합니다.

server.modules    = (
      "mod_access", 
      "mod_alias", 
      "mod_accesslog", 
      "mod_compress", 
      "mod_mysql_vhost", 
      "mod_ssi", 
      "mod_rewrite" 
) 



include_shell "/usr/share/lighttpd/include-conf-enabled.pl" 

ssi.extension = (".html") 
server.document-root  = "/var/www/maindomain/htdocs" 
server.errorlog   = "/var/log/lighttpd/error.log" 
accesslog.filename   = "/var/log/lighttpd/access.log" 
index-file.names   = ("index.php", "index.html", 
           "index.htm", "default.htm", 
           "index.lighttpd.html") 



fastcgi.debug = 1 

static-file.exclude-extensions = (".pl", ".fcgi") 

server.port    = 80 
server.bind    = "11.22.33.44" 
server.pid-file   = "/var/run/lighttpd.pid" 

dir-listing.encoding  = "utf-8" 
server.dir-listing   = "disable" 

server.username   = "www-data" 
server.groupname   = "www-data" 

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

#include_shell "/usr/share/lighttpd/create-mime.assign.pl" 


mysql-vhost.db    = "vhost" 
mysql-vhost.user   = "lighttpd" 
mysql-vhost.pass   = "correct_password" 
mysql-vhost.sql   = "SELECT docroot FROM domains WHERE domain='?';" 
mysql-vhost.hostname  = "localhost" 
mysql-vhost.port   = 3306 

$HTTP["host"] == "siteA.maindomain.com" { 
    server.document-root = "/var/www/siteA/htdocs" 
    accesslog.filename = "/var/www/siteA/htdocs/logs/access.log" 
    server.errorlog = "/var/www/siteA/htdocs/logs/error.log" 

} 

$HTTP["host"] == "siteB.maindomain.com" { 
    server.document-root = "/var/www/siteB/htdocs" 
    accesslog.filename = "/var/www/siteB/htdocs/logs/access.log" 
    server.errorlog = "/var/www/siteB/htdocs/logs/error.log"  
} 

이 괜찮 : 여기

내 lighttpd.conf가 파일의 모습인가?

siteA.maindomain.com이 정상적으로 작동합니다.

siteB.maindomain.com URL에 액세스 할 수 없습니다. 나는 404를 얻는다. 나는 무엇을 잘못하고있다.

나는 내가

답변

0

가 올바르게 사이트 B/htdocs를 설정했는지 확인 subdomainX.siteB.maindomain.com을 가상 호스트을 제대로 구성하지 않은 확신합니다. 테아 작동 때문에, 당신은 server.document-root = "/var/www/siteA/htdocs" 에 siteB.maindomain.com server.document-root = "/var/www/siteB/htdocs" 변경 (일시적으로) 시도 할 수 있으며 그 작동하는 경우 다음을 참조하십시오.

또한 mysql 데이터베이스에 로그인하여 siteB.maindomain.com이 vhost 데이터베이스에 구성되어 있는지 확인할 수 있습니다.