Score:0

Serving webpage in different language based on HTTP headers, using Apache negotiation module - shows dir listing only

jp flag

I would like to configure Apache, such that when we send a request with a given language header, the server should send us back the right version. For example, I have index.eng.html and index.de.html. Based on the HTTP header, server should send me the proper version. I want to make it inside a Docker container.

Now the only thing I see is the directory listing ... What is wrong?

# Use the official Apache base image
FROM httpd:latest

# Install required Apache modules
RUN apt-get update && apt-get install -y apache2

# Enable necessary Apache modules
RUN a2enmod negotiation

# Copy the content files to the appropriate directory
COPY index.eng.html index.de.html index.pl.html /usr/local/apache2/htdocs/

# Append the configuration directly to the Apache configuration file
RUN echo "LoadModule negotiation_module modules/mod_negotiation.so" >> /usr/local/apache2/conf/httpd.conf
RUN echo "LanguagePriority en pl de" >> /usr/local/apache2/conf/httpd.conf
RUN echo "ForceLanguagePriority Prefer Fallback" >> /usr/local/apache2/conf/httpd.conf

EXPOSE 80

# Remove the default index.html file
RUN rm /usr/local/apache2/htdocs/index.html

# Start Apache in the foreground
CMD ["httpd", "-D", "FOREGROUND"]
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.