tags:

views:

450

answers:

2

I have been attempting to create a new directory for my apache server. As I tried to access the new directory, I type:

sudo /etc/init.d/apache2 restart

But I obtain this error in the Ubuntu Terminal:

Syntax Error on line 1 of /etc/apache2/conf.d/fqdn.save: ServerName takes one argument, the Hostname and port of the server.

As I investigate, the fqdn.save file could not be accessed and is considered unknown. I want to delete this file, but I'm unable to as I believe I need root access.

Does anyone know how to delete this unwanted file in Ubuntu? Or does anyone know how to redirect the apache2 restart to /etc/apache2/conf.d/fqdn (instead of fqdn.save) when I type "sudo /etc/init.d/apache restart" on the terminal

please and thank you

A: 

You need to be inside the group that has permissons to write that file and that would be probably apache and root (both user and group), im not quite sure about the group name of apache in ubuntu but if you are a regular user im afraid you would not be able to just delete the file, ask the system administrator or someone who has permissions over that file.

On the other hand, deleting the file will not work if the init script "apache2" has a link to it, instead you would get probably a different error saying that the file could not be found.

So your problem seems to be that you have the init script of apache trying to access a wrong filename, I believe that the solution is to edit the init script of apache and point it to the right filename and that would be fqdn instead of fqdn.save

Gustavo Rubio
I dont understand why the negative feedback to the comment...
Gustavo Rubio
+3  A: 

You've got sudo; I'm going to assume that's the standard Ubuntu "blanket" sudo that lets you do anything.

Check out what's in the file by doing:

sudo cat /etc/apache2/conf.d/fqdn.save

Make a backup of the file, just in case:

sudo cp /etc/apache2/conf.d/fqdn.save /tmp

Remove the file:

sudo rm /etc/apache/conf.d/fqdn.save

And then at that point you should be able to start the server up...

genehack