Whatterz


Installing Apache on Vista

by Simon. Average Reading Time: about 2 minutes.

Following the purchase of a spangly new Toshiba laptop running Vista, and not one for making life simple, I decided not to run my development environment on IIS7, but rather, I wanted to install the latest version of Apache.

Installing Apache under Windows XP was relatively trivial. This is not the case under Windows Vista. The creation of the Apache service fails, but not overtly. Furthermore, the all-important conf directory can™t be set up by the installer, probably due to user permission problems.

I finally got it working with the following procedure. I used the latest version of Apache (2.2.4) and Windows Vista Business Edition.

  1. Uninstall any previous installations of Apache Web server (Start > Control Panel > Programs and Features).
    Make sure that all old Apache folders are also removed (e.g. like C:\Program Files\Apache Software Foundation\…).
  2. Turn off your firewall via the Control Panel.
  3. Stop User Account Control (UAC).
  4. Get the most recent version of Apache from http://httpd.apache.org/ and put it on your desktop, or folder of your choosing. The file I used was called apache_2.2.4-win32-x86-no_ssl.msi, but for ease, it is a good idea to rename the install file to apache.msi.
  5. Start > All Programs > Accessories Right-Click Command Prompt and choose œRun as Administrator.
  6. Via the command prompt, navigate to the folder in which the apache.msi install file is located.
  7. Type msiexec /i apache.msi on the command prompt.

    Apache Install Command Prompt

  8. Run through the Apache installer.

    Apache Install Step 1

    Apache Install Step 2

    Apache Install Step 3

    Apache Install Step 4

    Apache Install Step 5

    Apache Install Step 6

    Apache Install Step 7

    Apache Install Step 8

    Apache Install Step 9

  9. I™m running it as a development server, so I left the domain as “localhost”.
  10. Choose the default server on port 80 for all users option.
  11. The default installation directory is C:\Program Files\Apache Software Foundation\Apache2.2\, but again for ease, you could change the installation directory to C:\Apache.
  12. Reboot your computer.
  13. The little Apache feather icon won™t appear on the task bar under Vista with the present version of Apache (2.2.4). To remove the œerror box that says blank or “the operation completed successfully on startup, go to All Programs > Startup, and remove the “Monitor Apache Servers” item there.
  14. Browse to http://localhost. It should say “It works!” If it doesn’t, panick, or check your httpd.conf file by going to All Programs > Apache HTTP Server 2.2.x > Configure Apache Server > Test Configuration. Follow the directions for fixing the configuration file.
  15. Turn your firewall back on.
  16. Turn UAC back on too, if you like to be constantly bugged by control messages!

Good luck!

This article has been tagged

, , , , , , , , , ,

Other articles I recommend

Installing PHP with Apache on Windows Vista

Following on from my posts about installing Apache and ColdFusion on Vista, it is now the turn of PHP.

Configuring PHP with Apache on Windows Vista

Installing PHP with Apache on Windows Vista is a relatively simple task until you try an configure the settings in php.ini. Problems can occur and stem from the fact that when you install PHP and edit the php.ini file, you need to not only be logged in as Administrator, but run the installer and Notepad text editor as Administrator. The php.ini file also needs to be located in the Windows directory.

Installing ColdFusion 8 on Vista

A few months ago I posted an article on Installing Apache on Vista, and it proved to be extremely popular. It appears that I was not the only one who found it a non trivial matter.

