PDA

View Full Version : Having trouble installing apache 2.2.4 on my mac os x


RiseRobotRise
03-02-2007, 09:45 AM
I'm following this manuel

http://httpd.apache.org/docs-2.2/install.html

okay, so I download the file okay, and I extract the contents, so now everything opens up, until I hit this brick wall that I've been hitting for the past 4 hours.

this step is known as
"Configuring the source tree"

it says "This is done using the script configure included in the root directory of the distribution."

So I click on the only thing thats named "configure"

and when I do so, this message comes up says "no default application specified to open the document 'configure'"

I assume that mabye the only way to open it up is to use the "terminal" on the mac.

So I do

this is what pops up

/Users/RRR/Desktop/httpd-2.2.4/configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... i386-apple-darwin8.8.1
checking host system type... i386-apple-darwin8.8.1
checking target system type... i386-apple-darwin8.8.1

Configuring Apache Portable Runtime library ...

checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... i386-apple-darwin8.8.1
checking host system type... i386-apple-darwin8.8.1
checking target system type... i386-apple-darwin8.8.1
Configuring APR library
Platform: i386-apple-darwin8.8.1
checking for working mkdir -p... yes
APR Version: 1.2.8
checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
configure failed for srclib/apr

okay, so now I'm confused. Why dosn't it work?

just to make sure nothing goes wrong, I type it ./configure (its what the documentation told me to type)

this is what comes up

my-macintosh-computer:~ RRR$ ./configure
-bash: ./configure: No such file or directory


okay, so thats where I've been for the past few hours. I don't know what to do.

I guess I'm missing something, I've looked far and wide on the internet for any clues, and I'm still stuck. :mad: :mad: :mad: :mad:

can anyone give me some awnsers?

_Aerospace_Eng_
03-02-2007, 09:48 AM
You might be making this harder than it has to be. Are you trying to install apache for testing scripts locally? If thats the case then look into XAMPP.

http://www.apachefriends.org/en/xampp.html

Its an installer that installs apache, php, and mysql.

firepages
03-03-2007, 01:27 AM
You have no build tools, specifically here no C compiler but thats just the start you will also need other build basics like bison, automake, flex etc.

I don't know anything about osx .. on most flavours of linux you would download the appropriate packages , some distros make it real easy, debian has a package called build_essential which contains the main tools.

So for debian `apt-get install build_essential` would download most of what you need, I don't know how that translates to osx ? does it have a package manager ?

RiseRobotRise
03-04-2007, 10:26 PM
hmmmmmmm

I think that with os x, you wouldn't really need to download any special tools. I'm giving xampp a try as aerospace_eng suggested, things so far are going along okay, I just had to climb over a few big obstacles, right now its installed okay, and the localhost thing works, I'm just trying to find a way to view my local php files (the only reason why I need a local server is to test my files, before I put it up online).

Finding help with xampp, on apachefriends.org is somewhat difficult, because the site, and the program are mainly used my german speakers.

If this doesn’t work, than I'm going to try to download apache, and php for mac again, and I'll try to do everything over.

I wanted to post this message on a Mac site, but I couldn't find any Mac sites to post it on.

If I have to go back to step one, I'll try looking harder for mac-php sites with online web forums, hopefully I'll be able to get help there.

Thanks

_Aerospace_Eng_
03-05-2007, 01:11 AM
Locate the htdocs folder in the xampp installation folder. This is where you put your own php files. I prefer making a new folder in the htdocs folder. For example if you made a folder called testing and wanted to access test.php inside of testing then you would navigate to
http://localhost/testing/test.php

firepages
03-05-2007, 04:22 AM
hmmmmmmm

I think that with os x, you wouldn't really need to download any special tools.

As your ./configure message states you have not got a compatible c compiler installed & you wont be able to compile a ham sandwich without one ;)

RiseRobotRise
03-05-2007, 06:00 AM
firepages: none of the tutorials stated that I needed to download any tools, so I just assumed that I didn't need any

Aero_eng: is there a way I can redirect xampp so it would view everything within my documents folder? you can take a look at the thread I posted over there
(http://www.apachefriends.org/f/viewtopic.php?t=23432)

apparntly I need to use "mod-userdir" in Apache Modules, but when I try to access it, it says

my-macintosh-computer:/Users/RRR root# /Applications/xampp/xamppfiles/modules/mod_userdir.so
su: /Applications/xampp/xamppfiles/modules/mod_userdir.so: Permission denied

support there is kinda limited since its mainly a german site.

_Aerospace_Eng_
03-05-2007, 08:12 AM
Personally I would go directly to the file and open it with textedit. It seems you are having too many issues with the command line. Don't make things harder than they have to be.

RiseRobotRise
03-05-2007, 10:14 AM
I opened the file up in text edit, I just got unreadable garbled hieroglyphics.

I'm still waiting for an answer on the apache friends forum, but response time is usually slow, since there are a limited number of people who are able to help.

I made a test folder in the htdocs folder, and put a simple php file in there.

I found out that I can only view the file correctly by typing the location under a localhost directory

exp: "http://localhost/test/hello.php"

not by opening up the file itself, its a little annoying but I'll get used to it (I guess thats how apache generally works).

also, is there a way to have xampp start apache automatically when I turn on my computer ?

_Aerospace_Eng_
03-06-2007, 05:27 AM
Yes well there is on windows. Should be similar on a Mac. Open up the XAMPP control panel. The thing you use to start apache and all that jazz. Next to it should be a check box called svc. Check it. This will install apache as a service that should start up automatically each time your computer boots up.

RiseRobotRise
03-06-2007, 06:18 AM
hmmm, didn't find any box called svc. ( guess they didn't implement it for the mac)

