LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Websites and where to put them? (https://www.linuxquestions.org/questions/linux-server-73/websites-and-where-to-put-them-639039/)

artgressick 05-01-2008 12:03 AM

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.

BugZRevengE 05-01-2008 12:51 AM

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

kr4mm 05-02-2008 12:56 AM

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.

BugZRevengE 05-02-2008 01:28 AM

Quote:

Originally Posted by kr4mm (Post 3139501)
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.

Bruce Hill 05-14-2008 08:26 PM

Poll: Which OS flavor is better for web servers?

Slackware Linux

SqdnGuns 05-14-2008 08:30 PM

Quote:

Originally Posted by Bruce Hill (Post 3153535)
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.

dguitar 05-14-2008 09:12 PM

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.

Wim Sturkenboom 05-15-2008 12:19 AM

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.


All times are GMT -5. The time now is 04:01 PM.