Tutorials > Setting Up a Development Environment > Apache Basic Setup

2. Apache Basic Setup

  • This article assumes you have completed the previous tutorial: Installing Apache
  • Open Explorer (Win+e) and go to C:\Apache\htdocs\.
  • There should be a file called 'index.html', open it with a text editor.
  • Note: The basic text editor is notepad, but to get text highlighting and other features, it is best to use a text editor for programming
  • I have always used PHP Designer 2007 Personal (http://download.cnet.com/PHP-Designer-2007-Personal/3000-10248_4-10575026.html) and it works great.
  • For the last month or so I have been using Sublime Text (http://www.sublimetext.com/2) and that is what you will see in screen shots.
  • Once you have index.html open inside a text editor, you will see:
    <html><body><h1>It works!</h1></body></html>
  • Try changing It works! to something else like 'Hello World!' and then saving.
  • Now if you open your web browser and refresh it will update.
  • I prefer using a different folder than htdocs, so lets change that.
  • Open C:\Apache\conf\httpd.conf (in a text editor).
  • Find where it says 'DocumentRoot "C:/Apache/htdocs"'' and change this to 'DocumentRoot "C:/wwwroot"'.
    DocumentRoot "C:/wwwroot"
  • Further down change '<Directory "C:/Apache/htdocs">' to '<Directory "C:/wwwroot">'.
    <Directory "C:/wwwroot">
  • Save this file.
  • Open Explorer (Win+e) and create the folder wwwroot on your C: drive.
  • Note: If you don't have file extensions visible, you should turn that on.
  • Press Alt to view the old File menu and click Tools > Folder options...
  • Uncheck the box next to 'Hide extensions for known file types'.
  • Goto C:\wwwroot and create index.html (C:\wwwroot\index.html).
  • You can do this by right clicking and choosing New > Text Document.
  • It will create 'New Text Document.txt'. Right click and Rename (or press F2) and rename the file to index.html. Make sure to remove .txt.
  • Type in "Hello world." and save.

    Hello world.
  • Now restart Apache by right clicking the icon in the system tray and opening the Apache Service Monitor.
  • Click Restart.
  • Open your web browser and resfresh localhost.
  • It should now say 'Hello world.' in normal font.

Return to TutorialsNext Tutorial: Installing PHP