Setting up a webserver

Discussion in 'Web Design and Development (archive)' started by RickRandom, Dec 1, 2005.

  1. macrumors newbie

    Dec 1, 2005
    Hi ya'll

    I'm running on PowerBook os x 10.4 and the situation is this, I need a selfhosted server or well, I want to test setting it up So I was gonna set up an Apache on PC (yeah..) but why bother when i can use the os x built in one, right?


    I got the built in apache running except it won't show html files written with html. It just shows the code. I just wrote a textfile saying ie hello and saved that as a html and it showed ok, but i'd also like to get some code to my page you know :D I heard this might be an ISP problem that they won't let me host webpages, could it be? Also trying to share i.e pics i get 403 forbidden error. (don't have permission to access..) this I been told is a Apache module configuration error? I'm also behind a router, 5 comps sharing the connection so how does the ip addressing work in this case? Help appreciated.

    And the problem continues..

    I read about this Web server X kit and decided to give it a try ( Don't know if this is any good? And i can't get the manuals working. Those are in html/php format and show up as messed up code in Safari and Firefox, only way to make some sense is to open it in Adobe illustrator :confused: and when trying to access phpMyAdmin in the location that the program suggests (localhost/...) I get "not located on this server error" I couldn't find too much info about setting up and configuring this app so any config help sure would come in handy..

    So basicly what i'm trying to ask here is what's the best way to set up a small server on powerbook, less than 10 users nothing fancy just basic apache with php and mySql and how to get it working trough NAT/router?

    Thanks for any help, sorry for the long post :)
  2. macrumors regular


    Apr 12, 2004
    For quick testing you should download and install MAMP.
    It's just about the easiest way to test a site with server-side technology, and is fully integrated with OS X (even has a dashboard widget).

  3. thread starter macrumors newbie

    Dec 1, 2005
    Sounds great! downloading it now. Do i need to configure the router to redirect incoming traffic to my server machine's internal ip if i set the shared external ip as dns address for the server? I'm using a free dns from and when i set my external ip as the address i get my router config page.. how do i redirect this?
  4. macrumors 603


    Jul 23, 2002
    Fuquay Varina, NC
  5. macrumors regular


    Apr 12, 2004
    i'm not so good with all that port configuring. i'm sure you will need the airport utility. hopefully someone can post a solution, I wanted to do this for a while also.
  6. tag
    macrumors 6502a


    Apr 29, 2005
    PA, US
    In regards to this problem, I have heard of this problem before complained by a few people. It has to do with apache not having its MIME types correctly set up. Here are two sites which offer some advice on fixing the problem, though these are for linux systems, but they would be the same for windows, just a different file structure, so you'll have to find the locations of the files yourself (ie. httpd.conf, mime.types ...) since I don't know them off hand..

    So you'll have to check that the correct MIME type is listed in mime.types and that all of the mime modules are loaded at runtime... More exacting info at below sites.

    Also you said you were getting 403's trying to share pics. Your sharing the pics via apache directories? Did you check to see that you have the correct permissions for the photos? try giving the photos a quick 'chmod' and make sure they are accessable to the outside.
  7. thread starter macrumors newbie

    Dec 1, 2005
    yes, thank you! Got the pics working there was a no entry setting for outsiders, didn't even think of that :eek: I'll try that mime thing now.
  8. thread starter macrumors newbie

    Dec 1, 2005
    I changed text/plain to text/html but I can't find anything similiar to lines

    AddModule mod_mime.c
    LoadModule mime_module modules/

    from my httpd.conf/mime files.. I also checked the mime.types and the line text/html already had html and htm.. what did i do wrong ?
  9. macrumors 603


    Dec 19, 2002
    To get pages that are written in PHP to show up correctly you have to install PHP on your computer. You can get install packages here:

    Then to get MySQL to work, you have to install and configure it. Mac OS X Packages of MySQL are available here:

    PHP will work pretty much right out of the box, but MySQL will sometimes require a bit more config-file tweaking to get it to work correctly. This is relatively easy to do, and there are instructions for MySQL at the download page, with instructions for PHP install/config available at
  10. Guest

    I'll just add a suggestion too :


    I use to help me configure apache without delving into the .conf files too often. And's it helped me find problems on more than one occasion.
    Webmin can also help set up postfix, mysql, DNS and squillions of other things!
  11. thread starter macrumors newbie

    Dec 1, 2005
    got the port forwarding working now :p making new Reserved Mapping with external ip - internal ip - type tcp - and port 80 directs people to my server... for now at least. hope it works

    html/htm files still not working. Trying to solve that next
  12. macrumors 601

    Aug 15, 2005
    In httpd.conf, if you have a line like:
    TypesConfig /etc/apache2/mime.types
    then your MIME types are in the file listed. Your MIME types may be listed in the httpd.conf file itself as well:
    text/html                       html htm
    I've never had the OS X installed Apache server act this way by default.
  13. thread starter macrumors newbie

    Dec 1, 2005
    ok problem solved! turns out those htm i added to conf file were enough but the text editor added some weird code on its one to the source when saving to html format. so I saved it as text only and renamed the file to html from txt. now it works, didn't even think of looking at the source at the beginning :rolleyes:

    just one thing remains and it's not really a problem, but when i try to access the dns of my server from inside the lan i get the router config page so i'd like to get nat loopback turned on. i have telewell tw-ea715 router and was just wondering how to do that, it's not mentioned in the settings, so i guess that means telnetting in?

    thanks guys for all your help :)

Share This Page