Now it is the turn of ColdFusion 8. ColdFusion 8 as we well know is the latest and greatest incarnation of the ColdFusion platform from Adobe. It has a lot of great new features such as cfimage, cfzip, cfexchange, some contentious features such as cfthread and cfinterface, and some not-so-necessarily-cool new “Web 2.0″ features such as cffeed and cfajax.

  • http://www.rescuemarketing.com/blog Mark Riffey

    Thanks Simon, your Apache for Vista stuff was a great help.

  • KnightWing19

    Just wanted to say thanks the help on the Apache setup.

    I was having a real pain with the install till I check this site and it worked great.

    Thanks

  • Matt

    I keep getting “The operation completed successfully” fatal error messages… after following all these steps. I have screenshots to prove it! (Actually quite funny. I wonder if they made the “success” messages a fatal error on purpose?)

  • http://www.simonwhatley.co.uk Simon

    The fatal error messages do seem to be a little bizarre, but I found that removing the Apache item from the startup removed such errors. I’m not sure Microsoft appreciates Apache competing so significantly well against IIS.

  • Martyn Dryden

    Exactly the information I needed. Thank you very much.

  • AHassan

    I had a few problems at the beginning because the command prompt was at c:\windows\system32 and I couldn’t figure out how to change it to c:\users\ahassan.

    But after turing the firewall and UAC off and restarting my pc, I put apache is c:\users\ahassan and it ran from there but nothing was happening, an error message came up.

    So I decided to run setup manually, AND IT WORKED

    Thanks
    A Hassan

  • Martyn Dryden

    Just to mention that I have now used the same technique to install MySQL, and run it as a service. Thanks again.

  • http://www.simonwhatley.co.uk Simon

    @Martyn Thanks.

    It does appear that many applications need a similar process applied. ColdFusion also requires a similar installation technique. More on that and the MySQL setup soon.

  • ADIGA

    nice … been trying to install it for 3 days .. never worked …
    any way .. back to linux .. windows is gay :-S

  • KPT

    thanks semon …your post helped me much in configuring apache server in vista …

  • nadir hanid

    at the moment I’m trying to install the 2.2.6 version put I download the zip file because i can’t find the msi file. But if i change the zip file to msi it doesn’t work.Well i’ not so good at technical stuff about computers since i am quite young and still at school! but i’m not thick though.I have home premium But If you know how to fix my problem then please email me at nadir_14_02@hotmail.com and show me an novice (easy) step by step instructions to install the server (remember it’s version 2.2.6 and is a zip file) please and thank you!

  • ayse

    Thank you very much..Really helped.. but I want to learn the meaning of the command “msiexec /i ..” especially “/i” part..can you explain please??

  • http://www.simonwhatley.co.uk Simon

    @Ayse

    If you run a command prompt and type msiexec /? you will discover what all the options mean. In answer to your question though, /i is an install option for the Windows Installer that “Installs or configures a product”.

  • http://www.simonwhatley.co.uk Simon

    @Nadir

    Unless you want to compile the Apache 2.2.6 files from the source code, which I wouldn’t recommend, I suggest installing version 2.2.4 which has an MSI file. Otherwise, wait until Apache release the MSI file for 2.2.6.

  • Danny Wilkerson

    I was looking for 2.2.6 also, not sure if it’s ready or not but it’s on the webpage. You cant see it due to the section being commented out but here is the link for the source

    http://www.gtlib.gatech.edu/pub/apache/httpd/binaries/win32/apache_2.2.6-win32-x86-no_ssl.msi

  • http://none fc

    Thanks simon, its work for me

  • ChrisP

    Thanks Simon – I wasted hours trying to instal Apache 2.2.6 until I found your site. By the way 2.2.6 is available now as a .msi file

  • http://www.skampsweb.net Sue

    thanks _so_ much for this. I had just one little panic as I had Skype running which steals the default port. Luckily for this I’d “been there done that” with previous Apache installs and new immediately what to do. I got it working with 2.0.49 so it is at the same version as all the others I have installed.

    thanks again

    Sue

  • D Chesnut

    I downloaded the .msi file. I tried to install using the command line, but could not get it to work. I then used Windows Explorer, located the .msi file and double clicked it. It installed perfectly that way.
    Now, my problem is Windows Firewall. When I stop the Firewall, I can see my webpage on a remote computer. When I start Firewall, I can’t find my web page. Does anyone know a solution for this? Thanks,
    Don

  • Sy

    Thanks Simon, this worked for me on Vista HP using Apache 2.2.6 (msi file now available).

  • Tawa

    thanks for this. i wonder if it will work on the Vista Home edition?

  • http://www.simonwhatley.co.uk Simon

    @Tawa. There is no reason why it should not work on Vista Home Edition since Apache does not have any special operating system components

  • luke mersh

    hi i have followed the apache install, but i just get IIs7 when i type in localhost, any ideas?
    regards
    luke

  • http://www.ohs.org.uk Anthony Greenwood

    Worked exactly as you said it would. Many thanks for saving me much heartache!

  • http://www.simonwhatley.co.uk Simon

    @Luke is there a reason why you need to run both IIS and Apache side-by-side? I prefer not to, but if you need to, you can change the port Apache listens on to something different. Search for “Listen 80″ (without the quotes) in the httpd.conf file and change to an unused port.

  • Amber

    Browsing to http://localhost doesn’t work for me, the page can’t be displayed, but http://127.0.0.1 does. I wonder why…

  • http://www.simonwhatley.co.uk Simon

    @amber you need to add a Virtual Host configuration to get localhost to work.

    For example, place the following in the httpd.conf or httpd-vhosts.conf file, and restart the Apache service:

    <VirtualHost *:80>
        DocumentRoot "C:/WebRoot"
        ServerName localhost
    </VirtualHost>
    

    NB. If you want to use the httpd-vhosts.conf file, you’ll need to make sure that the line including it in httpd.conf file is uncommented.

  • Amber

    Simon, thanks for the reply, I did what you suggested and added following lines in httpd-vhosts.conf file:

    NameVirtualHost *:80

    DocumentRoot “C:\Apache\htdocs”
    ServerName localhost

    I uncommented the specified line in httpd.conf file to sync with that as well. But, still, it doesn’t work. :-(

  • http://www.simonwhatley.co.uk Simon

    @amber

    You need to make sure your WebRoot is in the correct place, and is referenced correctly in the httpd.conf file.

    See my comment:

    http://www.simonwhatley.co.uk/configuring-php-with-apache-on-windows-vista#comment-4093

  • Andrew

    Hi Simon,
    I have followed the installation steps for Apache 2.2.9 successfully and have installed and configured PHP 5.2.6 successfully. The problem exists when I shut down my note book and then start it up again Apache does not work. I have even made a copy of the original httpf.conf file and copied it into the conf folder and attempted to start Apache again but with no success. Hopefully you can help?

  • http://www.simonwhatley.co.uk Simon

    @Andrew have you checked whether the Apache service is running after startup? The service may not be configured to start automatically.

  • beginner

    @amber

    right click in your cmd
    click on advanced and run as administrator
    and apache monitor and restart ur apache and try ur localhost
    cheers

  • Jonathan Newton

    when I open the command prompt I get C:\Windows/system32>

    I can’t do anything after that. I have the apache.msi on my desktop. How do I “navigate” to it so I can install it? what am I supposed to type? I tried “cd apache.msi” at the end and it didn’t work. Help please.

  • http://www.simonwhatley.co.uk Simon

    @jonathan to navigate to your desktop you can do the following:

    On Windows XP:

    C:\Windows\system32>cd\

    C:\cd Documents & Settings

    C:\Documents & Settings>cd *USERNAME*

    C:\Documents & Settings\*USERNAME*>cd desktop

    On Windows Vista:

    The user profile is found in the C:\Users directory.

  • Pingback: gcfrench: Installation

  • Derrick

    to all vista users:

    I’m trying to find all of these tutorials I can, but YOU CANNOT INSTALL AN APACHE TESTING SERVER ON VISTA….PERIOD!

    If you “trick” vista and get Apache to work, it will eventually crash (when this happens depends) and you will have to reinstall vista and lose all data unless backed up.

    Hope this helps someone.

  • http://www.xemplar.biz Tom Lolosoli

    Thanks a lot Mr. Simon. I am using window vista business and the step by step Apache installations has worked greatly. This is 50 % off relief the configurations I am making for Joomla in my machine.

  • ruslan S

    Great! Thanks, I even thought to change my windows back to xp because of this fault – but now its working,

  • Josiah

    I did this as presented, with cmd in admin mode, but it will not create the service at the end of the install.

    I have no idea what goes wrong.

    I successfully installed it once using a different tutorial, but I decided to install it to a different directory and now I can’t get it working with any tutorial, even if I go back to default directory. Apache seems to have everything proper except the service.

  • dave

    i’m able to see my web server going here in web browser:

    http://localhost:8080/

    but when i try to access outside of my network:

    http://myIPaddress:8080/

    connection just times out.

    I set up port forwarding on my router like this (NOTE: I set up TCP and UDP individually b/c when I try BOTH, I get Port Overlap error ):

    Name: Apache1
    External: 8080
    Internal: 8080
    Protocol: TCP
    IP: A static IP that I created
    Enabled: YES

    Name: Apache2
    External: 8080
    Internal: 8080
    Protocol: UDP
    IP: A static IP that I created
    Enabled: YES

    I installed Apache Tomcat 6 w/defaults. Do I need to change Apache config? Is it possible my ISP is blocking port?

  • Steve

    Many thanks Simon for your wonderful hints. Please, I have the same problem with Amber (comment 4092) – my localhost does not work but the IP address does. I pasted the code below into my httpd.conf file but the problem persists!!!

    DocumentRoot “C:/apache/htdocs”
    ServerName localhost

    What else do I need to do please?
    Beside, if I use “c:/apache” as the path for the document root, the page would not even load at all, except using “c:/apache/htdocs”.
    Many thanks

  • http://www.simonwhatley.co.uk Simon

    @steve you need to make sure you have a virtual host definition like the following. It is essentially a catch-all defintion for the localhost server name. Ideally you’d not have this, but would rather set up a virtual host for each project or site you were working on so you can set up individual profiles etc.

    <VirtualHost *:80>
    	DocumentRoot C:/WebRoot
    	ServerName localhost
    	<Directory />
    		Order allow,deny
    		Allow from all
    	</Directory>
    </VirtualHost>

    Remember to restart Apache for changes to take effect.

  • http://www.simonwhatley.co.uk Simon

    @dave First, make sure the firewall on your local machine allows for port 80 and 443 traffic. Second, make sure the DNS on your network knows where to look for the domain, or put the IP address of your computer into the Windows Hosts file on all the computers that need to access the website. Thire, set up a virtual host profile that looks like an actual domain, for example with a server name domain.local (where ‘domain.local’ can be anything you choose) — you will need to know this for the hosts file as well.

    Below is an example VirtualHost:

    <VirtualHost *:80>
    	DocumentRoot C:/WebRoot/myWebsite
    	ServerName domain.local
    	<Directory />
    		Order allow,deny
    		Allow from all
    	</Directory>
    </VirtualHost>

    For example, I have a local copy of WordPress on my computer, which I use to develop themes. I would typically reference the local install as http://wordpress.local/ so it has a ‘proper’ URL structure.

  • Michelle

    It says “It works!”, but when I click on the “feather” icon…the black window pops up and goes away. Anyone know why? Please help me! This is for class. If you can e-mail me, I would be so grateful.

  • Betoka

    i try it now. I hope success

  • Ville

    Thanks Simon, this worked perfectly!

  • Question

    Hello, I had a same problem like Amber and Steve, but anything you mentioned guys didn’t help me. I have read about a file “hosts” occuring in “windows\system32\drivers\etc” and I found something was wrong. I have Windows Vista, but I think it may happen to anyone with WinXP too. There were 2 lines defining localhost in this file:

    127.0.0.1 localhost
    ::1 localhost

    I just added “#” before the second line and now everything go right :)
    That’s all I have to say.
    Have a nice day

  • Rawia

    Hi
    I made what u said but not on your version of apache, it did not work, it coudent navigate to the localhost
    is it necessary to download your version
    I visited the apache site but I did not Know how to install apache 2.2.4.
    I did not understand what they want.
    thanks for help

  • kukuh

    thank’s a lot

  • Freddy Purnomo

    do you prefer. putting apache directory on program files or new folder on C?
    For avoid any dump and error?