Hier ist, was ichLighttpd benutzerdefinierte Konfiguration mysql vHost
tun möchte, muss ich Stand-alone-Websites, die ich ausführen möchten: siteA.maindomain, com und siteB.maindomain.com
Für SITEB i möchte subdomainX.siteB.maindomain.com mithilfe von mod_mysql_vhos vhost.
Hier ist, wie meine lighttpd.conf Datei aussieht:
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"
}
Ist das ok?
siteA.maindomain.com funktioniert gut.
Ich kann nicht auf die URL siteB.maindomain.com zugreifen. Ich bekomme 404. Was mache ich falsch?
Ich bin sicher, dass ich das nicht konfiguriert haben richtig subdomainX.siteB.maindomain.com VHOST