21

My Ubuntu vitual server wen't offline. I rebooted it and now want to debug what happened.

I can browse to /etc/log but if I try cd apache2 it says Permission denied. I'm sure my user account has priviliges. I also tried sudo cd apache2 which gives the the error sudo: cd: command not found

How can I access the apache logs? I also tried via sftp without success

PS I am new to linux and virtual servers, but I am keen to learn everything I can.

S..
  • 383
  • 1
  • 3
  • 12

3 Answers3

39

You need to add your username to the group adm

sudo usermod -aG adm YourUserName

You can then access the logfiles as normal user without sudo.

Evenbit GmbH
  • 4,598
  • 4
  • 23
  • 33
6

Try:

sudo cat /var/log/apache2/error.log
wojox
  • 11,152
  • 5
  • 40
  • 60
  • Thanks wojox, but is there a more permanent solution? Like being able to navigate to the apache2 folder? – S.. Feb 16 '14 at 16:13
2

You can log in as root user:

sudo su

And then you are able to do:

cd apache2
david
  • 121
  • 3