Pointing the Virtual Hosts to beta site

Discussion in 'Install/Configuration' started by gkamp, Feb 24, 2011.

  1. webizen

    webizen New Member

    Last edited: Mar 2, 2011
  2. gkamp

    gkamp New Member

    changed content of xml file but had no effect.

    <?xml version="1.0" encoding="UTF-8"?>
    <virtualHostConfig>
    <docRoot>/var/www/dev.grunt.com/htdocs/html/</docRoot>
    <enableGzip>1</enableGzip>
    <adminEmails></adminEmails>
    <logging>
    <log>
    <useServer>0</useServer>
    <fileName>/var/www/dev.grunt.com/htdocs/logs/error.log</fileName>
    <logLevel>DEBUG</logLevel>
    <rollingSize>10M</rollingSize>
    </log>
    <accessLog>
    <useServer>0</useServer>
    <fileName>/var/www/dev.grunt.com/htdocs/logs/access.log</fileName>
    <logReferer>1</logReferer>
    <logUserAgent>1</logUserAgent>
    <rollingSize>10M</rollingSize>
    <keepDays>30</keepDays>
    <compressArchive>0</compressArchive>
    </accessLog>
    </logging>
    <awstats>
    <updateMode>0</updateMode>
    <workingDir>/var/www/dev.grunt.com/htdocs/awstats</workingDir>
    <awstatsURI>/awstats/</awstatsURI>
    <siteDomain>localhost</siteDomain>
    <siteAliases>127.0.0.1 localhost</siteAliases>
    <updateInterval>86400</updateInterval>
    <updateOffset>0</updateOffset>
    </awstats>
    <index>
    <useServer>0</useServer>
    <indexFiles>index.html</indexFiles>
    <autoIndex>0</autoIndex>
    <autoIndexURI>/_autoindex/default.php</autoIndexURI>
    </index>
    <htAccess>
    <allowOverride>0</allowOverride>
    <accessFileName>.htaccess</accessFileName>
    </htAccess>
    <frontPage>
    <enable>0</enable>
    <disableAdmin>0</disableAdmin>
    <domainNames></domainNames>
    </frontPage>
    <expires>
    <enableExpires>1</enableExpires>
    <expiresDefault></expiresDefault>
    </expires>
    <security>
    <general>
    <enableContextAC>0</enableContextAC>
    </general>
    <hotlinkCtrl>
    <enableHotlinkCtrl>0</enableHotlinkCtrl>
    <suffixes>gif, jpeg, jpg</suffixes>
    <allowDirectAccess>1</allowDirectAccess>
    <redirectUri></redirectUri>
    <onlySelf>1</onlySelf>
    <allowedHosts></allowedHosts>
    </hotlinkCtrl>
    <realmList>
    <realm>
    <name>SampleProtectedArea</name>
    <type>file</type>
    <userDB>
    <location>/var/www/dev.grunt.com/htdocs/conf/htpasswd</location>
    <maxCacheSize>200</maxCacheSize>
    <cacheTimeout>60</cacheTimeout>
    </userDB>
    <groupDB>
    <location>/var/www/dev.grunt.com/htdocs/conf/htgroup</location>
    <maxCacheSize>200</maxCacheSize>
    <cacheTimeout>60</cacheTimeout>
    </groupDB>
    </realm>
    </realmList>
    <accessControl>
    <allow>*</allow>
    <deny></deny>
    </accessControl>
    </security>
    <contextList>
    <context>
    <uri>/docs/</uri>
    <type>NULL</type>
    <location>dev.grunt.com/docs/</location>
    <allowBrowse>1</allowBrowse>
    </context>
    <context>
    <uri>/protected/</uri>
    <type>NULL</type>
    <location>protected/</location>
    <allowBrowse>1</allowBrowse>
    <realm>SampleProtectedArea</realm>
    <authName>Protected</authName>
    <required>user test</required>
    <accessControl>
    <allow>*</allow>
    <deny></deny>
    </accessControl>
    </context>
    <context>
    <uri>/blocked/</uri>
    <type>NULL</type>
    <location>blocked/</location>
    <allowBrowse>0</allowBrowse>
    </context>
    <context>
    <uri>/cgi-bin/</uri>
    <type>cgi</type>
    <location>/var/www/dev.grunt.com/htdocs/cgi-bin/</location>
    <allowBrowse>1</allowBrowse>
    </context>
    </contextList>
    <scriptHandlerList>
    </scriptHandlerList>
    <customErrorPages>
    <errorPage>
    <errCode>404</errCode>
    <url>/error404.html</url>
    </errorPage>
    </customErrorPages>
    <rewrite>
    <enable>0</enable>
    <logLevel>0</logLevel>
    <rules>RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot
    RewriteRule ^/nospider/ - [F]</rules>
    </rewrite>
    </virtualHostConfig>
  3. webizen

    webizen New Member

    Can you pm the URL or send us a screen capture of the phpinfo page?
  4. gkamp

    gkamp New Member

    System Linux VSLINUX01 2.6.35-25-server #44-Ubuntu SMP Fri Jan 21 19:09:14 UTC 2011 x86_64
    Build Date Feb 22 2011 17:47:07
    Configure Command './configure' '--prefix=/usr/local/lsws/lsphp5' '--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mysql' '--with-mcrypt' '--with-curl' '--with-freetype-dir=/usr/include' '--with-png-dir=/usr/include' '--with-xpm-dir=/usr/include' '--enable-gd-native-ttf' '--with-t1lib=/usr/include' '--with-jpeg-dir=/usr/include' '--with-litespeed' '--with-pdo-mysql' '--enable-soap' '--with-openssl' '--enable-suhosin'
    Server API LiteSpeed V5.5
    Virtual Directory Support disabled
    Configuration File (php.ini) Path /usr/local/lsws/lsphp5/lib
    Loaded Configuration File /usr/local/lsws/lsphp5/lib/php.ini
    Scan this dir for additional .ini files (none)
    Additional .ini files parsed (none)
    PHP API 20090626
    PHP Extension 20090626
    Zend Extension 220090626
    Zend Extension Build API220090626,NTS
    PHP Extension Build API20090626,NTS
    Debug Build no
    Thread Safety disabled
    Zend Memory Manager enabled
    Zend Multibyte Support disabled
    IPv6 Support enabled
    Registered PHP Streams https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar
    Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
    Registered Stream Filters zlib.*, convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

    Suhosin logo This server is protected with the Suhosin Patch 0.9.10
    Copyright (c) 2006-2007 Hardened-PHP Project Copyright (c) 2007-2009 SektionEins GmbH

    Zend logo This program makes use of the Zend Scripting Language Engine:
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

    PHP Credits
    Configuration
    Core
    PHP Version 5.3.5

    Directive Local Value Master Value
    allow_call_time_pass_reference On On
    allow_url_fopen On On
    allow_url_include Off Off
    always_populate_raw_post_data Off Off
    arg_separator.input & &
    arg_separator.output & &
    asp_tags Off Off
    auto_append_file no value no value
    auto_globals_jit On On
    auto_prepend_file no value no value
    browscap no value no value
    default_charset no value no value
    default_mimetype text/html text/html
    define_syslog_variables Off Off
    disable_classes no value no value
    disable_functions no value no value
    display_errors On On
    display_startup_errors Off Off
    doc_root no value no value
    docref_ext no value no value
    docref_root no value no value
    enable_dl On On
    error_append_string no value no value
    error_log no value no value
    error_prepend_string no value no value
    error_reporting no value no value
    exit_on_timeout Off Off
    expose_php On On
    extension_dir /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626 /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626
    file_uploads On On
    highlight.bg #FFFFFF #FFFFFF
    highlight.comment #FF8000 #FF8000
    highlight.default #0000BB #0000BB
    highlight.html #000000 #000000
    highlight.keyword #007700 #007700
    highlight.string #DD0000 #DD0000
    html_errors On On
    ignore_repeated_errors Off Off
    ignore_repeated_source Off Off
    ignore_user_abort Off Off
    implicit_flush Off Off
    include_path .:/usr/local/lsws/lsphp5/lib/php .:/usr/local/lsws/lsphp5/lib/php
    log_errors Off Off
    log_errors_max_len 1024 1024
    magic_quotes_gpc Off Off
    magic_quotes_runtime Off Off
    magic_quotes_sybase Off Off
    mail.add_x_header Off Off
    mail.force_extra_parameters no value no value
    mail.log no value no value
    max_execution_time 18000 18000
    max_file_uploads 20 20
    max_input_nesting_level 64 64
    max_input_time -1 -1
    memory_limit 1024M 1024M
    open_basedir no value no value
    output_buffering 0 0
    output_handler no value no value
    post_max_size 8M 8M
    precision 14 14
    realpath_cache_size 16K 16K
    realpath_cache_ttl 120 120
    register_argc_argv On On
    register_globals Off Off
    register_long_arrays On On
    report_memleaks On On
    report_zend_debug On On
    request_order no value no value
    safe_mode Off Off
    safe_mode_exec_dir /usr/local/php/bin /usr/local/php/bin
    safe_mode_gid Off Off
    safe_mode_include_dir no value no value
    sendmail_from no value no value
    sendmail_path -t -i -t -i
    serialize_precision 100 100
    short_open_tag On On
    SMTP localhost localhost
    smtp_port 25 25
    sql.safe_mode Off Off
    track_errors Off Off
    unserialize_callback_func no value no value
    upload_max_filesize 2M 2M
    upload_tmp_dir no value no value
    user_dir no value no value
    user_ini.cache_ttl 300 300
    user_ini.filename .user.ini .user.ini
    variables_order EGPCS EGPCS
    xmlrpc_error_number 0 0
    xmlrpc_errors Off Off
    y2k_compliance On On
    zend.enable_gc On On
  5. webizen

    webizen New Member

    What is the value of '_SERVER["SCRIPT_FILENAME"]' on the phpinfo page?
  6. gkamp

    gkamp New Member

    I thought it was suppose to be this:

    _SERVER["DOCUMENT_ROOT"] /var/www/dev.grunt.com/htdocs

    why is it going to the default and how do I change it?
  7. webizen

    webizen New Member

    According to your vhost xml file (pasted earlier)
    _SERVER["DOCUMENT_ROOT"] should be "/var/www/dev.grunt.com/htdocs/html"
    _SERVER["SCRIPT_FILENAME"] should be "/var/www/dev.grunt.com/htdocs/html/phpinfo.php"

    To change document root, go to Admin Web Console => Configuration => Virtual Hosts => BETA => General => Document Root.
  8. gkamp

    gkamp New Member

    there is no html folder "/var/www/dev.grunt.com/htdocs/html"
    there is no html folder "/var/www/dev.grunt.com/htdocs/html/phpinfo.php"

    it be created?
  9. webizen

    webizen New Member

    You need to create the html folder before configure it to be the document root if you want to use html folder. OR change the document root to be "/var/www/dev.grunt.com/htdocs".
  10. gkamp

    gkamp New Member

    here some new information. when i try and go to http://dev.grunt.com/ i get this:

    Trace:
    #0 /var/www/dev.grunt.com/htdocs/lib/Zend/Cache/Backend/Memcached.php(403): Zend_Cache::throwException('Can't get filli...')
    #1 /var/www/dev.grunt.com/htdocs/lib/Zend/Cache/Backend/TwoLevels.php(488): Zend_Cache_Backend_Memcached->getFillingPercentage()
    #2 /var/www/dev.grunt.com/htdocs/lib/Zend/Cache/Backend/TwoLevels.php(173): Zend_Cache_Backend_TwoLevels->_getFastFillingPercentage('saving')
    #3 /var/www/dev.grunt.com/htdocs/lib/Zend/Cache/Core.php(381): Zend_Cache_Backend_TwoLevels->save('a:8:{s:10:"bloc...', '011_CORE_CACHE_...', Array, NULL)
    #4 /var/www/dev.grunt.com/htdocs/lib/Varien/Cache/Core.php(76): Zend_Cache_Core->save('a:8:{s:10:"bloc...', 'CORE_CACHE_OPTI...', Array, NULL, 8)
    #5 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/Cache.php(349): Varien_Cache_Core->save('a:8:{s:10:"bloc...', 'CORE_CACHE_OPTI...', Array, NULL)
    #6 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/Cache.php(427): Mage_Core_Model_Cache->save('a:8:{s:10:"bloc...', 'core_cache_opti...')
    #7 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/Cache.php(459): Mage_Core_Model_Cache->_initOptions()
    #8 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/App.php(1100): Mage_Core_Model_Cache->canUse('config')
    #9 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/Config.php(404): Mage_Core_Model_App->useCache('config')
    #10 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/Config.php(286): Mage_Core_Model_Config->_canUseCacheForInit()
    #11 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/App.php(359): Mage_Core_Model_Config->loadModulesCache()
    #12 /var/www/dev.grunt.com/htdocs/app/code/core/Mage/Core/Model/App.php(295): Mage_Core_Model_App->_initModules()
    #13 /var/www/dev.grunt.com/htdocs/app/Mage.php(596): Mage_Core_Model_App->run(Array)
    #14 /var/www/dev.grunt.com/htdocs/index.php(80): Mage::run('', 'store')
    #15 {main}


    And getting these new errors in the Admin Console:

    2011-03-02 15:27:34.407 ERROR [config:vhost:Example:logging] failed to set up error log!
    2011-03-02 15:27:34.472 ERROR [config:vhost:Example:security:realm:SampleProtectedArea] Path for user DB is invalid: /var/www/dev.grunt.com/htdocs/conf/htpasswd
    2011-03-02 15:27:34.472 ERROR [config:vhost:Example:logging:accesslog] log file is not writable - /var/www/dev.grunt.com/htdocs/logs/access.log
    2011-03-02 15:27:34.472 ERROR [config:vhost:Example:logging:accesslog] failed to set up access log!
    2011-03-02 15:27:34.527 ERROR [config:vhost:Example:context:/docs/] Path for context location is invalid: /var/www/dev.grunt.com/htdocs/dev.grunt.com/docs/
    2011-03-02 15:27:34.527 ERROR [config:vhost:Example:context:/protected/] Path for context location is invalid: /var/www/dev.grunt.com/htdocs/protected/
    2011-03-02 15:27:34.527 ERROR [config:vhost:Example:context:/cgi-bin/] Path for context location is invalid: /var/www/dev.grunt.com/htdocs/cgi-bin/
    2011-03-02 15:27:34.599 ERROR [config:server:vhosts] Path for vhost config is invalid: /usr/local/lsws/BETA/conf/vhconf.xml
    2011-03-02 15:27:34.643 ERROR [config:vhost:BETA] Path for document root is not accessible: /usr/local/lsws/BETA/public_html/
    2011-03-02 15:27:34.643 ERROR [config:vhost:BETA] configuration failed!
    Last edited: Mar 3, 2011
  11. webizen

    webizen New Member

    from your php trace, your docroot for dev.grunt.com is set up correctly. http://dev.grunt.com did land on /var/www/dev.grunt.com/htdocs/index.php (#14). you need to figure out why zend cache throw that exception.

    Regarding the errors seen in admin console, it the same as you see in /usr/local/lsws/logs/error.log.

    It seems your vhost configurations were incorrect: $VH_ROOT and $DOC_ROOT should be different for security purpose. error log, access log and user DB should be under $VH_ROOT. Place them under $DOC_ROOT is a good practice. Permission issue regarding "not writable", "not accessible" usually indicates that the folder is not writable or readable by web server running user (e.g. nobody).

Share This Page