Prev | Current Page 90 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"


2. The default place used by Apache to serve client requests from is usually something like /opt/lampp/htdocs.
This location is defined by the DocumentRoot directive in the Apache configuration file, whose complete
path is usually /opt/lampp/etc/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.
Open the Apache configuration file (httpd.conf), find the aliases section (which is defined by the
configuration tag), and add the following lines:

# ...
# Configure the tshirtshop alias
Alias /tshirtshop/ "/home/username/tshirtshop/"
Alias /tshirtshop "/home/username/tshirtshop"


Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

After adding these lines, a request for http://localhost/tshirtshop or http://localhost/
tshirtshop/ will result in the application in the tshirtshop folder (once it exists) being executed.
3. Create a file named test.php in the tshirtshop folder, with the following line inside:

4. Restart the Apache web server (this is necessary because we??™ve made changes to the Apache configuration
file).


Pages:
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102