Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Mar 30, 2013

siwapp :: File does not exists error


We tested siwapp application, which is an opensource invoicing application, but we had some problems, the error log was full of these:



[Sat Mar 30 17:32:55 2013] [error] [client xx.xx.xx.xx] File does not exist: /home/invoice/web/invoices

The site seemed to work fine otherwise.

It seemed that there was a problem with the app's .htaccess.

The main problem was here:
RewriteCond %{REQUEST_URI} \..+$
which matches all files with a dot in the filename, but the rule was ment to match files that start with a dot.

The fix for this is:
RewriteCond %{REQUEST_URI} /\..+$

After that fix, the app created errors because of a request for favicon.ico.
Well, the fix for that is simple enough
RewriteRule .+/favicon.ico$ favicon.ico [L]

So the whole .htaccess looks like this:
Options +FollowSymLinks +ExecCGI -MultiViews

AddDefaultCharset utf-8 

 
    Order deny,allow
    Deny  from all
 

 
    Order deny,allow
    Deny  from all
 


  RewriteEngine On

  # Rule to test if rewrite module is available during
  # the install process
  RewriteRule test_rewrite1\.txt test_rewrite2.txt
  
  RewriteRule .+/favicon.ico$ favicon.ico [L]

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  RewriteCond %{REQUEST_URI} /\..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule (.*) index.php [L,QSA]

Feb 28, 2012

Apache :: Could not determine fully qualified domain name


Error message:

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName


Is preety much self-explanatory

Add this
ServerName localhost

In your server configuration file.


Apache :: VirtualHost overlap on port

Errors like


[warn] _default_ VirtualHost overlap on port 443, the first has precedence

are caused because the virtualhosts are not named.
(The same applies for any other port, for example 80)

Add this in your apache configuration file

NameVirtualHost *:443


In Ubuntu server, Linux, that configuration is actually located in the ports.conf file in /etc/apache2.


NameVirtualHost *:80
NameVirtualHost *:443


Listen 80