Thursday, March 12, 2015

How to make domain name in apache2 on linux

1.  go to /etc/apache2/sites-enabled and edit  000-default.conf input like example on bottom



#start hire

<VirtualHost *:80>
        ServerName www.example.com
        DocumentRoot /var/www/html/foldername
</VirtualHost>

#end hire


2. go to /etc and edit hosts (do this # sudo nano /etc/hosts)  and input this


127.0.1.1   www.example.com


that mean is 
you web in your localhost name is www.example.com ,
runing on port 80 and locate in /var/www/html/foldername


Done ,. i hope i help someone

No comments:

Post a Comment