I guess I have to manually start it everytime.

I have a few problems with xampp, and their mac support is very limted (especially in english). I'm going to give a break right now, and I'll try installing apache and php on top of it again, without any bundled packages.

The main mac support guy told me he can't really help me with the problem that I have unfortuantly :(

Well I'm going to keep it mind, If I ever want to go back to it, at least I know its there.

thanks!

RiseRobotRise
03-07-2007, 11:39 AM
As your ./configure message states you have not got a compatible c compiler installed & you wont be able to compile a ham sandwich without one ;)

hey firepages, you were absolutely super beyond correct.

I wasn't able to do it without some type of tool. Now I understand what you were talking about.

There is a developer tool included in the Mac OSx cd called "Xcode (http://www.apple.com/macosx/features/xcode/)"

its not installed automatically with the cd itself, it has to be installed manually by the user (probably because the thing is about 2.5 gigs and most people would have no use for it).

Well, I installed it, and everything went along smoothly until... I decided to start Apache. This is what came up:


AngryRobot:~/Desktop/httpd-2.2.4 RRR$ /Users/RRR/Local/bin/apachectl -k start

(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs


I have no idea what I did wrong there.
I don't know of any programs that's using the port: 80.

I think there's some unix code out there that would let me find out. I'm trying to find an answer.

firepages
03-07-2007, 02:26 PM
Sounds like there is already a webserver or something running on your system on port 80 ... what do you get if you nav to http://localhost ?

If there is another server running try `netstat`command which may help you figure out what is running on port 80.

you can always change the port in httpd.conf (or apache2.conf) to say 8080 and see if that works.

gsnedders
03-07-2007, 07:32 PM
No, as it says, "permission denied". For binding ports within the reserved range, you must have root permissions.

ghell
03-07-2007, 07:48 PM
yea, osx is unix based and ports 0 - 1023 are privileged ports which can only be bound to by administrative users (eg root)

you can install gcc (the compiler it needs, which is nowhere near the size of XCode) without installing Xcode if you want to free up all that space that XCode is wasting. It needs a compiler because you downloaded the source code of the application not the binary so it needs to compile the source into binary before it can run it.

To get the apache daemon started automatically you need to start it as a service/daemon. You should be able to add it post-install as well. I have no idea how to do this on osx because I only use windows and linux.

by the way ./configure is used from the terminal, from the directory that the file "configure" is located in, and the file must have execute permissions (i assume you can go to the directory and do "chmod +x configure" if it doesn't)

RiseRobotRise
03-07-2007, 09:07 PM
I got to work, for some reason it only accepts the command after I type in the command "sudo su"


Last login: Wed Mar 7 11:46:49 on console
Welcome to Darwin!
AngryRobot:~ RRR$ /Users/RRR/Local/bin/apachectl -k start
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
AngryRobot:~ RRR$ sudo su
Password:
AngryRobot:/Users/RRR root# /Users/RRR/Local/bin/apachectl -k start
AngryRobot:/Users/RRR root#


then I go to http://localhost

and I get the apache defualt page that says "It Works!"

I'm not sure why I have to do "sudo su". None of the tutorials mentions this at all.

Now I have to install php on top of apache, and figure that out.

I'm kinda confused on why it won't do anything unless I use the "sudo su" command.

ghell
03-10-2007, 12:26 PM
As we said, ports 0 - 1023 are privileged ports on unix based systems. You need to have administrative level access to assign applications to those ports.

"sudo" is the command on ubuntu to temporarily gain root access (typically for a single task by default so you could have just done "sudo /Users/RRR/Local/bin/apachectl -k start" and entered your password. (I use fedora where sudo is typically done by using "su -" and entering a password, and if I only want to sudo a single command I do "su -c'command goes here'")

becauses you are using sudo, the prompt has changed from $ to #, indicating you are running a terminal as root.

(root is the administrative level user by the way)

On linux you will need to use sudo for a lot of things (anything that makes changes to the system), gui apps that need root access like the package updater simply ask you for your root password when they run.

The reason for this is so that you can't accidentally make changes to the system, and malicious users can't either. (For example, if you contract a virus, it can't make any changes without the root password which you have to manually enter) This is why you shouldn't (but can) simply log in as "root" with your root password (which is pretty much what you are doing on windows xp as an adminstative account, which you have to do if you want to actually get anything done. Vista takes an approach similar to sudoing)

the-dream
03-12-2007, 03:44 PM
Dude!

Just use MAMP

you get:
Apache
MySQL
PHP

and it built for the mac + its free

Just google MAMP

it stacds for Mac Apache MySQL PHP