Pick a Free OS

User login

Navigation

Web server tutorial - Part 3

Deny from all

</Limit>

</Directory>

Remember this directives are basically attached with " " so remove as shown above

Now, do the following:

example

1) adduser kshounish

2) passwd kshounish

3) exit


login:kshounish

password:*******


4)$ mkdir public_html

5)$cd public_html

6)$vi index.html

And write the code

<html>

see the virtual login hosting


<form method=post action=/cgi-bin/b.pl>

<input type=submit>

</form>

</html>


7)$cd /home/httpd/cgi-bin/

8)$vi b.pl


And write


#!/usr/bin/perl

print "Content-type:text/html nn";

print "

welcome in my virtual site

";

print "you have accessed through $ENV{REQUEST_METHOD}"; print"

hope u visit again

";


Now go to Netscape and say

http://kshounish1.linux.com/~kshounish/ or say `$lynx http://192.192.192.2/~kshounish'. It will take you to /home/kshounish/public_html/index.html. Do it for other logins too.

Hosting in Virtual Domain

This is the actual way of hosting Web pages. In first case the way of accessing was < a href=http://kshounish1.linux.com> http://kshounish1.linux.com

In second case it was < a href=http://kshounish1.linux.com/~kshounish> http://kshounish1.linux.com/~kshounish


But what if you want goldie.linux.com and sudhir.linux.com in the same machine? Then there are two ways of hosting:

Shared hosting: In this technique, multiple sites are placed in same IP address of same machine.

Independent hosting: In this case each site will have independent IP on the same Ethernet card of same machine.


For Shared Hosting the directive you need is NameVirtualHost 192.192.192.1


<VirtualHost 192.192.192.1>

DocumentRoot /docfile

ServerName goldie.linux.com

ErrorLog logs/err

</VirtualHost>