Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Apache web server with PHP


  • Please log in to reply

#1
wendy k. walker

wendy k. walker

    Member

  • Banned
  • PipPipPip
  • 354 posts
Hi Everyone,

:whistling: I'm not sure if this is the right forum to post this so I won't mind if it gets moved.

I'm having fits trying to set up a web server locally [EDITED: I'm running Windows XP Home Edition with SP2]. I'm trying to get Apache set up but I don't really understand what I'm doing.

First off I'm supposed to make sure that I 'bind' it to 'localhost' only and I haven't a clue as what that means or how to do it.

Second, I'm supposed to setup PHP to use with Apache, however :blink: , every time that I add these two lines to the Apache httpd.conf file, as per instructions, Apache refuses to start until I comment them out again;

LoadModule php5_module "C:/Program Files/PHP/php5apache2.dll"
PHPIniDir "C:/Program Files/PHP"

The instructions said to put those two lines at the top of the httpd.conf file so as it stands right now those are the first two lines in that file but I have to have them commented out for Apache to start so I'm wondering if anyone else has ran into this problem or if maybe I'm doing something wrong.

Thanks for any help.
Wendy

Edited by wendy k. walker, 09 February 2007 - 11:45 PM.

  • 0

Advertisements


#2
thenotch

thenotch

    Member

  • Retired Staff
  • 668 posts
I wrote this up some time ago... might be of assistance... LAMP server configuration...

http://thenotch.geek...lamp/index.html
  • 0

#3
-=blaster=-

-=blaster=-

    Member

  • Member
  • PipPipPip
  • 181 posts
You may want to try Apache, mySQL, and php all rolled into one.

:whistling:
  • 0

#4
wendy k. walker

wendy k. walker

    Member

  • Topic Starter
  • Banned
  • PipPipPip
  • 354 posts
Hi thenotch,

Thanks for the info but I'm running Windows XP so I don't think that will help.

Thanks,

Wendy
  • 0

#5
wendy k. walker

wendy k. walker

    Member

  • Topic Starter
  • Banned
  • PipPipPip
  • 354 posts
Hi -=blaster=-,

I've tried a couple of different packages like that but couldn't get them to do what I need to do so I'm back to installing everything one program at a time.

I've gotten Apache up and running but I still need to know how the heck to 'bind' it to 'localhost only'. That aside, my next problem comes when I try to get PHP to work with Apache.

Shoot, the instructions that I'm following really make it sound simple but the darned things just don't seem to want to work together.

Thanks,

Wendy
  • 0

#6
thenotch

thenotch

    Member

  • Retired Staff
  • 668 posts
You are trying to run a web server on an XP box?

Not a wise move if this is going to be available to the world rather than for testing purposes only.
  • 0

#7
-=blaster=-

-=blaster=-

    Member

  • Member
  • PipPipPip
  • 181 posts
You may just want to setup a Linux box. It's much easier to add php, or any other modules that you may need later.

Any of the Red Hat distros are excellent for this. Fedora and CentOS are my favs.

:whistling:
  • 0

#8
wendy k. walker

wendy k. walker

    Member

  • Topic Starter
  • Banned
  • PipPipPip
  • 354 posts
Hi -=blaster=-,

What? You really want me to go insane here dontcha? Shoot I have no Idea what I'm doing just trying to install a web server and you think I could change my whole OS? I know that would push me over the edge and have me running down the street naked.

Hi thenotch,

Yeah that's what I'm trying to do that's why I need to bind it to localhost only so that it won't be publicly accessible.

I'm struggling to understand everything that I'm reading on how to accomplish this but even though the instructions seem to be simple they weren't written in 'dummy code' so it's forcing me to learn by lots of trial and error.

Question: Will Listen 127.0.0.1:80 or Listen 127.0.0.1:8080 bind the server to the localhost and keep the server from being accessible to the public?

Thanks,

Wendy
  • 0

#9
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Would this be of any help to you?

Binding to Localhost

or

Configuring Apache to listen on specific addresses and ports

Lastly...

Loopback address range may not work as you expect in Windows XP Service Pack 2

These may be as confusing as the instructions you have.

Ron.

Edited by Major Payne, 10 February 2007 - 06:40 PM.

  • 0

#10
wendy k. walker

