LinuxQuestions.org
Visit the LQ Articles and Editorials section
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



Poll: Which OS flavor is better for web servers?
Poll Options
Which OS flavor is better for web servers?

You must log in and have one post to vote in this poll. If you don't have an account, you can register here.
Results will be available after the polls close.

The nominees are:

Fedora 8/9
CentOS 5
RedHat ES5.1
Debian

Reply
 
Search this Thread
Old 05-01-2008, 01:03 AM   #1
artgressick
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
Websites and where to put them?


Hello,

I know this is probably a stupid question but where should I put all of my virtual host sites on a Fedora 8/9 system. I own all of the sites my self and not partitioning them out to other people. Here is an example...

I noticed that the default system has 1 website listed in /var/www/html/. I want to add the following sites to the system...

www[dot]site1[dot]com
www[dot]site2[dot]com
www[dot]site3[dot]com

Of course I want to use the same IP address and just have them setup using the virtual host which I know how to do that. Should I put them in the following place on my OS..

/var/www/html/site1_root/
/var/www/html/site2_root/
/var/www/html/site3_root/

Also when I add these should I setup the permission to be under the www user or kep them under another user account just incase. Any help would be greatly appreciated as once I get past this hurdle then I can test them all out on my server and then launch them to the world.
 
Old 05-01-2008, 01:51 AM   #2
BugZRevengE
Member
 
Registered: Oct 2005
Location: Australia
Distribution: Slackware & Kubuntu & CentOS
Posts: 106

Rep: Reputation: 17
put your sites in /var/www/html/site1, site2, site3 etc... then edit your /etc/apache.conf (and assocated include files) to setup your root as /var/www/html/site1, and other sites as virtual hosts under site2, site3 no problems with that, and easy to do - we do it at work.

the permissions need to be read-only for the www user as this is the user apache runs as, but writable by someone else (the user who maintains them) If you maintain all sites, the same user is fine, but if maintained by others, create them a user and put the virtual host root under their /home directory.

Do not let the www user have write access to the files - only read (unless it is a data area written to by the webserver (such as images dir for a photo-album that has upload)).
My files are
owner group permissions filename
root root rw_r__r__ index.php
so www can read (world readable), but only root user can edit.

Hope this helps, please feel free to ask more if you need

Last edited by BugZRevengE; 05-01-2008 at 01:52 AM. Reason: my delimiators were colons, but they turned into a smiley - so they are spaces
 
Old 05-02-2008, 01:56 AM   #3
kr4mm
LQ Newbie
 
Registered: May 2006
Location: Atlanta, GA
Distribution: Fedora, Slackware, Mandriva, Redhat Enterprise
Posts: 1

Rep: Reputation: Disabled
the most common location I've seen for websites is:

default site (can be accessed by ip):
/var/www/html

virtual hosts (accessed by proper url, only):
/var/www/vhost/site1.com
/var/www/vhost/site2.com

Apache runs as user 'apache' and each vhost directory is owned by a shell user used to ftp to that directory as its home directory. Be sure each user's shell is set to /sbin/nologin to keep them from accessing ssh.
 
Old 05-02-2008, 02:28 AM   #4
BugZRevengE
Member
 
Registered: Oct 2005
Location: Australia
Distribution: Slackware & Kubuntu & CentOS
Posts: 106

Rep: Reputation: 17
Quote:
Originally Posted by kr4mm View Post
Apache runs as user 'apache' and each vhost directory is owned by a shell user used to ftp to that directory as its home directory. Be sure each user's shell is set to /sbin/nologin to keep them from accessing ssh.
You might want to give them ssh access so they can connect over KDE's fish protocol (ssh). This is a nice to use rather then ftp as it is more secure. Otherwise you should use sftp, or passwords are transmitted in plain text!
You can restrict a user to not be able to more outside of their home directory (website), and restrict what commands they have.
 
Old 05-14-2008, 09:26 PM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
Poll: Which OS flavor is better for web servers?

Slackware Linux
 
Old 05-14-2008, 09:30 PM   #6
SqdnGuns
Member
 
Registered: Aug 2005
Location: Fountain Valley, CA / Thailand
Distribution: Slackware64 14.0
Posts: 981

Rep: Reputation: 88
Talking

Quote:
Originally Posted by Bruce Hill View Post
Poll: Which OS flavor is better for web servers?

Slackware Linux
^ ^ ^ ^ Agreed

Poll is flawed..............many many more distros.

Glad to see you back Bruce, was getting a bit concerned because of the earthquake.

Last edited by SqdnGuns; 05-14-2008 at 09:32 PM.
 
Old 05-14-2008, 10:12 PM   #7
dguitar
Member
 
Registered: Jun 2005
Location: Portland, ME
Distribution: Slackware 13, CentOS 5.3, FBSD 7.2, OBSD 4.6, Fedora 11
Posts: 122

Rep: Reputation: 17
Agreed on the flawed poll... a better poll might be which web server you use - apache, lighthttpd, roxen, and a few others I can't seem to remember off the top of my head. Still a little pointless since personal preference.

Apache doesn't care what OS(or distro) you are running it on, in reality.
 
Old 05-15-2008, 01:19 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
As well: where is Slackware in the poll?

I always place the websites in the home directory of the user. If it's only one user, he can still have multiple websites. Just point the document root in the virtual host to the correct directory.

Reason: I don't have to think about ftp access

Disavantage: apache can not write there, so the user has to create a subdirectory where apache has write access.
 
  


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
Can ping websites, can visit websites with ip address, cannot visit with Web address TheGeneralsLounge Linux - Networking 2 03-29-2007 03:07 AM
C++ websites metallica1973 Programming 2 05-13-2006 02:03 PM
Websites that sell websites..? mScDeX General 2 12-29-2003 04:01 PM
websites zipporah General 23 08-06-2003 03:13 AM
Websites? Nephlite Linux - Newbie 2 01-31-2002 02:23 PM


All times are GMT -5. The time now is 01:09 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