LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 08-23-2012, 05:58 PM   #1
elfoozo
Member
 
Registered: Feb 2004
Location: Washington, USA
Distribution: Debian
Posts: 265

Rep: Reputation: 32
What's your methodology for creating Apache based sites?


I'm setting up a small web server and mail server to screw around with. It'll be on a dedicated or VPS.

I've tinkered with these quite a few times in the past but overall it seems like there are at least a dozen ways to carve things up. E.g. where to put the htdocs, whether to make the users homedir dump them straight into htdocs, etc.

Googling around for setting up web sites finds a lot of rudimentary web site building but not much beyond the basics.

So... what's your preferred layout for setting up different virtual directories, or virtual sites? And granting (or not granting) shell access to a few other friends to tinker with their own web sites?
 
Old 08-24-2012, 11:27 AM   #2
lrtward
Member
 
Registered: Feb 2011
Distribution: CentOS, Ubuntu
Posts: 97

Rep: Reputation: 9
I wouldn't have user accounts on a web server, and I certainly wouldn't make their home directory htdocs, unless you want all of them mucking about with your website.

I use CentOS, and instead of htdocs being my web root directory, /var/www/html is where all my "stuff" goes.

Beneath the web root directory, for a small website, I would probably only have two subdirectories: docs and images. In docs I'd place .PDF files and the like. In images I'd put all my images - logos, photographs, bits of images needed for CSS, and so forth.

Some folks like having a css directory with assorted CSS files in it, but I put all of my CSS into one monster file in the root directory (web root - htdocs for you, /var/www/html for me) and load it once and be done with it.

You could also make subdirectories for the major areas of your website. For example, if your website is about pets, you might have subdirectories for dogs, cats, fish, birds, reptiles. Inside each of those subdirectories you could put an index.htm (or index.html or index.php or similar) file, so that visitors to your website would just need to type in "http://my.website/dogs" to get to the section about dogs.

OR if your website is small enough that you only need one page for dogs, don't bother with the subdirectories, and let your users browse to http://my.website/dogs.html or similar. Even if there are 2 or 3 sub-pages to the dogs page, you could leave everything in htdocs and call the pages dogs.html, dog_breeds.html, dog_diet.html, dog_grooming.html and so on.

Basically you just need to think about what you want to accomplish with your site, and what is the most logical and easy to maintain way to go about it. Whatever you decide on, BE CONSISTENT. Otherwise you're getting yourself into a maintenance nightmare on down the road.
 
Old 08-24-2012, 12:51 PM   #3
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
i usually move the 'document root' of my virtual server into the home directory of my limited user account (leaving the default server at /var/www(/html) is fine), this makes it easier to upload files to the site via FTP, especially on a machine to which you have no physical access.
 
Old 09-10-2012, 10:57 AM   #4
lrtward
Member
 
Registered: Feb 2011
Distribution: CentOS, Ubuntu
Posts: 97

Rep: Reputation: 9
Quote:
Originally Posted by frieza View Post
i usually move the 'document root' of my virtual server into the home directory of my limited user account (leaving the default server at /var/www(/html) is fine), this makes it easier to upload files to the site via FTP, especially on a machine to which you have no physical access.
That's a good approach. I go about it backwards - I make my limited user account have 'document root' as his home directory. He can FTP to it, but not ssh. And it's only the one account.

I re-read the original question and the OP said this is just to screw around with, and the accounts are for friends... so with a server like that I would be more lenient. I'd also be prepared to restore from backup or reinstall if things get horribly mangled
 
Old 09-10-2012, 11:36 AM   #5
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Quote:
Originally Posted by lrtward View Post
That's a good approach. I go about it backwards - I make my limited user account have 'document root' as his home directory. He can FTP to it, but not ssh. And it's only the one account.

I re-read the original question and the OP said this is just to screw around with, and the accounts are for friends... so with a server like that I would be more lenient. I'd also be prepared to restore from backup or reinstall if things get horribly mangled
that would work with ONE user, by moving the limited account's home to the 'document' root, then everyone has permission to edit everyone else's stuff (one shared account?)

whereas putting document root(s) in user(s) home directory(ies)
(yes each virtual server can have it's own document root in a separate user's home directory), it prevents the users from accessing each other's stuff, and allows ssh and separate ftp logins.
 
  


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
Methodology of creating bindings for toolkits written in C++ Sergei Steshenko Programming 8 05-30-2012 12:30 AM
How to set up multiple SSL sites for multiple IP based and name based Virtual Hosts. Rohit_4739 Linux - Server 11 02-28-2011 08:28 AM
Prefab - a pixel based methodology to modify virtually any interface! mjolnir General 1 06-16-2010 04:30 AM
LXer: Linux-based website beats Windows-based sites LXer Syndicated Linux News 0 06-21-2007 04:17 AM
Creating Web sites ?? cruse Linux - General 1 01-20-2001 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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