How do I get my Apache Tomcat server to serve an XML file?

Alles, was den Apache betrifft, kann hier besprochen werden.

How do I get my Apache Tomcat server to serve an XML file?

Postby QuietLeni » 10. March 2020 23:37

I have a simple website that needs to serve a single XML file, using SSL. There is a process that updates the XML file each night for people to poll it during the day.

The Server.xml file looks like this:

<IfModule mod_ssl.c>
ServerAdmin networks@website.uri
ServerName website.uri
ServerAlias website.uri
DocumentRoot /var/www/website.uri/html
ScriptAlias "/cgi-bin/" "/var/www/website.uri/cgi-bin/"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateKeyFile /etc/ssl/localcerts/apache.key
SSLCertificateFile /etc/ssl/localcerts/apache.pem
SSLCertificateChainFile /etc/ssl/localcerts/apache.crt
<Directory /var/www/website.uri/html>
AddType text/xml "xml"
SSLOptions +StdEnvVars
<Directory /var/www/website.uri/cgi-bin>
Options +ExecCGI
AddHandler cgi-script .py
SSLOptions +StdEnvVars

I would like to put this file called, "feed.xml" into the /var/www/website.uri/html directory and for the following curl to return the contents of the XML:

curl -k https://website.uri/html/feed.xml

However, when I place the feed.xml into the /var/www/website.uri/html directory, I get the following:

<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
networks@website.uri to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<address>Apache/2.4.41 (Ubuntu) Server at localhost Port 443</address>

I am fed up of searching for "how to serve an XML file in Apache" and getting Mr Google tell me about anything but what I want about the server.xml.

What am I doing wrong, please?
Posts: 1
Joined: 10. March 2020 23:17
XAMPP version: 1
Operating System: Ubuntu

Return to Apache

Who is online

Users browsing this forum: No registered users and 10 guests