Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RickRandom

macrumors newbie
Original poster
Dec 1, 2005
25
0
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?

well..

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 (http://www.rbsoftware.net/index.php?page=wsxk) 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 :)
 

Punkwaffle

macrumors regular
Apr 12, 2004
204
5
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).

MAMP
 

RickRandom

macrumors newbie
Original poster
Dec 1, 2005
25
0
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 no-ip.com and when i set my external ip as the address i get my router config page.. how do i redirect this?
 

Punkwaffle

macrumors regular
Apr 12, 2004
204
5
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.
 

tag

macrumors 6502a
Apr 29, 2005
918
9
RickRandom said:
well..

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.

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.

http://httpd.apache.org/docs/1.3/misc/FAQ.html#redhat-htm
http://www.faqts.com/knowledge_base/view.phtml/aid/9838/fid/56


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.
 

RickRandom

macrumors newbie
Original poster
Dec 1, 2005
25
0
tag said:
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.

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.
 

RickRandom

macrumors newbie
Original poster
Dec 1, 2005
25
0
tag said:
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.

http://httpd.apache.org/docs/1.3/misc/FAQ.html#redhat-htm
http://www.faqts.com/knowledge_base/view.phtml/aid/9838/fid/56

I changed text/plain to text/html but I can't find anything similiar to lines

AddModule mod_mime.c
LoadModule mime_module modules/mod_mime.so
or
TypesConfig

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 ?
 

OutThere

macrumors 603
Dec 19, 2002
5,730
3
NYC
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:

http://www.entropy.ch/software/macosx/php/

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

http://dev.mysql.com/doc/mysql/en/Mac_OS_X_installation.html

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

http://www.php.net/
 
L

littlejim

Guest
I'll just add a suggestion too :

webmin

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!
 

RickRandom

macrumors newbie
Original poster
Dec 1, 2005
25
0
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
 

belvdr

macrumors 603
Aug 15, 2005
5,945
1,372
RickRandom said:
I changed text/plain to text/html but I can't find anything similiar to lines

AddModule mod_mime.c
LoadModule mime_module modules/mod_mime.so
or
TypesConfig

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 ?

In httpd.conf, if you have a line like:
Code:
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:
Code:
text/html                       html htm

I've never had the OS X installed Apache server act this way by default.
 

RickRandom

macrumors newbie
Original poster
Dec 1, 2005
25
0
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 :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.