LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   apache2 help -Virtual Host- (https://www.linuxquestions.org/questions/%2Absd-17/apache2-help-virtual-host-330395/)

Fredstar 06-04-2005 04:54 PM

apache2 help -Virtual Host-
 
Im in the process of setting up three virtualhost sites with apache 2 on freebsd 5.4.

Normally ( on linux )

I would just creat a group and user , for example www (user) and users (group)

Then in the home directory of the new users www i would set-up the site architect as followed

users -www
/home/www/


--site one
/home/www/site1
/home/www/site1/html <--web files
/home/www/site1/cgi-bin <--virtual cgi-bin

--site two
/home/www/site2
/home/www/site2/html
/home/www/site2/cgi-bin

site-three
/home/www/site3
/home/www/site3/html
/home/www/site3/cgi-bin

And the httpd.conf file looks like this

<VirtualHost *>
ServerName site1.com
DocumentRoot /home/www/site1/html
VirtualScriptAlias /home/www/site1/cgi-bin
</VirtualHost> <--this two more times with the updated name,document root etc.

Now everytime i try to view site1 i get a forbidden error message which leades me to believe that i had to chmod it down. so naturally i do.

chmod 755 /home/www/site1/html

*however that does not fix it

so i tried to play around with the ownership with chown, but still no go. Any clue on what permission + owner/group the folders need to be so i can view my web content via the web?

david_ross 06-05-2005 02:24 PM

Are you running in a chrooted environment?

Are there any messages in the error_log file?

Fredstar 06-05-2005 07:48 PM

Yes, the error in the error log is

Client Denied by server Config : /home/www/site1/html
Client Denied by server Config : /home/www/site1/html/favico.ico


Im searching around my .conf file to see if there is something i need to enable. No i do not believe im running a chrooted environment. So far its the basic install with apache2 nothing else modified but the httpd.conf and user/and directories of sites

david_ross 06-06-2005 12:33 PM

Could you post a copy of httpd.conf.

sigsegv 06-06-2005 01:09 PM

For permission bits -- You need at least 4 on files and 1 on directories (and the directories leading to that directory).

The user/group can be anything you want, but I normally do owner to the user's login name, and then group to the group apache runs as (normally www). That way you can just do a 750 recursively at the top level home directory.

Also, at the risk of pointing out the obvious -- If you don't have +Indexes in your config someplace for the vhosts (or serverwide) you'll need an index.html or you'll get 403'd.


All times are GMT -5. The time now is 02:12 PM.