This functionality is implemented in Apache using aliases, which are
configured through the httpd.conf configuration file. The syntax of an alias entry is as
follows:
Alias alias_name real_folder_name
?– Tip The httpd.conf configuration file is well self-documented, but you can also check the Apache 2
documentation available at http://httpd.apache.org/docs-2.0/.
If you??™re working on Windows, use the steps in the following exercise to configure your
tshirtshop working folder. The steps for Linux systems will follow after this exercise.
CHAPTER 3 ?– STARTING THE TSHIRTSHOP PROJECT 34
Exercise: Preparing the tshirtshop Alias on Windows
1. Create a new folder named tshirtshop, which will be used for all the work you??™ll do in this book. We
assume that you create it in the root folder C:\ (because we??™ll use relative paths in the project, you can
choose any location that can be accessed by your Apache folder).
2. The default place used by Apache (in XAMPP setup) to serve client requests from is C:\xampp\htdocs.
This location is defined by the DocumentRoot directive in the Apache configuration file, which is located in
C:\xampp\apache\conf\httpd.conf.
Because we want to use our folder instead of the default folder mentioned by DocumentRoot, we need to
create an alias named tshirtshop that points to the tshirtshop physical folder you created in Step 1.
Pages:
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100