Thursday, 21 November 2013

Customize the Apache web server


  •     Adding our own web pages:

      Web pages are added either in htdocs which is a default directory set in https.conf file or you can change the directory path by changing Document Root and making changes in directory label which already has default path

  •        Virtual host configuration:

1.     Virtual host has two types :

                                 I.   Different domain names (use for different website on same server) with same Ip address on same server.
                                 II.   Different domain names with different ip address on same server

2.    Add a domain name and own ip address in host file of windows.

3.    Add a line “  Include conf/virtual-hosts.conf” at the end of httpd file.

4.    Create virtual-hosts.conf file in conf folder.

5.    Add these line

 NameVirtualHost *:8080

<VirtualHost *:8080>
    
       ServerName www.localhost.com

        DocumentRoot "D:/website/web1"
       
        CustomLoglogs/www.localhost.com.access.logcombined
        ErrorLog logs/www.localhost.com.error.log

</virtualHost>

6.    You can add more than one tab of virtual host if want to assign more domain names.

7.    Change host file respectively

8.    Add Respective directory tab in httpd.conf file which will locate the website in system.


9.    Restart http.exe by closing it by ctrl+c and start it by double click on it.

No comments:

Post a comment