|
Filed Under (Articles) by Anoop on May-11-2007
Step 1 - Download the latest version of Apache. Goto http://httpd.apache.org/download.cgi and look for the latest stable release. This is currently 2.2.2 and is the version we will use here. Click the link "apache_2.2.2-win32-x86-no_ssl.msi" and Save to an appropriate part of your hard drive. The hard part is done ;) Step 2 - Install Apache Double-click the downloaded MSI to launch the installer. You will be presented with the welcome screen. Step 3 - Lets Configure our new Server. These instructions configure the Server for SSI as well as taking the ‘VirtualHosts’ approach. This enables you to then add more web sites as needed just by configuring a new ‘VirtualHost’ for each. PHP config options will be added in the PHP tutorial section . Below instructions assume ‘yoursite.com’ as the site name, change to suit yours!! Locate and edit ‘httpd.conf’ file (should be in ‘C:\Apache2\Apache2\conf\httpd.conf’) ServerRoot, ServerName, DocumentRoot etc will all have been pre-set according to what information you provided in the intial installation phase. Check these and it is ok to change them manually if your setup needs or locations change. Locate this code near the bottom of the file :- <Directory /> and just below it add a new directory container for your base websites files locations.
<Directory "d:/accounts/*/"> In the above example, this is needed to configure the directory structure for where our virtual hosts will be placed on the server - and this for security reasons is outside of the directory structure for the web server apache files themselves. Here I have created a directory called ‘accounts’ where all websites will be based beneath. Find the code section:-
<IfModule dir_module> and make it look like this :-
Find the section :- # Filters allow you to process content before it is sent to the client. and uncomment out those last two lines to read :- # Filters allow you to process content before it is sent to the client. ————– There is now a supplementary section near the bottom of httpd.conf which gives you the option to include extra configuration files into your setup. In our case, the virtualHosts that we want to configure, instead of doing so at the bottom of this httpd.conf file, we instead enable the ‘httpd-vhosts.conf’ file and do our configurations in there. Still in httpd.conf file , find the section which is headed by :-
# Supplemental configuration and then find these two lines of code :-
# Virtual hosts Uncomment out the second line to enable the external vhosts file :-
# Virtual hosts Ok, we are done with httpd.conf file but we are not done configuring. We now need to edit /extra/httpd-vhosts.conf and configure our virtual host containers. Save and Close ‘httpd.conf’ file. Locate and edit ‘httpd-vhosts.conf’ file (should be in ‘..\conf\extra\httpd-vhosts.conf’) then create a new VirtualHost container for your first site (yoursite.com). <VirtualHost *> The first VirtualHost container block - or the only container block - is also the fallback default virtualhost should any other requests not be found. More information on configuring VirtualHost containers is at http://httpd.apache.org/docs/2.2/vhosts/ Ok so that about it, Save the file, then ‘Stop’ and ‘Start’ the Server again. Check that the default site is now our new VirtualHost by going to http://localhost in your browser. Of course you will already have some files including an index page in d:/accounts/yoursite/ or you’ll get a 404 error.
Step 4 - Extra Configurations. Enable the local Manual again! Edit your httpd.conf file and locate :- # Local access to the Apache HTTP Server Manual Lets enable the manual by removing the comment from the second line. # Local access to the Apache HTTP Server Manual Ok, good thats it, restart the Apache Server service and go to http://localhost/manual and you should have your manual showing again! If you get an Access Denied message, have a look in ../conf/extra/httpd-manual.conf and check that the location specified in the Alias Match and Manual lines points to the location of the manual directory. Disable external access to the Manual You may not care about this, but if you do here is how to disable external access to your manual. Edit your ../conf/extra/httpd-manual.conf file and locate in the Directory configuration :- Allow from all Change this to read :- Allow from localhost Restart your Server. Now http://locahost/manual will still work, but http://yoursite.com/manual will not. You can enhance this to allow the whole of your local network access, certain external IP addresses etc etc.
Raghav on February 17th, 2008 at 8:29 pm #
Hey its good..keep it up..!! Post a comment
|
|