0

I am trying to restart my Apache but I keep getting this error:

Jan 28 20:34:05 localhost systemd[1]: apache2.service: Failed with result 'resources'.
Jan 28 20:36:22 localhost systemd[1]: apache2.service: Failed to run 'start' task: No space left on device
Jan 28 20:36:22 localhost systemd[1]: Failed to start The Apache HTTP Server.
Jan 28 20:36:22 localhost systemd[1]: apache2.service: Failed with result 'resources'.
Jan 28 20:37:37 localhost systemd[1]: apache2.service: Failed to run 'start' task: No space left on device
Jan 28 20:37:37 localhost systemd[1]: Failed to start The Apache HTTP Server.
Jan 28 20:37:37 localhost systemd[1]: apache2.service: Failed with result 'resources'.
Jan 28 20:45:03 localhost systemd[1]: apache2.service: Failed to run 'start' task: No space left on device
Jan 28 20:45:03 localhost systemd[1]: Failed to start The Apache HTTP Server.
Jan 28 20:45:03 localhost systemd[1]: apache2.service: Failed with result 'resources'.

I have tried this solution but it does not work:

fs.inotify.max_user_watches = 262144 (Add this to /etc/sysctl.conf and then run sysctl -p.)

This is some more info if it helps?

sudo df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        20G   20G     0 100% /
devtmpfs        488M     0  488M   0% /dev
tmpfs           490M     0  490M   0% /dev/shm
tmpfs           490M   51M  440M  11% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           490M     0  490M   0% /sys/fs/cgroup
tmpfs            98M     0   98M   0% /run/user/0

Any ideas what I can do?

EDIT:

There is no solution from this answer. How is this duplicated?

Run
  • 2,639
  • 2
    '/' is full, so you have to hunt down the biggies. /var/log would be the place to start. – xenoid Jan 28 '19 at 21:21
  • @xenoid how do i inspect /var/log and delete files? – Run Jan 28 '19 at 22:06
  • I had a similar problem on this line IncludeOptional /etc/apache2/conf.d/*.conf in the file /etc/apache2/default-server.conf the problem was /etc/apache2/conf.d/pgadmin4.conf, uninstaling pgadmin4 the problem was solved. meybe your situation is similar. – Eliut Islas Aug 14 '19 at 18:48
  • Similar situation here: https://askubuntu.com/questions/1030180/apache-2-syntax-error-on-line-225-of-etc-apache2-apache2-conf – Eliut Islas Aug 14 '19 at 18:52
  • @EliutIslas there's nothing similar there. You linked to a question about a syntax error in the apache config. The issue here is that the / partition is 100% full, so nothing will work until files are deleted. Apache is just the first thing that complained to the OP, the issue isn't really related to apache though. – terdon Aug 16 '19 at 13:29

2 Answers2

1

Your disk is full. You need to delete some files.

roadmr
  • 34,222
  • 9
  • 81
  • 93
  • What and how should I delete? – Run Jan 28 '19 at 21:25
  • https://www.cyberciti.biz/faq/check-free-space/ There are GUIs that allow you to get a picture of what is taking up all the space. –  Jan 28 '19 at 21:30
  • thanks. still no clue what to delete. i barely use this hosting server. how is it running out space? – Run Jan 28 '19 at 22:03
1

So your disk is full...

Without a GUI, do du -m / | sort -n and the last lines are going to be the bigger directories. Typically you are looking for:

  • logs accumulating in /var/log and its subdirectories. The system doesn't need them, and you can erase the oldest (or better set up cron job or services to perform log rotation).
  • random files created in /tmp (can usually be erased on sight if nothing is running)
  • a bloated database /var/lib/mysql/*. Don't erase them directly, inspect the DB for figure out where this comes from, and if necessary use the DB system to truncate the relevant tables.
  • random files created as uploads in /var/www (or wherever the Apache content directory is)
  • random files created elsewhere, but this would be server specific.

These last two require to understand why they are created and whether you can erase them.

But of course this can happen again unless you add periodic script/services to remove these excess files.

xenoid
  • 5,504