Beginner's help with Apache installation

Hello,
I am a novice amateur WEB programmer. I am reading now Kevin Yank’s “Build your own database driven WEB site with PHP and MySQL”.
I proceeded with MySQL, Apache, PHP installation as was recommended in the book installing them separately.
As far as I can perceive I succeded with “Apache HTTP Server 2.2.17” installation. I have no idea if I had already web server running on my Windows XP computer, therefore I selected “only for the Current User, on Port 8080, when started Manually” configuration option.
When checking if the installation is done properly with typing “http://localhost:8080” in browser address window I receive the expected “It works!” congratulation. From the other hand I don’t see any server working in the “Service status” window of “Apache Service Monitor” and all the “start”, “stop”, restart" buttons are disabled.
Thus I am not sure ifI have Apache working or not.
I found some error in error log, which might have not any significance though:
“[Sat Oct 30 13:45:24 2010] [notice] Child 4224: Starting thread to listen on port 8080.
[Sat Oct 30 13:45:40 2010] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico”

Would appreciate any help.

I’m not sure why the buttons are disabled, but it sounds like your Apache is working. The two messages in the log aren’t errors.

You may want to try XAMPP - it automatically sets up Apache, PHP, MySQL and more: XAMPP

CS,

When I installed on my XP box, I first used services.msc to stop and prevent IIS from starting with Windows (see properties). THEN I was able to install Apache using port 80 and never looked back. In your case, I’d UNINSTALL Apache, shut down IIS from Services, then REINSTALL Apache properly so avoid problems.

Kudos to you for using the “proper” way to install the WAMP daemons (according to Kevin Yank) rather than XAMPP or WAMPP which only provide a “snapshop” and can never match your host’s installation (after all, a test server is best when it duplicates the online services). Be sure to follow the additional tips regarding enabling mod_rewrite linked in my mod_rewrite tutorial (see my signature).

Regards,

DK

Thanks, dklynn and yuguo.
I think nevertheless my Apache setup is working properly because I performed another check with simple PHP script returning current data and it worked.
dklynn, I will proceed with your recommendation on disabling IIS and reinstallation of Apache. Could you, please, elaborate more on how to disable (check it is disabled) the IIS?

cs,

Yes (from memory - I’m now on Win7):

Start | Run and type in services.msc. That will start Window’s Services module which is a two panel window. On the right, scroll down the alphabetical list to find IIS and click on it.

On the left, you’ll be offered the option to STOP this service. Click on STOP.

In the toolbar at the top, click on the Properties icon. Within the Properties pop-up window, there will be a checkbox to start the service when Windows loads. UNCHECK that box and close the Properties box. Close the Services window.

THEN REINSTALL Apache using port 80.

The reason for all this is that M$ installed IIS to start - using port 80 - when Windows starts. That effectively precludes any other http daemon from even being installed on your computer - unless you know to STOP IIS and prevent it’s automatic starting.

Don’t forget to UNinstall Apache so you can install it properly (on port 80).

Regards,

DK

dklynn, thank you very much.
I reinstalled Apache on port 80 (actually I found that IIS was disabled at my computer, thus I had not to disable it) and now the Apache Service Monitor works exactly as expected, showing Apache2.2 in service status window and even indication correct PHP version in status bar.

i have tried both methods. the 8080 port installation does not allow apache to run. the port 80 installation seems to work fine; the green lite is on and all looks good. http://localhost returns the:

“Unable to connect” window

i have xp home edition sp 3. i did not find IIS in the services.msc list, so assume i do not have it installed.

anyone can help, thanks, phil

phil,

From what you’ve stated, it’s likely that you did not install in the recommended location so you’ll need to edit your httpd.conf file. IMHO (for XP only), UNINSTALL Apache then reinstall using defaults. THEN you can edit the httpd-vhosts.conf file to add local VirtualHosts in any location you have on your computer.

Regards,

DK

i removed the octothorpe from the line:

Include conf/extra/httpd-vhosts.conf

seems to work fine now.

Thanks, phil

well, almost had it. if i direct to http://localhost, i get “it works” if i try http://localhost/index.html or today.php from kevn yank’s book, i get the 403 forbidden error.

thanks, phil

Did you check Apache error_log? If not, browse the URL http://localhost/index.html, check the error_log and paste the log entries here.

dummy host error.log

[Fri Nov 05 12:24:53 2010] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/Apache Software Foundation/Apache2.2/docs

phil

this is the error.log