wendy k. walker

    Member

  • Topic Starter
  • Banned
  • PipPipPip
  • 354 posts
Hi Major Payne,

Thanks for the links. #1 and #3 kind of sprained my brain but #2 was kind of understandable. I've been doing a lot of reading on those Apache pages for the past couple of weeks and kind of piecing things together as I go.

So this is what I get from reading #2 --> if I set 'listen' to Listen 127.0.0.1:80 then I am in effect binding Apache to localhost on port 80 and nothing else<-- is that correct?

Now if that is correct is Apache still accessible publicly after I set it that way or would I have to use a different port like maybe 8080 to bind it to localhost and keep it from being accessed publicly?

I want Apache to be a functional server capable of receiving and servicing requests and not just usable for development BUT I don't want it to be accessible by everybody and their kids that hang out trolling the web. If that makes any sense to you.

Thanks for your time,

Wendy
  • 0

Advertisements


#11
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Hi Wendy:

I'm getting a brain strain too as I've never played with Apache. :whistling: I know it is a pain when things are not in step-by-step, plain English instructions. Here's a site that explains a lot about Security, but does not tell you how. It might help all the other stuff in your head come together and make sense: Apache Security. I didn't check out the other links at top left corner.

This on Apache 2 with step-by-step instructions and examples. I have no idea if this will help either.

You might be able to restrict port access via your firewall, say, 80, if you use 127.0.0.1:80 or chmod the directory in which you have apache (root?). I'm beyond my depth here, Wendy, since I have nothing to experiment with. Maybe some one with very good experience will come along and provide simple to read and use instructions.

Ron
  • 0

#12
wendy k. walker

wendy k. walker

    Member

  • Topic Starter
  • Banned
  • PipPipPip
  • 354 posts
Hi Major Payne,

*shoving big bottle of aspirin over to Ron* Thanks for trying Boo. It's really rough on me because I have no clue as to what most of the stuff that I'm reading means, BUTT I'm a persistent little cuss as my grand dad says.

I'm figuring things out via a lot of trial-n-error as I go. Thanks for putting up those links. I'll give them a shot and let you know how things turn out.

Thanks again for your time Boo.

♥ Wendy
  • 0

#13
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Hi:

Thanks for aspirin. Wish I could be there to help out. Would be good learning experience. There's several ways to disallow people from getting to any directory by using a .htaccess file, but how to set up the list for authorized users in Apache, which is probably what you want, is beyond me at this point.

Let me know if you need more aspirin. Just bought a new bottle of 100 tablets. Thinking of getting the super size---55 gallon drum!

PM me if you figure it all out and post back here with your solution if you would.

Ron
  • 0

#14
thenotch

thenotch

    Member

  • Retired Staff
  • 668 posts
Is this a standalone system or your desktop that you use for everyday internet use?

If it is a standalone reinstalling the OS to Linux is a piece of cake and free...

If it is your desktop you are asking for serious trouble by trying to run a webserver off of it. I wouldn't even attempt to help if that is the case because you are opening up a really big can of worms and it could get quite ugly. If you are that unfamiliar with running a webserver you are going to have zero clues on how to secure it and your entire computer will ripe for the picking by hackers and spammers. You would in effect be contributing to the problem that currently plagues the internet.

Sounds very dramatic, but it is true. Running a webserver just because you can on your desktop is asking for nothing but trouble.

If you need help with setting up a standalone Linux box I would be more than happy to assist...
  • 0

#15
wendy k. walker

wendy k. walker

    Member

  • Topic Starter
  • Banned
  • PipPipPip
  • 354 posts
Hi Everybody,

I have installed an Apache web server and downloaded PHP. Now I need to figure out how to make the two work together.

OK, this is what I'm looking at --> To configure PHP copy php.ini-dist which is in the PHP src directory to /usr/local/lib/php.ini <--

Question: What is a scr directory? I have PHP at "C:\Program Files\PHP" and that's where I found the file php.ini-dist but I don't see anything called 'scr'.

Next Question: Where the heck do I look for that thing called "/usr/local/lib/php.ini"?

I know that that is at least part of a path that would get me to php.ini but I can't find anything that even remotely resembles that path. I currently have the php.ini file located at "C:\Program Files\PHP\php.ini".

So is there anyone out there that can explain this stuff to me?

Thanks,

Wendy
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP