index.html keeps reappearing

Discussion in 'Installation/Configuration' started by gkovacs, Jan 18, 2009.

  1. gkovacs

    gkovacs Member

    I have a couple of sites running on ISPConfig 3.0.0.8. One problem that bothers me is that the 4 default files in the web/ folder (index.html, favicon.ico, .htaccess and robots.txt) keep reappearing even after being deleted several times.

    What could cause this behaviour and how can I solve this?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you create a own index file in the website? If yes and the files still reappear, please post it to the bugtracker:

    http://bugtracker.ispconfig.org
     
  3. reed

    reed New Member

    index.html issue

    I have the same problem. Running 2.2.29 in SUSE 10.2. I can upload and replace index.html file to the web directory in a newly created site but url resolves to the old index.html file
     
  4. gkovacs

    gkovacs Member

    I did not create an index.html, I have an index.php file, but every 1-2 days (I'm not sure what triggers it) all four original files reappear in the web/ folder.

    It even empties my .htaccess file, but interestingly not with the original one.
     
    Last edited: Jan 28, 2009
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    A index.php file is fine. ISPConfig will not copy the files again if there is a file named index.php, index.htm, index.html etc. The standard index files can be set in the ispconfig interface. Maybe you removed index.php from the list of standard index pages.
     
  6. gkovacs

    gkovacs Member

    Unfortunately, it does. I have an index.php and a .htaccess, and both get overwritten every 2 days.


    Although I don't remember removing index.php from anywhere, exactly where can I find this list of index pages?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then it is most likely not related to ISPConfig as ISPConfig does not put any .htaccess files in the web root of a server, it only adds a .htaccess file to the stats directory. Also there is no cronjob in ispconfig that runs every two days.
     
  8. gkovacs

    gkovacs Member

    I'm POSITIVE it's ISPConfig, since the 4 default files in the web/ folder get copied back, with their original permissions (they show up in green in MC):

    index.html
    favicon.ico
    robots.txt
    .htaccess (0 byte length)

    Also it's not strictly 2 days, it's rougly a couple of days. As I've said, I'm not sure what the trigger is, but it sure doesn't give a damn about my index.php file.
     
    Last edited: Jan 28, 2009
  9. gkovacs

    gkovacs Member

    BTW we use the following .htaccess file:

    Code:
    DirectoryIndex index.php
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]
    RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php
    Is it possible that this fools ISPConfig somehow? Because it seems that after creating this .htaccess will the restoring happen.
     
    Last edited: Jan 28, 2009
  10. falko

    falko Super Moderator ISPConfig Developer

    Can you go to the web site's document root and post the output of
    Code:
    ls -la
    ?
     
  11. gkovacs

    gkovacs Member

    Below is the root of the affected site. If I leave it this way, nothing happens.

    But if I create a .htaccess file with the above content, the copying will happen sometime in the near future (I suspect by cron or after regular ispconfig activity, but usually not the same day).

    Code:
    total 1804
    drwxr-xr-x 36 web19 client3   4096 Jan 29 18:34 .
    drwxr-xr-x  6 web19 client3   4096 Jan 23 06:44 ..
    -rw-r--r--  1 web19 client3  85969 Dec  2  2007 CHANGELOG.php
    -rw-r--r--  1 web19 client3   3429 Dec  2  2007 COPYRIGHT.php
    -rw-r--r--  1 web19 client3   4374 Dec  2  2007 INSTALL.php
    -rw-r--r--  1 web19 client3  17977 Dec  2  2007 LICENSE.php
    ...
    code removed for security
    
     
    Last edited: Feb 1, 2009
  12. falko

    falko Super Moderator ISPConfig Developer

    Permissions look ok. I have no idea what's causing this...
    When the files get replaced, what's in index.html? Is it the ISPConfig welcome page?
     
  13. gkovacs

    gkovacs Member

    Yes, the 3 default files from the ISPConfig site and a 0 byte .htaccess file.
     
  14. falko

    falko Super Moderator ISPConfig Developer

    I have no idea what's causing this. All I can say is that ISPConfig doesn't put a welcome page in the directory if there's an index file in it. You can check that in the function make_docroot() in /root/ispconfig/scripts/lib/config.lib.php.
     
  15. gkovacs

    gkovacs Member

    The copy strikes again

    The copier striked again at 18:19 today on one of our servers, for no reason at all. Overwrote the root folders of a lot of our (operational) domains with the ISPConfig default structure (index.html, robots.txt, favicon.ico and a ZERO byte .htaccess file, plus two folders: error/ and stats/)

    Here is the ISPConfig log of the operation:
    http://testblueray.pannonhosting.hu/log.txt

    (A note of our setup: the dbispconfig database is located on a separate MySQL server, if that affects the operation in any way. Maybe an SQL timeout causes this?)
     
    Last edited: Feb 2, 2009
  16. gkovacs

    gkovacs Member

    We have nailed the ISPConfig problem down (overwriting of user files with the default web/ structure) to most likely be caused by some error in the database code.

    Experience:
    The last unwanted overwriting happened when our MySQL server was down or at least very unresponsive for a couple of minutes.

    Conjecture:
    ISPConfig tries to check a particular site in it's database (maybe from cron?), if it encounters a timeout with MySQL then it initializes the entire site again, copying back the default files and folders, not checking for user index files.


    We are trying to reproduce the problem, but it's not easy to intentionally slow down MySQL without not returning an error.
    Any helpful ideas / insights?
     
  17. falko

    falko Super Moderator ISPConfig Developer

    I've added this to our bugtracker.
     
  18. askibinski

    askibinski New Member

    workaround?

    I can confirm this bug (ispconfig 3.0.1). Seems to happen during a cron run.

    This is a critical bug as it can take down a live site. Any updates on this? (what's the link to this bug in the bugtracker?)

    In the meanwhile, I'm looking for a workaround by removing the default files (which I don't need anyway) all together. I think the config for that would be somewhere in /usr/local/ispconfig/conf ?
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    This has been fixed a long time ago, ISPConfig 3.0.1 is a outdated version, please update to the current release (3.0.1.4)
     
  20. sulfuric

    sulfuric ISPConfig Developer ISPConfig Developer

    same problem ispconfig 3.0.4.2

    drwx--x--- 5 web31 client2 4096 Feb 8 18:39 .
    drwxr-x--x 6 web31 client2 4096 Feb 8 17:48 ..
    -rw-r--r-- 1 web31 client2 824 Feb 8 17:49 arrows.png
    -rw-r--r-- 1 web31 client2 1281 Feb 8 17:49 bullets.png
    -rw-r--r-- 1 web31 client2 1620 Feb 8 17:49 default.css
    drwxr-xr-x 2 web31 client2 4096 Feb 8 17:48 error
    -rwxr-xr-- 1 web31 client2 7358 Feb 8 18:57 favicon.ico
    -rwxr-xr-- 1 web31 client2 26 Feb 8 18:57 .htaccess
    drwxr-xr-x 2 web31 client2 4096 Feb 8 17:50 images
    -rw-r--r-- 1 web31 client2 1877 Feb 8 18:32 index.htm
    -rwxr-xr-- 1 web31 client2 1861 Feb 8 18:57 index.html
    -rw-r--r-- 1 web31 client2 93868 Feb 8 17:50 jquery-1.7.1.min.js
    -rw-r--r-- 1 web31 client2 24996 Feb 8 17:50 jquery.nivo.slider.js
    -rw-r--r-- 1 web31 client2 11561 Feb 8 17:50 jquery.nivo.slider.pack.js
    -rw-r--r-- 1 web31 client2 1737 Feb 8 17:50 loading.gif
    -rw-r--r-- 1 web31 client2 1507 Feb 8 17:50 nivo-slider.css
    -rwxr-xr-- 1 web31 client2 24 Feb 8 18:57 robots.txt
    -rw-r--r-- 1 web31 client2 36094 Feb 8 17:50 slider.png
    drwxr-xr-x 2 web31 client2 4096 Feb 8 17:48 stats
    -rw-r--r-- 1 web31 client2 1979 Feb 8 17:50 style.css

    that's 4 files keep regenerating all minute

    -rwxr-xr-- 1 web31 client2 7358 Feb 8 18:57 favicon.ico
    -rwxr-xr-- 1 web31 client2 26 Feb 8 18:57 .htaccess
    -rwxr-xr-- 1 web31 client2 1861 Feb 8 18:57 index.html
    -rwxr-xr-- 1 web31 client2 24 Feb 8 18:57 robots.txt

    after 3 minuts

    -rwxr-xr-- 1 web31 client2 7358 Feb 8 19:00 favicon.ico
    -rwxr-xr-- 1 web31 client2 26 Feb 8 19:00 .htaccess
    -rwxr-xr-- 1 web31 client2 1861 Feb 8 19:00 index.html
    -rwxr-xr-- 1 web31 client2 24 Feb 8 19:00 robots.txt
     

Share This Page