Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-13-2011, 05:16 PM   #1
LQ Newbie
Registered: Oct 2008
Posts: 11

Rep: Reputation: 0
Backing up httpd.conf on CentOS 5

Please excuse my ignorance but I need to learn how to back up my httpd.conf from my server to my computer and only found one solution via a google search

I typed in locate httpd.conf and see that it resides in /usr/local/apache/conf/httpd.conf so I assume I would type $ cd /usr/local/apache/conf
$ sudo cp -p httpd.conf httpd.conf.bak

I wanted to confirm this with an expert before I do damage that I cannot reverse. Please advise.

WHM 11.28.64
CENTOS 5.5 x86_64 standard
cPanel Version 11.28.64
Apache version 2.2.17
PHP version 5.2.16
MySQL version 5.0.91-community
Architecture x86_64
Operating system linux
Perl version 5.8.8
Kernel version 2.6.18-164.15.1.el5
cPanel Pro 1.0 (RC1)
Old 01-13-2011, 08:22 PM   #2
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 18,396
Blog Entries: 28

Rep: Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801Reputation: 5801
The copy command should work.

I think that httpd.conf is read at httpd startup, so you could probably copy the file while httpd is running without any problems.

After you've run the command, open the copy in an editor to make sure it looks copacectic.
Old 01-13-2011, 09:12 PM   #3
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 891

Rep: Reputation: 119Reputation: 119
That will work just fine. Just a little advice. When you are backing up the original file name it something like with .org extension so you know its the original config file.
Old 01-13-2011, 09:32 PM   #4
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
Dear @OP

My advice, do not alter any config file via konsole since you're using cpanel
because cpanel by mean its controlling everything include the system, eg.
if you break httpd.conf via cpanel then restoring old backup httpd.conf will not work
for your system.

Please run the backup via whm itsel. read this docs-cpanel



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Change of Apache httpd.conf doesn't work on CentOS/RedHat? photonxp Linux - Server 1 07-01-2010 12:12 AM
(CentOS 5.3 server) httpd.conf configuration issue involving DirectoryIndex xshad0wfx Linux - Server 4 06-19-2009 10:32 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
Failed to start apache :Starting httpd: Syntax error on line 1027 of /etc/httpd/conf/ payjoe Linux - Newbie 3 09-21-2007 07:24 AM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:56 AM.

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