Limit size of the file

How do I limit size of a file to 1 MB or something like that under Linux?

Check out the man page for limit or ulimit. You can set this in /etc/default/login for all users.

The file is on my webserver and users can add stuff into it, and I need to limit the size. I don't have that much access to system.

What webserver are you using (and version)? Do you have admin rights to change the webserver configuration files?

Apache, and I don't have admin rights, although I can ssh into the server.