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. |
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 |
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. |
Quote:
You can restrict a user to not be able to more outside of their home directory (website), and restrict what commands they have. |
|
Quote:
Poll is flawed..............many many more distros. Glad to see you back Bruce, was getting a bit concerned because of the earthquake. |
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. |
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. |