Recently, I set up /etc/apache2/apache2.conf on Ubuntu Linux 16.04 so that an web browser user can run with any browser as long as we run one mod_mono_server4 server and 1 or more apache2 service instance.

From this article:

Consider a web browser which attempts to load a page while the network is unavailable. The browser will receive an error code indicating the problem, and may display this error message to the user in place of the requested page. However, it is incorrect for the browser to place the error message in the page cache, as this would lead it to display the error again when the user tries to load the same page - even after the network is back up. The error message must not be cached under the page's URL; until the browser is able to successfully load the page, whenever the user tries to load the page, the browser must make a new attempt.

A frustrating aspect of negative caches is that the user may put a great effort into troubleshooting the problem, and then after determining and removing the root cause, the error still does not vanish.

How should I set up /etc/apache2/apache2.conf on Ubuntu 16.04 so that the error message must not be cached under the page's URL?

Here is my current /etc/apache2/apache2.conf on Ubuntu 16.04":

DocumentRoot "/home/vendors/DevelopmentX64/My-Web-App/My-Web-App"

ServerName localhost LoadModule mono_module /usr/lib/apache2/modules/mod_mono.so

<Directory /home/vendors/DevelopmentX64/My-Web-App/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted </Directory>

Alias "/" "/home/vendors/DevelopmentX64/My-Web-App/My-Web-App"

AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd MonoApplications "/:/home/vendors/DevelopmentX64/My-Web-App/My-Web-App"

Any help is sincerely welcome and appreciated.

  • I have an answer – Frank Aug 7 '16 at 23:13
  • I made a mistake in saying I have an an answer. – Frank Aug 9 '16 at 0:26
  • Have you thought about using <Location> directives with mod_headers to send headers that disable browser cache for the page? Would that not apply in your setup? (I'm unfamiliar with programs running under mono and your web app's URL setup) – m32 Aug 9 '16 at 5:33
  • @m32, Thank you for your very clever suggestion. I will try it at 3:45 A.M this morning and let you know my findings. Is that allright with you? How do I activate or install the apache module mod_headers? – Frank Aug 9 '16 at 6:25
  • @m32, How do our architect and I use the AliasHost and PCRE regular expression only without interference from the MonoApplication key value pair? Thank you very much. – Frank Aug 9 '16 at 7:30

I used apache server's AliasMatch feature to match a PCRE regular expression as $1.aspx preceded by the DocumentRoot, /home/venkat/DevelopmentX64/HVR-Web-App/HVR-Web-App. Here are my changes to /etc/apache2/httpd.conf or apache2.conf

AliasMatch \.(aspx|jpg|gif|png)$  /home/venkat/DevelopmentX64/HVR-Web-App/HVR-Web-App$1.aspx

MonoDebug true
MonoAutoApplication disabled
AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd
MonoApplications "/:/home/venkat/DevelopmentX64/HVR-Web-App/HVR-Web-App"
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers       4
MinSpareServers    3
MaxSpareServers   10
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  10000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.