Apache22 {freebsd} using home directory

Posted: August 5, 2010 in Freebsd

Enable home directory on apache2

This guide is based on apache22 freebsd

bsd#cd  /usr/local/etc/apache22/

bsd# pico httpd.conf

search for # User home directories and remove #

before

#—————————————————————

# User home directories
#Include etc/apache22/extra/httpd-userdir.conf
#—————————————————————

After

#—————————————————————

# User home directories
Include etc/apache22/extra/httpd-userdir.conf
#—————————————————————

and configure the httpd-userdir.conf

bsd# cd  /usr/local/etc/apache22/extra/

bsd# pico httpd-userdir.conf

#############################################

<Directory “/home/change_me/public_html”>

AllowOverride FileInfo AuthConfig Limit Indexes

Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

<Limit GET POST OPTIONS>

Order allow,deny

Allow from all

</Limit>

<LimitExcept GET POST OPTIONS>

Order deny,allow

Deny from all

</LimitExcept>

</Directory>

## cgi-bin

<Directory “/home/change_me/cgi-bin”>

Options +ExecCGI

</Directory>

#############################################

bsd# cd /home/change_me/

make folder for web

bsd# mkdir public_html

bsd# mkdir cgi-bin

add user to group www

bsd# pw useradd change_me -G www

chown folder to new user and group

bsd# chown change_me:www public_html/  cgi-bin/

bsd# /usr/local/etc/rc.d/apache22 restart

test your web using

http://your_domain.com/~change_me/

if your dont trust your friend “change_me” than please use freebsd_ jail

Comments
  1. Holms says:

    thnx for tutor =)

    but it’s not pw useradd, it’s pw usermod!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s