9

I installed server 10.10 with LAMP+OpenSSH. It is about 1.1GB. Can I reduce the total size of the server?

AFTER SOME EXPERIMENTS

The full LAMP server is under 1.0gb

/dev/sda1             7.5G  914M  6.3G  13% /

It contains PHP/Mysql/Apache and Gearman-job-server with PHP support + libFAM

Marco Ceppi
  • 48,101
Arman
  • 364

2 Answers2

5

First off, consider using 32-bits if you are space conscious. The binaries are smaller, as is the memory footprint, and if you have a small disk footprint system, its likely you won't even have 4GB of RAM to take advantage of the 64-bit memory management.

If you just choose the "LAMP Server" task then base system + all of that can be a lot. However, LAMP itself is just Linux, Apache, Mysql, and PHP, so really all you need are the bits to tie those together. That would be:

mysql-server php5-mysql libapache2-mod-php5

Also you can try installing it with --no-install-recommends" which will avoid bringing in things that are normally used, but not absolutely necessary, for the operation of a LAMP site (like SSL, and the php CLI command).

SO you can run

apt-get --no-install-recommends install mysql-server php5-mysql libapache2-mod-php5

When I do this in a 64-bit EC2 10.10 instance I get this:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G  793M   14G   6% /
none                  290M  108K  290M   1% /dev
none                  297M     0  297M   0% /dev/shm
none                  297M   52K  297M   1% /var/run
none                  297M     0  297M   0% /var/lock

And on a 32-bit instance:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G  761M   14G   6% /
none                  294M  108K  294M   1% /dev
none                  298M     0  298M   0% /dev/shm
none                  298M   52K  298M   1% /var/run
none                  298M     0  298M   0% /var/lock

BTW, if you're curious where the space is used up:

sudo du -m /* | sort -rn | head -20

Will show you the top 20 (the numbers are MB of space used)

SpamapS
  • 19,820
  • +1 for the "where's the space gone" command. Thanks! – David Oneill Nov 28 '10 at 15:18
  • Thanks for the nice explanation. I would like to know how can I do this if I use net installation? The apt-get --no-install-recommends does not uninstall the already installed packages... – Arman Nov 29 '10 at 08:10
0

LAMP server when compressed is of about 65 MB.It's about 200 MB when uncompressed.I am talking about the LAMP that the XAMMP people provide.UBUNTU installes a lot of stuff that it is considering to belong to the base... by taking away manually packages you get it down more...Sure,you can remove unnecessary libraries as long as you know what you do.You need to check what program depends on them and if you need those programs.if you have a library in ubuntu,it is because of a dependency..

karthick87
  • 81,947