How to add Virtualhost Apache2 on Ubuntu Linux Server

HowtoaddVirtualhostApache2onUbuntuLinuxServer(BeginnersGuide)

byBikramKawan0

*VirtualHost

*VirtualHosting

*Includes

*Defaults

*Createawebsite

*Subscriber

apache2virtualhostaddubuntulinuxApacheisthemostcommonlyusedwebserversonmanyLinuxMachines.ForhostingmultiplewebsiteonsameserverweneedtocreatevirtualhostonLinuxMachine.BelowarestepsIhaveimplementedonmywebserverusingUbuntu10.04LinuxMachine.

Gotosite-availabledirectoryby:

cd/etc/apache2/sites-available

Nowcopydefaulttoanotherfilename

ForE.g.

cpdefaultbikramkawan

Nowadd/Updatecertainparameterforyourdocumentrootasbelow.

<VirtualHost*:80>

[email protected]

ServerNamebikramkawan.com.np

DocumentRoot/var/www/bikramkawan

<Directory/>

OptionsFollowSymLinks

AllowOverrideNone

</Directory>

<Directory/var/www/bikramkawan>

OptionsIndexesFollowSymLinksMultiViews

AllowOverrideNone

Orderallow,deny

allowfromall

</Directory>

ScriptAlias/cgi-bin//usr/lib/cgi-bin/

<Directory“/usr/lib/cgi-bin”>

AllowOverrideNone

Options+ExecCGI-MultiViews+SymLinksIfOwnerMatch

Orderallow,deny

Allowfromall

</Directory>

ErrorLog/var/log/apache2/error.log

#Possiblevaluesinclude:debug,info,notice,warn,error,crit,

#alert,emerg.

LogLevelwarn

CustomLog/var/log/apache2/access.logcombined

Alias/doc/“/usr/share/doc/”

<Directory“/usr/share/doc/”>

OptionsIndexesMultiViewsFollowSymLinks

AllowOverrideNone

Orderdeny,allow

Denyfromall

Allowfrom127.0.0.0/255.0.0.0::1/128

</Directory>

</VirtualHost>

Nowyournewfilenameforme(bikramkawan)tosites-enableddirectoryalso.

Restartyourapacheserveryoursiteshouldberunningnow.

相关推荐