etc/hosts file gone . .

Joined
Jul 24, 2012
Messages
50
Reaction score
0
Points
6
Your Mac's Specs
iPhone 4s | iPad 2 | 21.5" iMac 2.7GHz 1TB
Hi,
I have been trying to install glassfish since monday. Its a server so i can create some java servlets with.
I kept getting an error when i tried to start my domain on the server saying port 4848 was in use.
No idea why, as the port wasnt in use. I did some research and found people suggesting to look in the etc/hosts file and see if the hostname was binding to the IP Address . . . .
I had a look, didnt really understand it and closed it again.
i realised in terminal that it then said null where it usually says my-imac.
I went back into the file, realised i had typed a character after localhost on the first line.
Removed that and i am pretty sure i added a space after local host. Anyway where in terminal it usually said my-imac it now said My-iMac with capital letters . . . .
I thought this was odd but tried to start the server again and bingo! it started running no problem without the error saying the port was in use.
The computer has been on all day in that state with capital letters for My-Imac in terminal.
I knew i would have to shut down the computer at some point so i have just done that to see if i could still run the server. After a full shut down, i started the machine back up and in terminal it said null again! i tried to start the server and it said the port was in use yet again. I tried to go into the etc/hosts file to have a look. sudo nano etc/hosts and all i get is the blank terminal screen with the nano interface with the shortcuts at the bottom. The screen my etc/hosts file displayed in before, but this time with nothing inside!! I did a restart and in terminal i now have my-imac in lowercase. Could someone tell me why i cant see my etc/hosts file anymore and what would cause my-imac to add capitals and subsequently make my server work . . .
I realise this post is probably quiet long but i really would like some help/answers so i could continue with my work.
Thank you
 
Joined
Nov 2, 2011
Messages
164
Reaction score
10
Points
18
Location
Western NY
Your Mac's Specs
late 2011 mac Mini, 2.3 GHz core i5, 8 GB 1333 MHz DDR3, Sierra, Retina display iPad, Iphone 5S
Try sudo nano /etc/hosts In your description above, you are leaving off the leading /. If you type sudo nano etc/hosts, you get exactly as you describe.

Bill
 
OP
W
Joined
Jul 24, 2012
Messages
50
Reaction score
0
Points
6
Your Mac's Specs
iPhone 4s | iPad 2 | 21.5" iMac 2.7GHz 1TB
Thanks, that did work to bring the hosts file up.
When i logged on this morning in terminal i had the capital letters again and the server started . . . .no idea what was wrong last night after i restarted it.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top