Forum Moderators: phranque

Message Too Old, No Replies

Need help installing Apache Server on Windows

Configuring the httpd.conf file

         

Jetheat

1:41 am on Jan 27, 2005 (gmt 0)

10+ Year Member



I have just installed Apache on my Windows XP machine.

I don't know the first thig about Apache except that it is a server and when I make php web pages in Dreamweaver, I can test them on my own computer without having to upload them (I hope this assumption is right).
I don't need to use the server for hosting web pages for anyone else. It's purely for my own web page testing before uploading.

So I installed the server and gave it my pc name (lentrica).

When I type [lentrica...] or [lentrica:8080...] in IE browser, it doesn't work.
Naturally, I reckon I have to configure a few files before it works.
When I checked the httpd.conf file, it already has this written in there:

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName lentrica:8080

What should I do to make it work?

Thanks

JH

kalos

5:20 am on Jan 27, 2005 (gmt 0)

10+ Year Member



You need to add an entry into your HOSTS file (think of it as DNS for your local machine) for your computer's name. In XP the file is located at C:\WINDOWS\system32\drivers\etc. Just below the entry for localhost you can add one for lentrica as follows:

[quote]127.0.0.1 lentrica[\quote]

or be cute and add in a top level domain to it (tld) thusly:

[quote]127.0.0.1 lentrica.org[\quote]

The one caveat to remember is that this is not DNS and just because you can access lentrica.org in this manner, your friends or co-workers cannot.

-ben

Jetheat

8:04 am on Jan 27, 2005 (gmt 0)

10+ Year Member



I don't really know what DNS is!

Anyway, I did what you said and added 2 lines to the file which read:

127.0.0.1 www.example2.com
127.0.0.1 www.example3.com
127.0.0.1 www.example4.com
127.0.0.1 localhost
127.0.0.1 lentrica

After saving it, I went to my browser and typed [lentrica...] and [localhost...] and [127.0.0.1...] and yet nothing!

Any more ideas?

[edited by: jdMorgan at 2:39 pm (utc) on Jan. 27, 2005]
[edit reason] Removed specifics per TOS. [/edit]

sun818

8:23 am on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Dumb question, but did you turn Apache Server on? I typically install Apache as a Windows service (Start, Settings, Control Panel, Admin Tools, Services, Apache). Make sure the status says Started. If you don't see one there, that usually means you have to run it from Programs and run it as a Windows program.

Jetheat

8:37 am on Jan 27, 2005 (gmt 0)

10+ Year Member



It's not in the Services but the server is started as the icon is in my system tray.

I reckon it's got to do with configuring some files but I don't know what or where.

8cool

9:35 am on Jan 27, 2005 (gmt 0)

10+ Year Member



Just try to start apache from command prompt. See whether its displaying any error messages.

Jetheat

9:42 am on Jan 27, 2005 (gmt 0)

10+ Year Member



How do i start it from cmd?

kalos

10:51 am on Jan 27, 2005 (gmt 0)

10+ Year Member



C:\Program Files\Apache Group\Apache2\bin>apache -k start

if you want to install it as a service:

C:\Program Files\Apache Group\Apache2\bin>apache -k install

Jetheat

11:13 am on Jan 27, 2005 (gmt 0)

10+ Year Member



ok, I did that and this is what I got:

C:\Program Files\Apache Group\Apache2\bin>apache -k start
[Thu Jan 27 11:12:07 2005] [error] (OS 2)The system cannot find the file specifi
ed. : No installed service named "Apache2".

C:\Program Files\Apache Group\Apache2\bin>apache -k install
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
Unable to open logs
______________________________________

What do I do now?

Jetheat

11:16 am on Jan 27, 2005 (gmt 0)

10+ Year Member



Hey, its ok now. I did it again and it works.

I typed [lentrica...] and that wouldn't work but when I typed [lentrica:8080...] that worked.

How do I make it work so that I don't have to type 8080 everytime?

What would I type if I wanted to test my index.php page on my computer?

Any solutions?

Thanks

JH

topr8

11:30 am on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>ServerName lentrica:8080

the server name is lentrica

somewhere in the config file is a place to list the ports to listen to, ensure port 80 is set

Jetheat

11:46 am on Jan 27, 2005 (gmt 0)

10+ Year Member



I had a look in httpd.conf and can't find a list of ports anywhere in that file.

Which file would it be in?

Jetheat

11:51 am on Jan 27, 2005 (gmt 0)

10+ Year Member



ok, after another look, I found this:

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 8080

So I changed the last line to:
Listen 8080, 80
and that didn't work.
I also tried adding a separate line which read,
Listen 80
and that didn't work either.

What do I try now?

Jetheat

4:26 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Another problem I'm facing is that when I make pages in php from within Dreamweaver and then I preview them in a browser, the php stuff is not shown.

What setting is missing?

topr8

8:10 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



have you installed php as well? if not thats why it doesn't work.

if you are only using it for testing locally, i'd use an all in one installer that will install php,apache,perl and mysql for you - not in the most secure way but if it isn't a live site it doesn't matter.

... i have used webserv to great effect and can say that the install on win xp is very easy - up and running in minutes.

Jetheat

8:53 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



Yes I installed PHP and reset the server to apache.
I guess I have to do some more configuring.

Anyway, I also installed Uniform Server and it works good.

But how do I make it so the root folder is known as [localhost...] coz right now, it only works with my PC name?