0

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.

1 Answer 1

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:

  1. Put foo.xml in server's directory, say /var/www/xmls
  2. Edit httpd.conf, set DocumentRoot /var/www
  3. Create index.html in /var/www
  4. In index.html add link http://example.com/xmls/foo.xml
  5. 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.