I am developing a web based application that displays web page on client server based on a xml file from the web server that is configured with httpd. I am new to httpd and need guidance on how to code HTML page that reads xml file from web server with httpd, how to code the file path in HTML and how to call the httpd to access the file with HTML.
Asked
Active
Viewed 134 times
1 Answers
0
What you want is to map a URI to a filesystem location.
Assume your hostname is example.com and your have a file foo.xml
, here is what you need to do:
- Put
foo.xml
in server's directory, say/var/www/xmls
- Edit httpd.conf, set
DocumentRoot /var/www
- Create index.html in
/var/www
- In
index.html
add linkhttp://example.com/xmls/foo.xml
- start httpd service
Now if you open http://example.com, you will see your index.html page. If you click the link you just added you should be able to download/view foo.xml
.
Note: the runner of httpd
must have r+x
permissions on www
and xml
directories.

stupidlearner
- 98
- 7