Databases Reference
In-Depth Information
hitting the database for each image or css file. Typically, HTTP Servers provide features such as file
caching or compression to improve the performance when serving static files.
Also, if your static files reference each other (e.g., the instruction { background-image:
url(smallPic.jpg); } in a CSS file) or you need to organize the files in a file system structure, you
cannot upload them to the workspace but have to use them on the HTTP Server instead.
If you store the file script1.js on the HTTP server, how could you support two different versions for
http://<server name>:<port>/apex custom/script1.js in the development and test environment
through the same HTTP server?
In order to support separate mappings of the virtual directory /apex custom/ when running
application 100 vs. running application 200 , you could use virtual hosting directives which are a feature
of the HTTP server. Virtual hosting allows you to use different configurations based on either the
hostname or the port. While your physical server IP address might be 192.168.0.8, you could have two
different entries in your DNS service resolving both dev.opal-consulting.de and test.opal-consulting.de
to the same physical address. Thus all of the following URL requests will be served by the same HTTP
server: http://192.168.0.8 , http://dev.opal-consulting.de and http://test.opal-consulting.de . You
could then distinguish between different versions on the application server by using different URLs to
call the script: ( http://dev.opal-consulting.de/apex custom/script1.js or http://test.opal-
consulting.de/apex custom/script2.js ) as seen in Listing 9-4 (configuration example specific to the
Apache HTTP Server).
Listing 9-4. Virtual Hosting (Name Based) with Apache
<VirtualHost *>
ServerName dev.opal-consulting.de
Alias /apex custom/ "/ag/apex custom dev/"
</VirtualHost>
<VirtualHost *>
ServerName test.opal-consulting.de
Alias /apex custom/ "/ag/apex custom test/"
</VirtualHost>
An alternative configuration is shown in Listing 9-5. It uses a port-based virtual hosting in order to
provide the URLs http://dev.opal-consulting.de:80/apex custom/script1.js and http://dev.opal-
consulting.de:81/apex custom/script2.js.
Listing 9-5. Virtual Hosting (Port Based) with Apache
<VirtualHost *:80>
ServerName dev.opal-consulting.de
Alias /apex custom/ "/ag/apex custom dev/"
</VirtualHost>
Search WWH ::




Custom Search