Starting the Apache2.2 service
The Apache2.2 service is running.
rmine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 02:06:22 2010] [notice] Apache/2.2.17 (Win32) configured – resuming normal operations
[Fri Nov 05 02:06:22 2010] [notice] Server built: Oct 18 2010 01:58:12
[Fri Nov 05 02:06:22 2010] [notice] Parent: Created child process 3212
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 02:06:22 2010] [notice] Child 3212: Child process is running
[Fri Nov 05 02:06:22 2010] [notice] Child 3212: Acquired the start mutex.
[Fri Nov 05 02:06:22 2010] [notice] Child 3212: Starting 64 worker threads.
[Fri Nov 05 02:06:22 2010] [notice] Child 3212: Starting thread to listen on port 80.
[Fri Nov 05 02:17:26 2010] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Fri Nov 05 02:17:29 2010] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 03:35:16 2010] [warn] pid file C:/Program Files/Apache Software Foundation/Apache2.2/logs/httpd.pid overwritten – Unclean shutdown of previous Apache run?
[Fri Nov 05 03:35:16 2010] [notice] Apache/2.2.17 (Win32) configured – resuming normal operations
[Fri Nov 05 03:35:16 2010] [notice] Server built: Oct 18 2010 01:58:12
[Fri Nov 05 03:35:16 2010] [notice] Parent: Created child process 1768
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 03:35:18 2010] [notice] Child 1768: Child process is running
[Fri Nov 05 03:35:18 2010] [notice] Child 1768: Acquired the start mutex.
[Fri Nov 05 03:35:18 2010] [notice] Child 1768: Starting 64 worker threads.
[Fri Nov 05 03:35:18 2010] [notice] Child 1768: Starting thread to listen on port 80.
[Fri Nov 05 03:47:22 2010] [notice] Parent: Received shutdown signal – Shutting down the server.
[Fri Nov 05 03:47:22 2010] [notice] Child 1768: Exit event signaled. Child process is ending.
[Fri Nov 05 03:47:23 2010] [notice] Child 1768: Released the start mutex
[Fri Nov 05 03:47:24 2010] [notice] Child 1768: All worker threads have exited.
[Fri Nov 05 03:47:24 2010] [notice] Child 1768: Child process is exiting
[Fri Nov 05 03:47:24 2010] [notice] Parent: Child process exited successfully.
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 03:47:32 2010] [notice] Apache/2.2.17 (Win32) PHP/5.2.14 configured – resuming normal operations
[Fri Nov 05 03:47:32 2010] [notice] Server built: Oct 18 2010 01:58:12
[Fri Nov 05 03:47:32 2010] [notice] Parent: Created child process 452
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 03:47:32 2010] [notice] Child 452: Child process is running
[Fri Nov 05 03:47:32 2010] [notice] Child 452: Acquired the start mutex.
[Fri Nov 05 03:47:32 2010] [notice] Child 452: Starting 64 worker threads.
[Fri Nov 05 03:47:32 2010] [notice] Child 452: Starting thread to listen on port 80.
[Fri Nov 05 05:02:27 2010] [notice] Parent: Received shutdown signal – Shutting down the server.
[Fri Nov 05 05:02:27 2010] [notice] Child 452: Exit event signaled. Child process is ending.
[Fri Nov 05 05:02:28 2010] [notice] Child 452: Released the start mutex
[Fri Nov 05 05:02:29 2010] [notice] Child 452: All worker threads have exited.
[Fri Nov 05 05:02:29 2010] [notice] Child 452: Child process is exiting
[Fri Nov 05 05:02:29 2010] [notice] Parent: Child process exited successfully.
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 05:02:37 2010] [notice] Apache/2.2.17 (Win32) PHP/5.2.14 configured – resuming normal operations
[Fri Nov 05 05:02:37 2010] [notice] Server built: Oct 18 2010 01:58:12
[Fri Nov 05 05:02:37 2010] [notice] Parent: Created child process 3064
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 05:02:37 2010] [notice] Child 3064: Child process is running
[Fri Nov 05 05:02:37 2010] [notice] Child 3064: Acquired the start mutex.
[Fri Nov 05 05:02:37 2010] [notice] Child 3064: Starting 64 worker threads.
[Fri Nov 05 05:02:37 2010] [notice] Child 3064: Starting thread to listen on port 80.
[Fri Nov 05 05:05:16 2010] [notice] Parent: Received shutdown signal – Shutting down the server.
[Fri Nov 05 05:05:16 2010] [notice] Child 3064: Exit event signaled. Child process is ending.
[Fri Nov 05 05:05:17 2010] [notice] Child 3064: Released the start mutex
[Fri Nov 05 05:05:18 2010] [notice] Child 3064: All worker threads have exited.
[Fri Nov 05 05:05:18 2010] [notice] Child 3064: Child process is exiting
[Fri Nov 05 05:05:18 2010] [notice] Parent: Child process exited successfully.
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 05:05:24 2010] [notice] Apache/2.2.17 (Win32) PHP/5.2.14 configured – resuming normal operations
[Fri Nov 05 05:05:24 2010] [notice] Server built: Oct 18 2010 01:58:12
[Fri Nov 05 05:05:24 2010] [notice] Parent: Created child process 3464
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff] does not exist
httpd.exe: Could not reliably determine the server’s fully qualified domain name, using 192.168.0.2 for ServerName
[Fri Nov 05 05:05:25 2010] [notice] Child 3464: Child process is running
[Fri Nov 05 05:05:25 2010] [notice] Child 3464: Acquired the start mutex.
[Fri Nov 05 05:05:25 2010] [notice] Child 3464: Starting 64 worker threads.
[Fri Nov 05 05:05:25 2010] [notice] Child 3464: Starting thread to listen on port 80.

