Friday, October 23, 2009

Apache: Giving Users their Own URL

Exploring more on Apache and continuing with my Cookbook, I started with this topic and set it up in just 5 minutes. This time I tried setting up webpage for all users and this is what I finally got it working !!!

File: /etc/httpd/conf/httpd.conf

Line 352:
UserDir public_html

And remove the hash sign:

368 AllowOverride FileInfo AuthConfig Limit
369 Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
371 Order allow,deny
372 Allow from all

375 Order deny,allow
376 Deny from all



Restart the Apache Service.

Try Browsing : http://localhost/~ajeet
But it wont work.

Reason: Permission Issue

Create few users like ajeet, john, eric etc

#useradd ajeet
#passwd ajeet
#cd /hom/ajeet
#mkdir public_html
#cd public_html
#mkdir {ISO1,ISO2,ISO3)

Grant Permission:

#chmod o+x /home /home/ajeet
#chmod o+x /home/ajeet/public_html

Try Browsing http://localhost/~ajeet

Index of /~ajeet
[ICO] Name Last modified Size Description
[DIR] Parent Directory -
[DIR] ISO/ 23-Oct-2009 23:11 -
[DIR] ISO2/ 23-Oct-2009 23:11 -
[DIR] ISO3/ 23-Oct-2009 23:11 -
Apache/2.2.11 (Fedora) Server at localhost Port 80

So User can have their own Webpage.
Happy Apaching !!!

No comments:

Post a Comment