Recently, we installed Ubuntu Server on our servers this is very new for us. However, we tried to setup a apache2 server which did work. But the problem is that we can't configure apache and other configure files due the lack of permissions. I found a command for some days ago and gave myself access to "/var/www". But that's the only folder I got permissions to. I forgot what the command was and I can't use root because I don't know the password. I can't remember if I tried to setup any. I am the only user on the machine so I got admin permissions but need root. So what I need help with is to give myself access to the whole server. Mostly "/etc/apache2" but the whole server would be better. Anyways, how do I give myself permissions for this and how do I enable root? All sudo commands tells me this " sudo: must be setuid root".
isn't sudo what you're looking for? In Ubuntu, when you want to get root privileges, you must run "sudo command"... or "sudo su" (there is also "sudo -s", and I think the difference is with environment variables, but I don't remember now) if you really want a root session. The password is your user password.
Try to check the owner of the directories... If I remember correctly, in ubuntu, apache creates a user and group of his own, and that only has access to it's own directories.
EDIT: I believe your only way to fix this is to boot with a Linux live disc and mount your Ubuntu file system there to fix the permissions and owner of the sudo binary (and maybe sudoers file). These commands should do it:
sudo chown root:root /mnt/yourfs/usr/bin/sudo sudo chmod 4755 /mnt/yourfs/usr/bin/sudo sudo chown root:root /mnt/yourfs/etc/sudoers sudo chmod 440 /mnt/yourfs/etc/sudoers
The leading 4 in first chmod is to set the setuid special permission: http://docs.oracle.com/cd/E19683-01/816-4883/secfile-69/index.html