LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-21-2014, 10:16 PM   #1
TawClaw
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Rep: Reputation: Disabled
How do I save changes in the apache2.conf file?


Hello all!

I'm having trouble figuring out how to save changes inside files opened in the terminal.

Specifically, I am trying to add "ServerName localhost" to my apache2.conf file, but I don't know how to save things in the terminal.

I found a solution on this site that said to hit escape then type :wq then hit enter, but that did not work. It gave me an error message that said the command was not recognized, and my wq showed up as text in the file alongside "localhost" indicating that it was not actually executing it as a command.

Anything I am missing here? Thanks for any help! I am using Linux for the first time to make a website using html/css/php/sql/java for my senior project (I am in highschool) so any bit of information would be much appreciated!
 
Old 12-21-2014, 10:42 PM   #2
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
Which editor are you using to modify the file? ":wq" is specifically for vi/vim, so if you're using a different editor, that won't work.
 
Old 12-21-2014, 11:35 PM   #3
TawClaw
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ndc85430 View Post
Which editor are you using to modify the file? ":wq" is specifically for vi/vim, so if you're using a different editor, that won't work.
I'm not actually sure, I am using whatever the default is when I run the command "$ sudo nano /etc/apache2/apache2.conf" in the terminal. The terminal then changes into a new terminal window, with some information on it. The top says: GNU nano 2.2.6 File: /etc/apache2/apache2.conf -that is all I know.
 
Old 12-22-2014, 12:01 AM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
It means you are using nano console text editor. For saving you have to press keys CTRL-x simultaneouly or one after another quickly. It will show dialog for filename or path with filename to save there.
 
Old 12-22-2014, 12:16 AM   #5
TawClaw
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
It means you are using nano console text editor. For saving you have to press keys CTRL-x simultaneouly or one after another quickly. It will show dialog for filename or path with filename to save there.
It worked, thank you so much for helping me!

Now I also know what sudo means and that it is a console text editor. I will use this as a learning experience so I won't need to ask a question like this again.

Cheers to both of you who helped!
 
Old 12-22-2014, 12:23 AM   #6
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
No. Nano is the text editor. sudo is used to give you elevated privileges - with your regular user account, you can't edit files in /etc, so you use sudo to let you run nano with privileges that allow you to modify the file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to save conky.conf file... have a peek :) gunzzz5930 Slackware 4 02-06-2014 04:58 AM
[SOLVED] Default apache2 /sites-available/000-default and apache2.conf nobuntu Linux - Server 3 02-06-2013 11:05 AM
apache2 - which conf file to use ? uncle-c Linux - Server 11 01-09-2013 07:57 PM
Should I include srm.conf in httpd.conf in apache2? xpucto Linux - Software 3 02-16-2006 08:16 AM
saving changes to apache2/conf/httpd.conf file Zaius Linux - Newbie 6 01-09-2004 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration