Testing and Staging
A test server is available for staging sites and testing scripts before live delivery. Each production vhost has a test counterpart (e.g., http://www.bme.ncsu.edu has http://webtest.bme.ncsu.edu ), which is WRAP-protected and can print PHP script errors to the browser. If you have a .org domain hosted by engineering web servers, you should use http://webtest.yourdomainname.org.ncsu.edu/ for testing your PHP scripts.
ITECS recommends that you develop and test your site before publishing it if you are using PHP scripts or other dynamic pages. Using the test server will reveal error messages that are blocked on the public web servers to improve security.
PHP and Webtest
A test server is available for staging sites and testing scripts before live delivery. Each production vhost has a test counterpart (e.g., www.bme.ncsu.edu has webtest.bme.ncsu.edu), which is WRAP-protected and can print PHP script errors to the browser.
Only PHP is supported in Eos web lockers, no CGI, perl, jsp, asp, etc. ITECS recommends that you develop and test your site before publishing it if you are using PHP scripts or other dynamic pages.
Use the webtest server to reveal error messages that are blocked on the public web servers for security reasons. The webtest server will give you detailed error reporting, which you cannot get from your live space. If a script fails in some way, you will view it under webtest to find out what problems it has.
Each production vhost has a webtest counterpart. For example, www.bme.ncsu.edu has webtest.bme.ncsu.edu for testing content. To determine the webtest URL for a site, remove "www" from the beginning, if it exists, and add "webtest." If the URL does not begin with "www," simply add "webtest."
The web test URL is determined in the following way:
If the URL is not in the "ncsu.edu"domain, for example if it is a ".org" then the name of the testing server is a little different.
"www" is still replaced with "webtest", but ".ncsu.edu" has to be added to the end:
The only differences between the production and webtest vhosts are:
- test vhosts are WRAP-protected to NCSU
- test vhosts print PHP script errors to the browser
Although some of the production sites are SSL-enabled, no test vhost supports encryption. This accommodates vhosts that have common PHP libraries in their _include directories that are used in multiple scripts throughout the site.
For example, the following are production and webtest sites for three different vhosts:
students.engr.ncsu.edu - webtest.students.engr.ncsu.edu
vcl.ncsu.edu - webtest.vcl.ncsu.edu
www.engr.ncsu.edu - webtest.engr.ncsu.edu
Corrupted Files from Webtest
Using php as a file handler may lead to delivery of corrupted files from the webtest URLs.
Our webtest server displays php errors and warnings in the browser so that developers can see them. When a php application or script is used to pass a file along to the browser, these errors and warnings can be inserted inline to the file stream, which then leads to a corrupted file. Some browsers may give an error like, "This file cannot be displayed because it appears to have errors," or the browser may just try and dump the entire thing as text. Since these errors/warnings are only inserted on webtest (and futureshock), the main site will work fine. You may just decide that this is acceptable since it works on the main server. However, if you want to correct the problem so that these work on webtest, then you need to correct all of the errors and warnings.
As an example, Drupal is an application that is affected by this. In its default install, there are iniset() directives in both the /sites/default/settings.php and /includes/bootstrap.inc files. Since our servers have that function disabled, these generate warning messages on the webtest server. Commenting these lines out will stop the warnings and then it will properly handle the file streams.