LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 11-21-2008, 08:57 AM   #1
Ascendancy5
Member
 
Registered: Oct 2008
Posts: 40

Rep: Reputation: 15
CentOS Web Server - Where to Keep Website Files


I am trying to set up a web server running CentOS 5, and I've already installed the PHP, Apache, and MySQL packages. However the files for the Apache server are installed in /var/www/html, which seems like a strange folder to keep the files in. On an account I have for web hosting elsewhere, whenever I FTP in my default folder is in /home/, so I'm not sure if that is the "normal" place to keep website files when running a server or not, but I'm just curious about it.
 
Old 11-21-2008, 09:50 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,105

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
Quote:
Originally Posted by Ascendancy5 View Post
I am trying to set up a web server running CentOS 5, and I've already installed the PHP, Apache, and MySQL packages. However the files for the Apache server are installed in /var/www/html, which seems like a strange folder to keep the files in. On an account I have for web hosting elsewhere, whenever I FTP in my default folder is in /home/, so I'm not sure if that is the "normal" place to keep website files when running a server or not, but I'm just curious about it.
FTP is different from web, and they use different config files. The /var/www/html is fairly "normal", for alot of distros, but easily changed. Look for the DocRoot directive in your apache config, and change it to be whatever you'd like, if you want to move things.

NOTE: I *THINK* it's DocRoot...might be DocHome...not in front of my box now.
 
Old 11-21-2008, 09:53 AM   #3
brianmcgee
Member
 
Registered: Jun 2007
Location: Munich, Germany
Distribution: RHEL, CentOS, Fedora, SLES (...)
Posts: 399

Rep: Reputation: 38
Have a look in the Linux Standards Base [1]. There are more possibilities to place the www root.

I prefer to place the files in /srv/www/ and link it to /var/www/html. As I also like to place files on a server in the default directory. So another admin has no difficulties to find the files.

[1] http://www.linuxfoundation.org/en/LSB
 
Old 11-21-2008, 11:22 AM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
As TB0ne said it's fairly normal to be here, Since I have a CentOS server I can say it's DocumentRoot and the config can be found at /etc/httpd/conf/httpd.conf. As already stated FTP is different, it's always possible to create an account that opens on a folder within the DocumentRoot. However myself, I use a folder within home for the purpose of SCP (much safer then FTP) and a couple of small script to copy files to where I generally place uploaded files too.

P.S. I normally back-up httpd.conf before I have to edit it, very easy to break it and apache is likely to complain like crazy if anything is wrong.

Last edited by r3sistance; 11-21-2008 at 11:25 AM.
 
Old 11-21-2008, 11:37 AM   #5
Ascendancy5
Member
 
Registered: Oct 2008
Posts: 40

Original Poster
Rep: Reputation: 15
Well I have worked with httpd.conf before, as I've worked with Apache on Windows for around 2-3 years now, I just haven't ever used it on Linux so i wasn't sure what the "norm" was for setting up an Apache server, but if the default directories work then I think I'm all set!
 
Old 11-21-2008, 01:39 PM   #6
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,105

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
Quote:
Originally Posted by Ascendancy5 View Post
Well I have worked with httpd.conf before, as I've worked with Apache on Windows for around 2-3 years now, I just haven't ever used it on Linux so i wasn't sure what the "norm" was for setting up an Apache server, but if the default directories work then I think I'm all set!
As with most things in life...'normal' is a matter of opinion...
 
  


Reply


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
Web Server setup- CentOS 5.2 64-bit jwinstallations Linux - Server 3 08-31-2008 04:25 PM
Host website on non-web server ubuntu solarbike Linux - Server 1 03-09-2008 09:40 PM
Unable to access to a website on apache web server bisbane Linux - Networking 3 07-11-2001 10:18 AM
Unable to access to a website on apache web server bisbane General 3 07-10-2001 12:03 PM
remote access to a website on apache web server bisbane Linux - Newbie 0 07-09-2001 07:24 PM


All times are GMT -5. The time now is 01:58 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration