Need to know something about apache

Discussion in 'Mac Help/Tips' started by ooagentbender, Mar 10, 2003.

  1. ooagentbender macrumors member

    Joined:
    Dec 21, 2002
    #1
    Ok so OS X comes pre installed with apache software, which is awesome. I also installed mySQL and php on my computer. I just want to know what folder im supposed to put my Php files in so that I can view them to make sure they work before I publish them to the web.

    Thanks
     
  2. encro macrumors 6502

    encro

    Joined:
    May 6, 2002
    Location:
    bendigo.victoria.au
  3. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #3
    Not sure about putting them in cgi-bin, but putting them in /Library/WebServer/Documents/ will work.

    Make sure you have PHP enabled in httpd.conf and have restarted Apache.
     
  4. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #4
    OK I know where the folder is now I need to know where httpd.conf is just to make sure its working but more importantly I need to know what the adress is I would put into my web browser to view the files.

    Thanks
     
  5. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #5
    httpd.conf is in /etc/httpd/

    It's a good idea to make a back-up of it when you start making changes.

    You can view the pages on your local machine using these two addresses:
    http://localhost/
    http://127.0.0.1/

    If the pages are in your home directory, simply append "~username" to the URL.
     
  6. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #6
    ok provided that php is enabled for apache which it is beacause I installed php for apache, and I have the files I want to see in library/webserver/documents, then I should be able to view them correct? well it tells me I can't connect to the websever localhost. I started mysql up and everything, so Im a bit confused.
     
  7. jaguarx macrumors regular

    Joined:
    Jan 5, 2003
    Location:
    London
    #7
    sounds like apache isn't running, if mysql was not running you'd get an error when you tried to view the page.

    If you've been screwing with httpd.conf you might get an error log in /var/logs
    if you're lucky.

    127.0.0.1 (same as localhost) in your browser should jsut bring up the 'your site is running' type page, if it does not and you ahve no overwritten it, apache is not running.

    To see if php is running put
    phpinfo();
    in a page, nothing else. (obviously the usual html tags and php tags though)
     
  8. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #8
    ok well that would signal to me that apache is not running, even thought teh mysql server runs

    but my question then is how do I turn on the apache.
     
  9. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #9
    Have you tried the Sharing Pref Pane yet?

    Simply click the button next to "Personal Web Sharing" and you're set.
     
  10. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #10
    score that worked but now I don't know if php is working. I tried out a basic php file and it didn't work so now im kinda wondering what the hell is going on. How do you edit httpd.conf to turn php on.

    Thanks
     
  11. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #12
    Dood I just wanted to let you know your the man and I have php on my comp now so I can learn how to flippin use it. Now I just have to figure out how it works with mysql and all that rubish


    thanks again
     
  12. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #13
    Ok now the next question is:

    Why when I start up mysql does it just sit there. I suspended the operation and then tried to get eh mysql comand propmt but it just sits there.

    AAny ideas
     
  13. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
  14. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #15
    Well if I have mySQL installed on my computer then when I run the server I should get a command prompt after I run mysql. The problem is I don't.

    does that help.
     
  15. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #16
    OK heres some more clarification

    I use the mysql_safe to start mySql up. Then, I suspend the operation with ctrl-z (tell me if any of this is wrong) then I try and run the mysql command in /usr/local/bin to get the command prompt for mysql but it just sits there and doesn't do nuthin.

    Thanks.
     
  16. ooagentbender thread starter macrumors member

    Joined:
    Dec 21, 2002
    #17
    OK well it works, but only if I close terminal and then re open it, then I can run any of the commands that you can use in mysql. Any idea why that might be. Im using X11 to open terminal because I put the terminal icon in the trash before I knew that would delete the app.

    Know where I can download that?
     
  17. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #18
    You should be able to pull it out of the .pkg files on the OS X install CD.
     
  18. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #19
    i'm trying to set up myPhoto and for some reason my personal web sharing will just NOT turn on...it just sits there saying that it is starting up and nothing will happen...i try quitting while this is going on and going back in only to find that it never started up...i also let it run for a few hours...and got nothing...anyone got any helpers???
     
  19. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
  20. Rufus macrumors newbie

    Joined:
    Mar 2, 2003
    Location:
    Wichita, KS
    #21
    Try launching Apache from the command line - it may give you some error messages that tell you what is wrong.

    I don't have the exact instructions here, but you'd basically be starting httpd from a terminal window.
     
  21. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #22
    Here's a good way to launch Apache.

    Use the command "apachectl graceful" to start/restart Apache. Error messages will be displayed telling you of any problems.
     
  22. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota

Share This Page