Jei forume lankaisi pirmą kartą, kviečiame registruotis ir prisijungti prie diskusijų.
PrisijungtiRegistruotisJei forume lankaisi pirmą kartą, kviečiame registruotis ir prisijungti prie diskusijų.
cd /usr/local/directadmin/data/templates
nano openlitespeed_context_protected.conf
authName |AUTH_NAME|
allowBrowse 1
realm |PROTECTED_PATH|/
accessControl {
allow *
}
|CUSTOM1|
|?DOCROOT=HOME/domains/sharedip|
|*if STATUS="server"|
|?DOCROOT=/var/www/html|
|*endif|
|?SSLPROTOCOL=30|
|CUSTOM2|
virtualHost |IP| {
|CUSTOM3|
listeners |LISTENER_80|, |LISTENER_443|
user |USER|
group |USER|
vhRoot |HOME|
allowSymbolLink 1
enableScript 1
restrained 1
setUIDMode 2
docRoot |DOCROOT|
vhDomain |IP|
adminEmails root@localhost
enableGzip 1
enableIpGeo 1
rewrite {
enable 1
autoLoadHtaccess 1
RewriteFile .htaccess
|CUSTOM4|
}
|CUSTOM5|
vhssl {
keyFile |KEY|
certFile |CERT|
certChain 1
sslProtocol |SSLPROTOCOL|
}
# include aliases
include /usr/local/lsws/conf/httpd-alias.conf
|CUSTOM6|
}
|CUSTOM1|
|?SSLPROTOCOL=30|
|CUSTOM2|
listener |LISTENER_80| {
|CUSTOM3|
address |IP|:80
secure 0
|CUSTOM4|
}
listener |LISTENER_443| {
|CUSTOM5|
address |IP|:443
secure 1
keyFile |KEY|
certFile |CERT|
certChain 1
sslProtocol |SSLPROTOCOL|
|CUSTOM6|
}
|CUSTOM1|
|?WWW_PREFIX=www.|
|*if WWW_REDIRECT="no"|
|?WWW_PREFIX=|
|*endif|
|?VH_PORT=PORT_80
|
|?VHROOT=HOME
|
|?DOCROOT=HOME
/domains/DOMAIN
/public_html|
|?SSLPROTOCOL=30|
|CUSTOM2|
virtualHost |POINTER|-|VH_PORT| {
|CUSTOM3|
user |USER|
group |GROUP|
vhRoot |VHROOT|
setUIDMode 2
listeners |LISTENERS|
docRoot |DOCROOT|
vhDomain |POINTER|
vhAliases www.|POINTER|
rewrite {
enable 1
RewriteRule (.*)$ http://|WWW_PREFIX||DOMAIN|/$1 [R=301,L]
}
|CUSTOM4|
}
|*if HAVE_SSL="1"|
|?VH_PORT=PORT_443
|
virtualHost |POINTER|-|VH_PORT| {
|CUSTOM5|
user |USER|
group |GROUP|
vhRoot |VHROOT|
setUIDMode 2
listeners |SSL_LISTENERS|
docRoot |DOCROOT|
vhDomain |POINTER|
vhAliases www.|POINTER|
rewrite {
enable 1
RewriteRule (.*)$ https://|WWW_PREFIX||DOMAIN|/$1 [R=301,L]
}
vhssl {
keyFile |KEY|
certFile |CERT|
certChain 1
sslProtocol |SSLPROTOCOL|
}
|CUSTOM6|
}
|*endif|
|CUSTOM1|
|?PUBLIC_HTML=public_html|
|?VH_PORT=PORT_80
|
|*if SSL_TEMPLATE="1"|
|?PUBLIC_HTML=private_html|
|?VH_PORT=PORT_443
|
|*endif|
|?DOCROOT=HOME
/domains/DOMAIN
/PUBLIC_HTML
|
|?PUB_DOCROOT=HOME
/domains/DOMAIN
/public_html|
|?SDOMAIN=DOMAIN
|
|?LOG_NAME=DOMAIN
|
|*if SUB|
|?DOCROOT=DOCROOT
/SUB
|
|?SDOMAIN=SUB
.DOMAIN
|
|?LOG_NAME=DOMAIN
.SUB
|
|*endif|
|?REALDOCROOT=DOCROOT
|
|?VHROOT=HOME
|
|?SCRIPTHANDLER=lsphpPHP1_RELEASE
|
|?SSLPROTOCOL=30|
|?OBDP1=|
|*if PHP1_RELEASE!="0"|
|?OBDP1=:/usr/local/phpPHP1_RELEASE
/lib/php/|
|*endif|
|?OBDP2=|
|?OPEN_BASEDIR_PATH=HOME
/:/tmp:/var/tmp:/opt/alt/phpPHP1_RELEASE
/usr/share/pear/:/dev/urandom:/usr/local/lib/php/OBDP1
OBDP2
|
|?PHP_MAIL_LOG=|
|?CLI_PHP_MAIL_LOG=|
|*if PHP_MAIL_LOG_ENABLED="1"|
|?PHP_MAIL_LOG=-d mail.log="HOME
/.php/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log HOME
/.php/php-mail.log|
|*endif|
|?PHP_EMAIL=USER
DOMAIN
|
virtualHost |SDOMAIN|-|VH_PORT| {
|CUSTOM|
user |USER|
group |GROUP|
vhRoot |VHROOT|
allowSymbolLink 1
enableScript 1
restrained 1
setUIDMode 2
# listeners listener1, listener2, listener3
listeners |LISTENERS|
#VirtualHost config settings
docRoot |DOCROOT|
vhDomain |SDOMAIN|
vhAliases www.|SDOMAIN||SERVER_ALIASES|
adminEmails |ADMIN|
enableGzip 1
enableIpGeo 1
errorlog |APACHELOGDIR|/|LOG_NAME|.error.log {
useServer 0
logLevel NOTICE
rollingSize 0
}
accesslog |APACHELOGDIR|/|LOG_NAME|.log {
useServer 0
logFormat %a %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"
logHeaders 5
rollingSize 0
}
accesslog |APACHELOGDIR|/|LOG_NAME|.bytes {
useServer 0
logFormat %O %I
rollingSize 0
}
scripthandler {
|CUSTOM2|
add lsapi:|SCRIPTHANDLER| inc
add lsapi:|SCRIPTHANDLER| php
add lsapi:|SCRIPTHANDLER| phtml
add lsapi:|SCRIPTHANDLER| php|PHP1_RELEASE|
}
phpIniOverride {
|CUSTOM4|
php_admin_flag engine |PHP|
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f |PHP_EMAIL|"
|*if OPEN_BASEDIR_ENABLED="ON"|
php_admin_value open_basedir "|OPEN_BASEDIR_PATH|"
|*endif|
|CLI_PHP_MAIL_LOG|
|*if HAVE_SAFE_MODE="1"|
php_admin_flag safe_mode |SAFE_MODE|
|*endif|
}
rewrite {
enable 1
autoLoadHtaccess 1
|FORCE_SSL_REDIRECT|
|OPENLITESPEED_REDIRECTS|
|CUSTOM5|
}
|CONTEXTS|
|REALMS|
|*if SSL_TEMPLATE="1"|
vhssl {
|CUSTOM6|
keyFile |KEY|
certFile |CERT|
certChain 1
sslProtocol |SSLPROTOCOL|
}
|*endif|
# include aliases
include /usr/local/lsws/conf/httpd-alias.conf
|CUSTOM7|
cd /usr/local/directadmin/scripts./set_permissions.sh all
cd /usr/local/directadmin/custombuild
./build rewrite_confs
cd /usr/local/lsws/conf
nano httpd-vhosts.conf
virtualHost domenas.lt {
user naudotojas
group naudotojas
vhRoot /home/naudotojas/domains/domenas.lt/public_html/
allowSymbolLink 1
enableScript 1
restrained 1
setUIDMode 2
docRoot /home/naudotojas/domains/domenas.lt/public_html/
vhDomain domenas.lt
# order: Exact macth first; Then wildMatch; Then the default, which is *
# having "vhAliases *" is not dangerous, and would just serve the vhost as "default vhost"
vhAliases *
listeners IP-ad-re-sas-80, IP-ad-re-sas-443
adminEmails root@localhost
enableGzip 1
enableIpGeo 1
}
/usr/local/lsws/bin/lswsctrl restart
failo koregavimo:*/3 * * * * root if ! find /home/*/domains/*/*_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi* * root if ! find /home/*/domains/*/*_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi
Komentarai
cd /usr/local/directadmin/scripts./set_permissions.sh allcd /usr/local/directadmin/custombuild ./build rewrite_confs
Pakeiskite į
cd /usr/local/directadmin/scripts/set_permissions.sh all
cd /usr/local/directadmin/custombuild
./build rewrite_confs
Nes vistiek neveikia, svetainės rodo hostname turinį.
AdminVHost] [STDERR] PHP Warning: file(/usr/local/directadmin/data/users/x/openlitespeed.conf): failed to open stream: Permission denied in /usr/local/lsws/admin/html.open/lib/PlainConfParser.php on line 118
Dėl to neperkelia duomenų