If you design websites you might want to install a web server on your computer in order to test your sites in an environment that matches the real thing as close as possible. This article describes how to install and configure the open-source Apache HTTP (web) server and how to make it work with not one site but as many as you require using a technique called name-based virtual hosting.
Read the rest of Installing and configuring Apache on Windows XP.
You're welcome Wilf, and I am not laughing, but hoping that I am able to do such things when I am 70.
Thanks
Just wanted to say thank you for your tutorial it helped me tremendously.
gf
sir, Thanks for making things more clearer.
Hi John;
Your tutorial on Apache Installation is great!
Thanks a lot.
Regards.
Boboy
I just installed Apache following your instructions. Very easy, indeed.
I am having problems when pointing to http://localhost/cgi-bin/printenv.pl - I get 500 Internal Server Error.
When I go to command prompt and change directory to C:\Perl\cgi-bin\ and type perl printenv.pl I get response, but not with the browser http://localhost/cgi-bin/printenv.pl
WHY?
For PC security, I have both administrator & limited user accounts on an XP machine. Daily usage is on 'limited' user and all installations & maintenance is done through 'admin' user.
Having searched for 'start stop apache server xp user', ( as I needed to start/stop apache & sql servers logged in as a limited user in WinXP ), I immediately found this article and it answered everything & more.
The 'run as Administrator' fix is so obvious I could kick myself. However, had I not done this search I wouldn't have picked up the tips for directory structuring to mirror my Web Server.
It also shed more light on my Virtual Servers, which currently work fine, but I can now tweak them a little more for ease of future implementation.
My thanks to you and your Apache Help page, John.
Happily running Apache-2.054, MySql-3.23.58, Perl-5.8.6.811, php-4.4.0, phpMyAdmin-2.6.2, MySqlCC-0.9.4, Smarty-2.6.9, DreamweaverMX on local Win32 platform for a Unix Hosting Server.
php-5 & MySql-4 currently seem reluctant to work so I must defer to the old adage 'if it ain't broke .... don't fix it'.
regards, Jake
Forgot to mention in last message :
As far as Windows OS go, I am a Win98 kind of guy.
I reluctantly moved to Win2k in 2002.
I loath XP with a passion and have only just got round to installing it permanently, hence my disbelief at the simplicity of the solution to my problem.
Linux Rocks - hell, anything OpenSource is better than the regurgitated offal from Casa Gates - If only I could do everything I need to from this platform..........
Annyhoo, hope you enjoy your life south of the border...
regards, Jake
@Daniel: you might want to change the first line of printenv.pl to contain the path to perl.exe. It probably now states:
#!/usr/local/bin/perl
Changing it to:
#!C:/perl/bin/perl.exe
does the trick, if on your system this is the path to the perl program as well.
Another option is using:
ScriptInterpreterSource registry
in your configuration file (httpd.conf, or a file you include by adding an Include directive to httpd.conf)
I've made several attempts in the past few years to do this. I've always got caught up with the Apache docs. I think they're written for people with a lot more network knowledge than I have. I've always been able to get the server installed, but tripped up on getting the virtual hosts thing working.
Your article cleared the fog away and I now have it all working. Simple, straightforward and now I know what I missed before.
Thank you!
Although .... even though I took the options you said (or I thought I did) it doesnt run on port 80 - only on port 8080. Is that because IIS was running when I installed? Should I delete Apache again and reinstall or can I reconfigure it?
@Mike Kear - yes, IIS uses port 80, so Apache won't run on port 80 as well. I have IIS configured to run on port 8080 since I use it only for one project I am developing for a customer.
Apache is used in several projects, so I prefer port 80 for Apache.
Thank you! Thank you! Thank you! You've just saved my life....this is a really great tutorial...
I have to say that your site was the first I hit on a google search for setting up a local host server to test webpages before publishing them. Very informative and helpful, as I now have a successfully running apache 2.2 web server hitting the loopback address for all my websites.
Thanks!
I got a 500 Internal Server Error
when run perl(pl)of cgi
Any one can help ?
This is the best article I have read on the subjuct!
However - I still cannot get it to work.
What exactly do I type in the browser to access my local site? For apache's default page, I type http://localhost No problem there.
For my virtual host setup (dev.ffcc.org) I try typing http://dev.ffcc.org
It wants to connect me to the internet, instead of serving up the page locally. I must be missing something.
Runing apache 1.3.27 on windows xp.
I have followed the instructions to the letter, modifying the httpd.conf and the hosts files. Re-boot.
I did get it to serve up my web site site under "localhost" instead of apache's default page, by removing the virtual host directive for local host.
any help would be appreciated.
Chris
Great tutorial. Thank you very much
Follow up to my earlier post - IE wants to dial up when I try to access my virtual hosts. I thought my vhost setting were wrong. But I nearly went crazy, because one moment it worked, and the next it did not. And so forth many times over. If I did not connect to the internet, my page would not found (because I was then "working offline").
I will share my solution for anyone else who may bang their heads up against the wall ...
My internet connections setting was the problem "always dial my default connection". Being on dial-up service this is convenient, but problematic. I could not access virtual hosts without being online (the whole point is to be able to access them without being online!) Because I was searching for a solution, I was online, following instructions which seemed to work. Then I would disconnect, go about setting everything up, test, and it wouldn't work!
Solution: change the setting to "never dial a connection". Maybe it's a windows/ IE thing.
Once again, your page is really great, the best I have seen written. Except for this little snafu, it all works beautifully. I am thrilled to finally have this set up properly!
Thank you!
Thanks. Its a great great tutorial to work with. I installed Apache 2.2 and PHP 5 on Windows XP machine for a testing server. Virtual Host is functioning just fine except that only the first Virtual Host opens up and rest of the domains take me to the first mentioned domain again. I'll try to explain: I've set up 3 domains in hosts file
127.0.0.1
127.0.0.1 www.mysite1.com
127.0.0.1 www.mysite2.com
127.0.0.1 www.mysite3.com
and I included the right syntax in virtual-hosts.txt file like this
# Use name-based virtual hosting.
NameVirtualHost *:80
<VirtualHost *>
ServerName www.mysite1.com
DocumentRoot "E:/www/mysite1"
</VirtualHost>
<VirtualHost *>
ServerName www.mysite2.com
DocumentRoot "E:/www/mysite2"
</VirtualHost>
<VirtualHost *>
ServerName www.mysite3.com
DocumentRoot "E:/www/mysite3"
</VirtualHost>
All of the above 3 directories exist with contents. But opening any domain takes me to first virtual host (i.e. www.mysite1.com). When I try to browse www.mysite3.com, it is supposed to take me to the contents of E:/www/mysite3, it doesn't, rather it takes me to the contents of E:/www/mysite1. same is the case when I try to open www.mysite2.com. it takes me to mysite1.com. what might be wrong?
Thanks very much for this - it's the first comprehensible tutorial on this topic I've ever come across!
However, for some reason the method you describe doesn't quite work on my computer, but with a little playing around with hosts and the virtual-hosts.txt file, I managed to get it to work. In case it's of any use to anyone:
I found that if all my virtual hosts were 127.0.0.1, it would only direct to one of them. However, if I set them up in the 'hosts' file as:
127.0.0.1 localhost
127.0.0.2 lc.example.com
...
and so on, and then instead of
Is that a sensible alternative way of doing things, do you think?
(One other thing: I found that it seems I have to close and re-open my browser for it to register changes in the 'hosts' file - worth trying if you're having problems getting things to work).
Once again thanks for a tutorial that finally helped me to do something I've been trying intermittently for weeks to get to work.
Nick
Hi John,
Thanks for a great article. It is easily the most understandable I have come across.
I have a question for you:
In addition to the apache/cgi-bin folder I have an additional cgi script folder for an application in c:/docorg/program/cgi-bin.
I have given permission for cgi scripts to be run from this folder using the following in the httpd.conf file:
<Directory "C:/docorg/program/cgi-bin/">
Options +ExecCGI
Allow from all
</Directory>
And have associated the extension .pl with perl.exe in the windows registry. But, although I can successfully run a perl test file in apache/cgi-bin, when I try to run it in docorg/program/cgi-bin it does not work. Instead, it looks as though the browser tries to download something (presumably the perltest.pl file?) and then nothing happens.
Any ideas on what I am doing wrong.
Thanks in advance on any advice you can offer.
Nick.
If only this tutorial had been available when I first set up my Apache Server! Very well written and very easy to understand, and great tips on virtual hosting, I can now clean up my conf file. Good tips about keeping the security stuff ABOVE root as well, very sensible advice. PHP advice would be most welcome now as I have never properly used it before.
Hello!
I've got the latest Apache installed, and the default localhost message is "It works!". When I try to access lc.myweb.com I get the same message, even if there isn't a index.html there. BUT when I try to access 127.0.0.1 I get a 403 error.... is this a problem?
Thanks - otherwise a perfect tutorial!
Hi! Sorryo ther you again...
I've checked the syntax of my virtual hosts file, and when I use
NameVirtualHost *:80
<VirtualHost *>
Apache reports that NameVirtualHost *:80 has no virtual hosts...
Any thoughts?
Dag John, Bedankt voor deze heldere uitleg.
Hi John,
I am installing Apache into my WIndows XP and I've encountered error messages about the httpd.conf "Os 10048". Something like only one usage of each socket address ..."
I am trying to install Apache and PHP into my XP.
It would be much appreciate it if you could help me.
Kind regards,
Alvin
Hi Alvin,
It sounds like something else is already using port 80. I understand that Skype uses port 80 but there might be other programs as well (for example IIS, the web server of Microsoft).
This is a good tutorial - it will come in handy for many projects - is it possible to install and Dual Boot Apache and IIS?
There seems to be a renewed interested in Dual Booting as of late
@SEARCH Engine WEB - I guess you mean running side by side (dual boot means having the option at start up to select an operating system).
Yes, this is possible. You have to configure either Apache or IIS to use a different port to listen to if they use the same IP address. For example I have Apache using port 80 and IIS using port 8080 on my development machine.
Thanks, the tutorial really helped me installing apache 2.2
Hi, John. I am from Malaysia and found your tutorial on configuring Apache HTTP web server. I am using version 2.2. Previously, when i configured it according to the manual from Apache, i cant even view http://localhost/cgi-bin/printenv.pl , but after i added the ScriptInterpreterSource registry in it. It coulld run. But file with extension .cgi will be downloaded. How can i fix this?
I have added ExecCGI in the root Options directive and AddHandler cgi-script .cgi .pl plus ScriptInterpreterSource registry in cgi-bin directory. Thx
@Sana, Richard - my bad, my original article contained a mistake (fixed now):
<VirtualHost *>
should have been:
<VirtualHost *:80>
hi... i have apache and php installed (latest versions of each). everything works fine locally.
however, when i try to browse some sites online, they will not load. the page simply trys to load and gives no time out error. It seems to be mainly sites that use some form of cgi.
this has only started since i installed and setup apache and php on my machine to use as a localhost. Any ideas on whats' happening?
the hosts file in /drivers just has the 127.0.0.1 localhost url in it.
thanks for any help you may provide!
I figured out that Nick's method
127.0.0.1 localhost
127.0.0.2 lc.example.com
...
works. I had however also have to make a virtual host section for the localhost
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/my/document-root/"
ErrorLog logs/localhost.error.log
</VirtualHost>
In addition, in the httpd.conf there is a restriction on which clients (identified by IP-address) might access the document root. I had to widen it:
<Directory "C:/my/document-root">
#...
Allow from 127.0.0
#...
</Directory>
replace C:/my/document-root with your own document root.
Hopes this helps someone.
John,
Thanks for posting this great tutorial.
I installed httpd-2.2.3-win32-x86-ssl/php5/mysql at xp release2
the default localhost message is "It works!". When I try to access www.mysite1.com I get 403 error, even if there is a index.html there.
<VirtualHost *:80>
ServerName www.mysite1.com
DocumentRoot "C:/mysite1.com/web"
CustomLog logs/mysite1.com.access.log combined
ErrorLog logs/mysite1.com.error.log
</VirtualHost>
I logged in as admin user. your example is for installing apache_2.2.3-win32-x86-no_ssl. is there anything I missed for httpd-2.2.3-win32-x86-ssl
Thanks again
Brilliant! This information on the Windows hosts file and virtual hosts was a godsend! If you ever need someone to have your babies, look me up.
Seriously, though, thank you. Cheers!
BIG THANKS!
I'm trying to migrate from fooling with IIS and ASP, to fooling with Apache, PHP, MySQL, - and Drupal. This has really helped me set up a development environment
Hi,
I installed apache as per ur notes but monitor apache server is not starting n its not showing any services to start in services.msc please reply me in this regards. will be waiting
Hi john,
i installed apache server 2.2.3 installation got completed succesfully and my monitor apache server started successfuly but when i go to start\programm\apache HTTP server\control apache server\start its giving a error (os 10048) please help me in this regards thanks
Hi! I am starting out, but there is a newer version of Apache available and I want to use the newer one, but am reluctant to because your tutorial is on an older one...I don't want to start out blind because your tutorial is very detailed...
Hi! I read your Installing and configurig Apache on Windows Xp (I am using the same version as the one in the tutorial) but I am stuck when it comes to editing the HOSTS file! It will not let me save...when I try to save, via the 'save as' and the normal 'save', it keeps giving me this warning:
Cannot create the C:\WINDOWS\system32\drivers\etc\hosts file" "Make sure that the path and filename are correct."
I checked the HOSTS file's property and such and it is not 'read-only'. Also, when I try to overwrite it or delete it or move it, it says that the file is in use by another person or process...I've tried everything!
OK. I've installed apache2 for my personal web page.
All I want is that visitors are able to see my html pages only.
What can I do?
When I try to access my domain name, the first thing that comes out is the contents of my folder.
I do not want the whole folder to show, just the main html file that I have placed there. Does anybody have an idea how to change this issue? I am running "Apache 2.0.59".
Hi Jim,
Are you sure that you have an index.html in your folder? When you access a folder using Apache it attempts to use some files first. If none can be found the contents of the folder is shown, or depending on your configuration, an error is returned to the browser.
If you don't have an index.html file in your folder, try to add it and see if everything is working ok.
hello, i read all and also configured accordingly.in virtual host setting for documentroot in "c://program files/apache group/apache 2/htdoc" it worked fine for my server but placing another html at "C;/program files /apache group/apache 2/include" or any else directory it didnt work... plz kindly guide me
Thanks John,
I had this up and running in less than 10 minutes thanks to your exquisite tutorial. Great work!
Just to echo the thanks of many others and the congratulations on providing such a clear explanation suitable even for server-novices like myself.
I feel many times more in control than I did a half-hour ago!
Hi.. John your tutorial is really great. And most importantly, the first apache tutorial that is well explained among the ones I went through..
hey there i tried to install apache with ur instructions and stuff... it get installed, but there are some problems
1- i installed, uninstalled, and installed this stuff many times as i was not able to view the test apache server page ( the one we get to see after typing "http://localhost/" , do i get to reinstall windows for this ? or the uninstall though control add and remove programs is well enuff.
2- i saw that blocking and unblock windows pop up first time when i was installing the apache. now when i install it, it doesnt come.
3- the error that it gives when i write the localhost url in the browser is that connection times out. when i remove the proxies and stuff then it says the page cannot be displayed.
i added the test url in bypass proxy option.
nothing is working. plzzzzzzzzzz help
i am using apache 2.0.59
I too would like to add my thanks to this excellent tutorial. It's been a huge timesaver for me.
My only problem is getting CGI scripts to work. I noticed at the bottom of this tutorial that you planned to add one for setting up and using CGI. Any idea if/when you're going to do that, or any quick tips you could give me to get started?
Thanks
Hello John
Is this going to work Ok with XP Home Edition, just completed a Frontpage course and shown how to load IIS...however XP HE does not support this
Am I doing the right thing?
Many thanks for you help
@Lou - you might try to install Apache as described in the article.
Thanks John
Great easy to understand tutorial.
I can't wait for you to have one on setting up PHP with Apache, because I have followed other tutorials to the nth degree and it just doesn't happen.
In regards to the gentleman (70) who understood your tutorial, I'm 59 and have been a programmer for 35 years, and yours is the first apache tutorial I've fully understood.
Thanks heaps.
too good i could understand many things.....
thank you very much...
Thank you for this Tutorial i was searching about it in search engine finaly i found it here. awesom work !
hi John,
I followed your instructions for installing Apache on Windows XP and created the following virtual hosts:
# default: localhost
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
ServerName localhost
DocumentRoot "C:/Program Files/ApacheWebServer/Apache2.2/htdocs"
ErrorLog "logs/localhost.error.log"
CustomLog "logs/localhost.access.log" combined
</VirtualHost>
# gamaingstandards.com
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
ServerName lh.gamingstandards.com
DocumentRoot "C:/Documents and Settings/Rob/My Documents/websites/gamingstandards.com"
ErrorLog "logs/lh.gamingstandards.com.error.log"
CustomLog "logs/lh.gamingstandards.com.access.log" combined
</VirtualHost>
localhost works but, when I attempted to go to lh.gamingstandards.com, I get the following error message:
"You are not authorized to view this page"
Any idea how to fix this? I'm the administrator and only user on this machine.
thanks, Rob
Hi Rob,
Are you sure you have an index.html in the gamingstandards.com folder?
After reading through the many comments and solutions, I tried to install apache 2.2.4 to my existing php5.2.1. For 2 hours, a test php file appeared as a request to download.
After having a cup of coffee and restarting the browser, apache 2.2.4 and php 5.2.1 now works fine. I don't know how it will behave tomorrow.
It's no wonder that some people have been mysteriously blessed with additional zeroes by their bank's computers for no particular reason. So for some of you who are facing this problem, just take a beer of something and perhaps the computer might be more cooperative.
And thanks to John for a helpful tutorial.
John,
Thank you so much for this site. It has been extremely helpful in debugging a cgi-bin issue related to Apache under Windows.
Very clear. I followed your Apache and PHP and it simply worked. Kudos, kudos. Rare that someone writes so clearly and with good and helpful picks.
I followed your directory structure -- more or less -- and everything was fine until I added a new one. Apache can't seem to find any new virtuals. Stop/Start, of course. Anything I'm missing?
Sorry, should have told you -- Apache 2, PHP 5.
i have configure three virtual hosts. and put a index.html file in their document root.
bur when i was trying to open other virtual sites it always Its Works!
hi john, iam pankaj again i am pasting here my virtual server config file in reference to my que.
# Use name-based virtual hosting.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName lc.mysite1.com
DocumentRoot "C:/www1/web "
CustomLog logs/lc.mysite1.access.log combined
ErrorLog logs/mysite2.error.log
</VirtualHost>
<VirtualHost *:80>
ServerName lc.mysite2.com
DocumentRoot "C:/www2/web "
CustomLog logs/lc.mysite2.com.access.log combined
ErrorLog logs/lc.mysite2.com.error.log
</VirtualHost>
<VirtualHost *:80>
ServerName lc.mysite33.com
DocumentRoot "C:/www3/web "
CustomLog logs/lc.mysite33.com.access.log combined
ErrorLog logs/lc.mysite33.com.error.log
</VirtualHost>
hi pankaj,
Are you sure the configuration file is read? You can test this by making a mistake in the virtual host file, for example just type something like asdfgsasda after NameVirtualHost. If you stop and then start Apache and the latter fails, you are at least sure that the file is read.
It was Skype which blocked the Socket. After stopping Skype I was able to start Apache! Thanks for your help!
Thanks for this tutorial John. I have been programming 25 years but only recently started using Apache/PHP and even some JSP and servlets. I had been using htdocs as my development and testing folder which was getting messy with 6 sites to maintain. I now have 7 virtual hosts, I made an extra one for using as a sandbox.
Hi! I have problem with Perl and Apache 2. I tried to set up a socket using Perl. But the problem is that when I browser to connect.cgi (I programmed for socket), I can not browser to any other file .cgi (Server only stand on the website that I setup for socket)I do not know why? Can anyone help me?
Let me echo the thanks of others - I am not 70 but still, your tutorial on how to install Apache on Windows XP is the clearest I've found to date, and is leagues beyond the "official" explanation from Apache itself, as well as that in several how-to books I have wasted money on.
Thanks!
Hi John.
Lets suppose insted of localhost I use an IP like 60.52.87.5 ( made up one not actual )
Here is the general virtual-hosts.conf file:
# Name-Based Virtual Hosting
NameVirtualHost 60.52.87.5:80
<VirtualHost 60.52.87.5:80>
Servername lc.a.com
DocumentRoot "K:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/www/a.com"
CustomLog logs/a.com.access.log combined
ErrorLog logs/a.com.error.log
</VirtualHost>
<VirtualHost 60.52.87.5:80>
Servername lc.b.com
DocumentRoot "K:/Program Files/Apache Software
Foundation/Apache2.2/htdocs/www/b.com"
CustomLog logs/b.com.access.log combined
ErrorLog logs/b.com.error.log
</VirtualHost>
You do not mention how to access the second virtual host on the Virtual Host List. The first VH on the list is default, but what do I type into the browser to access and summon the second VH?
In the browser I type in http://60.52.87.5:80 or http://60.52.87.5 and I get the correct index.html page to appear for the default(lc.a.com) VH.
Question: How do I get to the correct index.html page for the second (lc.b.com) VH?
The following are guesses that do not work. I have attempted to type into the browser:
http://60.52.87.5/lc.b.com
http://60.52.87.5:80:lc.b.com
http://60.52.87.5:lc.b.com
Your help and guidance to finish off the tutorial you provided would be greatly appreciated.
Thanks
Ed
Hi John.
I got the index.html for the second (lc.b.com) Virtual Host to come up in the browser.
Through trial and error, the proper index.html came up by typing http://lc.b.com into the browser.
Is there a special code to include when using the IP Address 60.52.87.5 to make it go to the second (lc.b.com) Virtual Host? Example like 60.52.87.5:80:lc.b.com? error Example like 60.52.87.5:80/lc.b.com? error
The index.html for the first (lc.a.com) VH appears when I type:
http://60.52.87.5:80,
http://60.52.87.5,
http://lc.a.com
How can I use the IP 60.52.87.5 to get at lc.b.com?
Thanks,
Ed
Hi Ed,
The whole point of the lc.example.com domain names is that you can use those instead of the IP address. If you have added them to your hosts file, you should be able to use them like any other domain name, i.e.:
http://lc.a.com
http://lc.b.com
Hi friends,can anyone help me how to use apache webserver in RAD STUDIO 2007,since am new to Delphi.net my seniors are asking me to configure Apache instead of IIS server but am not able to configure apache as my webserver....Please help me!!!!!.
Thanks in Advance
Hi John,
I must concur with the others on your excellent and straightforward setup. Mine installation of Apache 2.2 is now complete after one pesky error.
Like some I encountered a 403 error. Yes I had an index.html file in my DocumentRoot, and everything else double and triple-checked to be correct. Perhaps something changed with v2.2, but I had to add a Directory section for my DocumentRoot in httpd.conf. I just copied the block for the ...Apache2.2/htdocs directory, changed the path to my virtual server's DocumentRoot, and voila!
Thank you again!
@roat: re saving the "hosts" file and getting the constant "save as" and not being able to save it: I had this problem once, and it turned out to be caused by ZoneAlarm, a personal firewall which I use. You need to look for advanced options, and untick the option to "lock the hosts file", and this will allow you to save the hosts file.
@Michael: yes it appears something did indeed change in Apache2.2 and a
Further to my previous comment, the config change in Apache2.2 seems to be:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
In previous Apache versions this, I believe, was simply:
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
The solution is either to have a
hey i dont know if anyone still answers comments here but i have a question...if use apache with xampp...and it was installed with xampp...and its not working(the same server specific error comes up)..should i do the same thing as in this tutorial?
i know its abit out there but am not good at finding help in net..:)
thanks
Thanks a lot for the wonderful tutorial. I am trying to run the apache on my w2k3 server. Can you please advice some usefull links so that I can setup on w2k3.....Thanks
Thanks! it's a well structured and informative guide to get apache running locally. I've book-mark your site...
Hi John Exceptional tutorial on virtual hosting. Have also scoured all the post before deciding to post this. I have followed all your instruction but still encountered 403 msg when typing 'lamp.tutor.com'
ServerName lamp.tutor.com
DocumentRoot "C:/myweb/tutor.com/site/web"
index.html located at the "web" directory I also followed one of your post to check if the conf file is being read by placing garbage text and restarting the apache and it did display an error. Hope you still visit this site cause your last post is almost a year ago. Thanks.
Don
fantastic - much appreciated!
this is the best in www thanks a lot
live long
I had to do chmod 777 to both files to get rid of internal server error
I'm trying to install and configure apache with PHP in windows. I've installed Apache 2.2.19 and PHP 5.3.6. When I go to localhost I just get a welcome picture that when I click on it, it takes me to iis.net. Why is this? I also can't get apache to start. I get an error message windows could not start apache 2.2 on local computer. I've tried telling it to listen to a different port and nothing works. Can anyone help?
Hi John,
thanks for the extremely helpful report.
I got like some others above a 403 error with Apache 2.2.19, and also have an .index in the directory.
Funny enough after some wrong trials with the vritual host, Im start getting a 403 error also with localhost ...
I will appreciate any answer.
Hello John,
I just googled the answer to the previous question:
Supposed in virtual_host.conf there is:
[code]
Than in httpd.conf it should be
<Directory "F:/bar/public">
AllowOverride All
Order Allow,Deny
Allow from All
# Any other directory-specific stuff
</Directory>
Best,
Thanks for the tutorial. I'm trying to set up a home website and this was the first article that showed up in my search.
Hi great page but little help needed please.
I have the following:
Directory with index.html in: [code] D:\My Documents\Websites\Dale Powell\example.com\site\web [/code]
I have virtual-hosts.conf stored in: [code] C:\Program Files\Apache Software Foundation\Apache2.2\conf [/code]
and contains:
127.0.0.1 localhost
127.0.0.1 lc.example.com # my company's site
# Use name-based virtual hosting.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName lc.example.com
DocumentRoot "D:/My Documents/Websites/Dale Powell/example.com/site/web"
CustomLog logs/lc.example.com.access.log combined
ErrorLog logs/lc.example.com.error.log
</VirtualHost>
and finally I have httpd.conf stored in above location and have added the following to the bottom of the file:
# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random
equivalent
# but a statically compiled-in mod_ssl.
#
#Include conf/virtual-hosts.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
[code]
When i type example.com in browser i get the url
[code]
http://www.iana.org/domains/example/
What am I doing wrong, I feel so close for my virtual domain to wrok??? :)
@dpuk44: the hosts should be in your hosts file not the virtual-hosts.conf file. Moreover, there should be no # in front of the Include. Remember, if a line starts with a # it's considered a comment, so putting it in front of a command disables the command by turning it into a comment.
Hope this helps.
Note that your comment doesn't show up immediately. I review each comment before I add it to this site.
Check the Follow this page option if you want to receive an email each time a comment is posted to this page, including yours. A link to turn this option off will be included with each email.
Internet adresses will be converted automatically. You can use the following notation to specify anchor text for a link: [url=http://example.com/]example text[/url].
Hi John
Now don't laugh but I am 70 yrs old guy trying to understand this modern technogley. You lesson on Apache is the first I have understood. I am looking forward to your PHP lesson. Thanks for making things more clearer
WIlf