thanks for your help, phil

phil,

All the “Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff] does not exist” gives a pretty good indication of the problem: You are NOT in the webspace for localhost! That privilege is limited to C:/Program Files/Apache Software Foundation/Apache2.2/htdocs. Until you use the vhost config file to allow use of “localhost domains,” your webpages MUST be within the htdocs directory.

Regards,

DK

both index.html and today.php are in htdocs.

how do i edit the vhost config file to allow the use of “localhost domains” mine lists two virtual hosts that were apparently set up when apache was installed.

is it really possible to do this? i have been at this for days. the book implied such a simple setup.

i appreciate your help.

thanks, phil

also, i don’t have a docs folder in apache2.2 folder as listed in the warning.

thanks, phil

phil,

You don’t need a docs folder. Why are you concerned about that?

Unless you modified httpd.conf, the localhost “webspace” is Apache’s htdocs folder.

VirtualHost setup:

  1. Edit httpd.conf to remove the # from the line including extra/httpd-vhosts.conf

  2. Edit httpd-vhosts.conf using one of the examples in the file

  3. Edit the hosts (extensionless file) to include 127.0.0.1 localdomain

  4. Restart Apache

Regards,

DK

i only mentioned the docs folder as it is listed in the error log as part of the path to the file that couldn’t be found. i’m looking for clues and help. sorry to appear so stupid; it’s just that i have installed and reinstalled many times and gotten help from the apache forums and others with no success.

  1. Edit httpd.conf to remove the # from the line including extra/httpd-vhosts.conf (i did this)

  2. Edit httpd-vhosts.conf using one of the examples in the file
    (i didn’t do this but this is from the httpd-vhosts.conf file.)

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.funstuff
DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff”
ServerName dummy-host.funstuff
ServerAlias www.dummy-host.funstuff
ErrorLog “logs/dummy-host.funstuff-error.log”
CustomLog “logs/dummy-host.funstuff-access.log” common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.funstuff
DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff”
ServerName dummy-host2.funstuff
ErrorLog “logs/dummy-host2.funstuff-error.log”
CustomLog “logs/dummy-host2.funstuff-access.log” common
</VirtualHost>

  1. Edit the hosts (extensionless file) to include 127.0.0.1 localdomain

(don’t know what to do here: how?)

i do appreciate all of the help and usually manage these things fairly well. i will not bother you again if this doesn’t work.

regards, phil

phil,

http://localhost/ should get you Apache’s default “It Works” page. If you attempt to link to a file which is not within your “webspace” (C:/Program Files/Apache Software Foundation/Apache 2.2/htdocs), you SHOULD get 403s!

Think in terms of directories, though, NOT of files (like your code suggests).

  1. Edit httpd.conf to remove the # from the line including extra/httpd-vhosts.conf (i did this)

  2. Edit httpd-vhosts.conf using one of the examples in the file
    (i didn’t do this but this is from the httpd-vhosts.conf file.)

<VirtualHost *:80>
    ServerAdmin [email]webmaster@dummy-host.funstu[/email]ff
[indent]Irrelevant[/indent]
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.funstuff"
[indent]That's ... what?  A directory?[/indent]
    ServerName dummy-host.funstuff
[indent]I prefer NOT to use tlds, i.e., just name that "funstuff" (without the quotes)[/indent]
    ServerAlias www.dummy-host.funstuff
[indent]Ditto[/indent]
    ErrorLog "logs/dummy-host.funstuff-error.log"
[indent]Irrelevant[/indent]
    CustomLog "logs/dummy-host.funstuff-access.log" common
[indent]Irrelevant[/indent]
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email]webmaster@dummy-host2.funstu[/email]ff
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.funstuff"
    ServerName dummy-host2.funstuff
    ErrorLog "logs/dummy-host2.funstuff-error.log"
    CustomLog "logs/dummy-host2.funstuff-access.log" common
</VirtualHost>[indent]Same comments.[/indent]

I think you’re “handcuffing” yourself by stuffing your VirtualHosts into Apache’s docs directory. I’ve had my VirtualHosts on a separate partition for years.

  1. Edit the hosts (extensionless file) to include 127.0.0.1 localdomain

(don’t know what to do here: how?)

C:\Windows\system32\drivers\etc\hosts - and use a TEXT editor (NOT notepad as it’ll force a file extension on this extensionless file).

thanks for your help. the book made a nice fire. what a rip. phil