 |
 |
Tutorial: Installing Apache 2, PHP 5, MySQL 5, and phpMyAdmin on OS X (Page 2)
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Have you tried compiling your own copy through Fink or Macports?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2007
Status:
Offline
|
|
As I am a few months away from upgrading my computer I haven't had to worry about leopard yet, but when the time comes I will go through this process again. You could try this method (which I cannot verify)
Good Luck
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Aug 2005
Location: fairbanks AK
Status:
Offline
|
|
|
|
|
Earth First! we'll mine the other planets later.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2007
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Hi and hello,
I've tried the fourth time now to install Apache strictly after this tutorial. But after installation of MacPorts and Apache (worked) port-command isn't possible to activate again. Restart - nothing... What is wrong?
Please note: I am a total newbie with Terminal.
I think the mistakes are at this point - Tavilach wrote:
…If you are using a bourne shell (Panther and Tiger by default uses
bash) add the following line to your ~/.profile file. If the file
does not exist create it.
export PATH=/opt/local/bin:$PATH
And he wrote:
To make starting and stopping Apache 2 a little easier, we will construct an alias to Apache 2's apachectl. Add the following line to ~/.profile (Panther/Tiger) and restart the terminal to gain access to it:
alias apache2ctl='sudo /opt/local/apache2/bin/apachectl'
Sorry - I open the file - nothing has written in it? What the hell is wrong? I think he assumes a procedure before that he not mentioned.
Please help! I am trying this to do more than 30 hours! And I find no solution.
Thank you in advance
radulph
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Can you please be more clear as to what you are trying, and what is going wrong? Are you getting an error message? Have you tried the apachectl command manually?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Originally Posted by besson3c
Can you please be more clear as to what you are trying, and what is going wrong? Are you getting an error message? Have you tried the apachectl command manually?
There is in general always this message: command not found.
The problem is how I manipulate invisible .profile-file? Note I am an absolutely novice to terminal.
For example: I installed MacPorts from source (yes I learned this). I tried command "port sync". Nothing. Then I typed in export PATH=/opt/local/bin:$PATH. It worked. But why? In the tutorial from tavilach is written: l"put this line into .profile". But how? It is invisible.
(Sorry I can create not an an exactely report for you because I don't understand the marsianic words and abbreviations.)
Then (after other problems) I installed apache. At 2.3 I typed in alias apache2ctl='sudo /opt/local/apache2/bin/apachectl' and nothing worked. And the tutorial said at second: Put this into .profile-file.
Now I installed mysql. After I typed mysqladmin terminal says again: command not found.
If you mean apachectl start - I tried it with no answer form terminal. I restart my computer. And now it is shown this:
Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/+entropy-php.conf
fopen: No such file or directory
httpd: could not open document config file /private/etc/httpd/users/+entropy-php.conf
/usr/sbin/apachectl start: httpd could not be started
OK - I understand: This is the Apache 1.3 from original system. He isn't working too. Maybe due a command from tutorial? (entropy-php was an old alias - I deleted it.)
So I have now two problems: neither Mac OS X Apache is working nor MacPorts Apache2 is working. (And the people who recommended MacPorts to me said it is so easy - what a joke.)
It is just a tricky technique. Could you help? I think the main problem is how I work with this invisible file and alias-commands.
Thank you
rakader
(Last edited by rakader; Jan 4, 2008 at 05:11 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
I can help.
It sounds like there is a more fundamental misunderstanding here holding you back... Let me see if I can't explain this:
In a Unix environment, as you know, every single command you issue is actually invoking a small binary application. The command "ls", or "cd", or "pwd" are actually all very tiny applications. Unix systems are based on a bunch of very tiny and brain dead simple applications working cooperatively together, and accepting input and data in a very consistent way as to interoperate in a completely predictable and consistent fashion. The fact that the basic design of a Unix system has been around for so many years and is still the gold standard speaks volume to how well thought out it actually is.
Anyway, since everything is a binary file, your Unix environment needs to know where these commands live. /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, and /usr/local/sbin are the common paths for these binaries in a Unix system, each of these paths are used for different purposes in an organization sense. By default, you will often find that /bin, /sbin, /usr/bin and /usr/sbin are already a part of your Unix "path". With these directories in your path, you know you can type in:
ls
and have that work rather than having to type in:
/bin/ls
A path is basically a way of telling your Unix environment "look here for applications" to save you from having to type out the full path. If you wanted to, you could have nothing in your path and just type out the full path name each time you needed to invoke a command, and this would work just fine.
Macports installs stuff into /opt, which is not in a standard Unix path. This means that you will need to add /opt/local/bin and /opt/local/sbin in your path if you want to save yourself some extra typing. The reason you are getting "command not found" is because these applications are either not in your path because these directories haven't been added to your path, or because your path is set correctly but these applications literally do not exist.
To find out for sure, try this:
/opt/local/bin/port -v selfupdate
This will tell the "ports" command that is a part of Macports to update its awareness of what Unix open source applications it is aware of.
Absolutely everything in Macports is "sandboxed" into /opt. Adding /opt into your path (by adding it to the .profile/.bashrc/.cshrc files or typing out export ...) is actually an optional step, you don't really have to do it, it is for your convenience.
Now, the reason why you are getting the errors in starting Apache is because it looks like you are confusing Macports installed stuff with Apple installed stuff. *Nothing* that is installed by Macports will be in /usr, this is all Apple's stuff. In your case, it looks like you updated PHP using the binary installer from the entrophy site? Therefore, when you have restarted Apache you were starting up the Apple/Entrophy version. Is that your intention? If not, try a:
sudo /opt/local/sbin/apachectl start
to startup the MacPorts Apache.
Does this help?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Dear Besson,
at first thank you a lot for your help and time!
Originally Posted by besson3c
I can help.
To find out for sure, try this:
/opt/local/bin/port -v selfupdate
This will tell the "ports" command that is a part of Macports to update its awareness of what Unix open source applications it is aware of.
Absolutely everything in Macports is "sandboxed" into /opt. Adding /opt into your path (by adding it to the .profile/.bashrc/.cshrc files or typing out export ...) is actually an optional step, you don't really have to do it, it is for your convenience.
Now, the reason why you are getting the errors in starting Apache is because it looks like you are confusing Macports installed stuff with Apple installed stuff. *Nothing* that is installed by Macports will be in /usr, this is all Apple's stuff. In your case, it looks like you updated PHP using the binary installer from the entrophy site? Therefore, when you have restarted Apache you were starting up the Apple/Entrophy version. Is that your intention? If not, try a:
sudo /opt/local/sbin/apachectl start
to startup the MacPorts Apache.
Does this help?
It doesn't help! Terminal answered "command not found". I looked into folder sbin: It is empty!
Also I am able to start MacPorts ONLY if I type in Terminal app
export PATH=/opt/local/bin:$PATH
Otherwise Terminal reports: unkwnom command.
From the tutorial:
If you are using a bourne shell (Panther and Tiger by default uses
bash) add the following line to your ~/.profile file. If the file
does not exist create it.
export PATH=/opt/local/bin:$PATH
So my conclusion is: The file .profile and its manipulation is obligate!
I only have a file named .profile.swp
Is that OK that I'm always maust using this cryptical command to use every function of opt/local? If yes, it would a theme for trash.
Ok second:
But there is a apachectl in this folder (created by MacPorts): /opt/local/apache2/bin/apachectl.
So I worked with this path and terminal answered: httpd (pid 70) already running
Please can you explain HOW I adding the commands tavilach recommended into .profile? This is the problem file!!! It is invisible.
Then I want to delete the whole installation and try it again.
apache2 and so on only makes sense for me if it would start automatically after reboot.
At second now I tried to activate Personal Web Sharing in Sharing item. I can not activate. I think there is something damaged.
But I think this is not a technique for my private use. I'm a little bit demoralized.
Thank you
rakader
(Last edited by rakader; Jan 4, 2008 at 08:18 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Let's back up a few steps... What are you trying to use MacPorts for exactly? Do you understand that MacPorts and Personal Web Sharing provided by Apple are mutually exclusive? They do *not* work with each other... Are you trying to install a Macports version of Apache? What is your main objective here?
My mistake about providing the wrong path to the Macports version of apachectl (I didn't have it installed on the machine I was on). If httpd is already running, is this the Apple provided Personal Web Sharing version, or the Macports version? You can't have both running on the same port at the same time.
So, which is it? Apple Apache or Macports Apache?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Sorry for the confusion. It is a result due five (!) fruitless attempts installing and activating Apache, MaySQL and PHP with/through MacPorts. I understand the difference between Mac OS X Apache and MacPorts Apache.
During this time I have repaired Mac OS X Apache; it was damaged too.
What I want is to start Apache2 (MacPorts) and MySQL automatically. And I want it to use the Apple defined folder /User/Sites.
This works right now!
But I have additional questions and some non-ciritical points:
After I put the lines below with pico (I learned it a little bit) into .profile it seems that someone works better than before. I put into .profile:
export PATH=/opt/local/bin:$PATH
alias apache2ctl='sudo /opt/local/apache2/bin/apachectl'
alias mysqlstart='sudo mysqld_safe5 &'
alias mysqlstop='mysqladmin5 -u root -p shutdown'
1. Could you confirm that this is OK? Putting the first line into invisible file .profile was the main problem. Maybe it is a good idea to emphasizet this in the tutorial.
2. If I type in localhost/~myname the Browser shows me that Apache2.2.6 is running. Does there exist an opportunity to type in localhost or IP only?
How can I check in Terminal app if Apache2 Server is running? (Note: The diacritic letter ~ is on a german keyboard very uncomfortable.)
The right path must be /opt/local/apache2/bin ->apachectl
2a Does there exist an opportunity to turn off/on without terminal - maybe a script?
3. mysqladmin responds "command not found". There is a mistake in the tutorial!
The correct command is (now)
mysqladmin5 -u root password [yourpw]
It works here fine with sudo -v. Without there is an error message "access denied".
4. How can I check if MySQL is running?
5. After reboot and two times refresh phpadmin works fine. But if Itype in http://localhost/phpmyadmin there are several unsolved lines for the first time. After a refresh it is ok. Do you know what is wrong?
Thank you and: happy new year
rakader
(Last edited by rakader; Jan 5, 2008 at 09:30 AM.
(Reason:Main problems solved))
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by rakader
But I have additional questions and some non-ciritical points:
After I put the lines below with pico (I learned it a little bit) into .profile it seems that someone works better than before. I put into .profile:
1. Could you confirm that this is OK? Putting the first line into invisible file .profile was the main problem. Maybe it is a good idea to emphasizet this in the tutorial.
It looks good, but I just want you to understand that those are shortcuts for your convenience, and nothing more.
2. If I type in localhost/~myname the Browser shows me that Apache2.2.6 is running. Does there exist an opportunity to type in localhost or IP only?
How can I check in Terminal app if Apache2 Server is running? (Note: The diacritic letter ~ is on a german keyboard very uncomfortable.)
The right path must be /opt/local/apache2/bin ->apachectl
If you type in localhost or your IP only as your document root, it will serve files out of whatever is specified as your DocumentRoot in your httpd.conf file.
You can check to see that Apache is running in your terminal by doing this:
ps aux | grep http
(if that doesn't turn up anything, try ps aux | grep apache)
ps aux = show all running processes using the arguments "a, u, and x", and the | grep means "take this list and search for http, don't show me anything else but these lines"
2a Does there exist an opportunity to turn off/on without terminal - maybe a script?
Your apache2ctl command will start/stop/restart Apache:
sudo apache2ctl stop
sudo apache2ctl start
sudo apache2ctl graceful
4. How can I check if MySQL is running?
You can do a:
ps aux | grep mysql
or try connecting to the MySQL server via the included MySQL client:
mysql5 -u root -p
(this will try to connect to the server using the default host "localhost", using root as the username, and will prompt for root's password.
If you cannot get connected, the server may not be running (there may be other reasons though as well)
5. After reboot and two times refresh phpadmin works fine. But if Itype in http://localhost/phpmyadmin there are several unsolved lines for the first time. After a refresh it is ok. Do you know what is wrong?
I don't understand what you mean by "unsolved lines"
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Dear Besson,
Originally Posted by besson3c
It looks good, but I just want you to understand that those are shortcuts for your convenience, and nothing more.
first of all thank you a lot for your help. Yes, I understand, that this are shortcuts. It was MY mistake don't type in the predefined path. But sometimes you have an idea in your mind and run with the head through the wall.
But at least I'll think it was good for the very first learning  I tested also MAMP with a nice little interface, but I'm prefering the MacPorts version now.
If you type in localhost or your IP only as your document root, it will serve files out of whatever is specified as your DocumentRoot in your httpd.conf file.
I understand.  I think this is an aboluteley advance belonging MacPorts, because I'm not chained to one specific folder like MAMP. I'll think with a little more experience I'm able to change my favorite destinations.
You can check to see that Apache is running in your terminal by doing this:
ps aux | grep http
(if that doesn't turn up anything, try ps aux | grep apache)
ps aux = show all running processes using the arguments "a, u, and x", and the | grep means "take this list and search for http, don't show me anything else but these lines"
Thank you, this is very helpful. I understand, that the sign "|" is like threads on a string (sorry for my english).
Your apache2ctl command will start/stop/restart Apache:
sudo apache2ctl stop
sudo apache2ctl start
sudo apache2ctl graceful
You can do a:
ps aux | grep mysql
or try connecting to the MySQL server via the included MySQL client:
mysql5 -u root -p
(this will try to connect to the server using the default host "localhost", using root as the username, and will prompt for root's password.
If you cannot get connected, the server may not be running (there may be other reasons though as well)
Very fine! It works.
I don't understand what you mean by "unsolved lines"
I meaned lines of error reports when starting up phpMyAdmin like this:
Warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/phpMyAdmin/libraries/Config.class.php(377) : eval()'d code:1) in /Library/WebServer/Documents/phpMyAdmin/libraries/core.lib.php on line 605
Warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/phpMyAdmin/libraries/Config.class.php(377) : eval()'d code:1) in /Library/WebServer/Documents/phpMyAdmin/libraries/auth/cookie.auth.lib.php on line 109
And after a refresh it is OK again. This will happen in Safari. Firefox, IE and Opera are not able to show phpmyadmin start page. (It seems thy prefer Bonjour.) I'm using the all languages version of PHP.
Regards and with many thanks again
rakader
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Your phpMyAdmin problem sounds like it might be a problem with how you've configured phpMyAdmin. Have you gone through the config.inc.php file, or whatever it is called?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Originally Posted by besson3c
Your phpMyAdmin problem sounds like it might be a problem with how you've configured phpMyAdmin. Have you gone through the config.inc.php file, or whatever it is called?
Hi and hello,
yes, I had. But I overlooked the password section. Now it works on Safari. Thank you for this hint.
What I don't understand why I'm unable to work with phpMyAdmin in Firefox/Opera. Every time I type in http://localhost/phpmyadmin these browsers shows me only the folder. Do you have any idea to solve this problem too?
Thank you in advance.
Regards
rakader
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
What do you mean by "the folder"?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Originally Posted by besson3c
What do you mean by "the folder"?
…the folder where phpMyAdmin is stored. Exactely: /Libary/WebServer/Documents. Like in the description of Tavi.
rakader
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Did you set the DocumentRoot for your Macports Apache as /Library/WebServer/Documents? This is the Apple default, not the Macports default, so I thought I would just check.
What happens when you click on the phpmyadmin folder in your directory index (i.e. the page rendered when you go to http://localhost)? What happens when you go directly to http://localhost/phpmyadmin ?
I'm not sure I'm understanding your problem...
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Originally Posted by besson3c
Did you set the DocumentRoot for your Macports Apache as /Library/WebServer/Documents? This is the Apple default, not the Macports default, so I thought I would just check.
I did this before.
Don't know what you mean exactely. When I click localhost I see the start page of Apache 1.3. If I use URL http://localhost/phpmyadmin I see i.e. in Firefox only the directory. A click on the parent directory links me back to the Apache 1.3 start page.
I put phpmyadmin folder inside /Library/WebServer/Documents folder.
But: If I use Safari with http://localhost/phpMyAdmin the result is correct ans shows me phpmyadmin login page.
rakader
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
So in Firefox you see the contents of your phpMyAdmin directory, while in Safari phpMyAdmin loads correctly?
If you are using Apache 2.x as provided by MacPorts, why is localhost bringing up the start page for Apache 1.3?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2008
Status:
Offline
|
|
Sorry for the circumstances. I have runned Personal Web Sharing by mistake. Don't know why.
Regards
rakader
(Last edited by rakader; Jan 9, 2008 at 11:01 AM.
(Reason:mistake corrected))
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2008
Status:
Offline
|
|
Hi all,
I had apache2 running in a slightly hacky way until recently I had to reload the OS (I hadn't repaired permissions in 4 years and the machine had been up for pretty much the whole of that time!). So I thought I'd tidy up and do everything nicely.
Now I have Apache2 in /Library/Apache2
I have Subversion in /Library/Subversion
I have Apache as a StartupItem in /Library (rather than /System/Library)
So feeling pretty good about it all so far.
As the icing on the cake, I would like to hook up the "Personal Web Sharing" button in the Preferences to start/stop my apache not the 1.3 that bundled with the OS. Ideally this would not be by means of symbolic links, but by tweaking the relevant setup file. Does anyone have an idea where to start with this one?
I found "Personal Web Sharing" in the file /System/Library/PreferencePanes/SharingPref.prefPane/Contents/MacOS/SharingPref but it's a binary file.
Thanks in advance,
Steve
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2008
Status:
Offline
|
|
I generally use Parallels with an Ubuntu LAMP server running on it in Bridged Networking mode as a kind of virtualised development platform!
You need at least 1GB of ram I'd say as it takes up around 256mb.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|