Forum Moderators: travelin cat
that directory is where all the old apache stuff is but if I type localhost in the browser the new version apache stuff is coming but I have not a clue from what directory it is being served from.I just cannot find the new apache directory anywhere even though its obviously running or localhost would not serve up the new version apache page.
am I possibly looking at the wrong http.conf file - is it possibly the old one and being overidden by one somewhere else that I'm unaware of?
this stupid sherlock thing will just not index my hardrive properly so I can search.
It really is worth spending a little and upgrading to 10.3
You'll find Apache installed and preconfigured.
To put up a website is as simple as placing the HTML in your account's website directory and turning on personal websharing.
I started with 10.1 and it's about as capable as DOS 2...
The upgrade will take away all your problems and it's as stable as anything too.
DerekH
Localhost is served from the directory:
/Library/WebServer/Documents/
localhost/~<yourusername> is served from:
/Users/<your_user_name>/Sites/
Of course you can always change that in your httpd.conf file, which is at:
/private/etc/httpd/httpd.conf
But yes, definitely consider upgrading your OS X. 10.1 was usable in its day, but 10.3 is much nicer. You might want to make sure the iBook has more than 256 Mb of RAM, and you'll have a nice little system.
Out of curiosity - is the included version of apache,php etc with 10.3 functional enough to use for web developement or does it need upgrading - if so can anyone recomend a good autoinstaller for apache,mysql,php etc that suits 10.3
All this aside though it seems like its got plenty of potential over a windows system - no extra server needed etc and saves waiting for software companies like macromedia , adobe etc to start writing versions for linux - so far with my limited mac experience I'm quite impressed. Perfect solution for my continuous travelling through asia.
btw 400mg ram
One other note: When you upgrade your OS, be sure to install the (free) development tools, which include make, and other things you might need.
10.3 comes will php I believe. You just need to enable it in httpd.conf.
I would really suggest learning a little about unix/linux/bsd and the command line. Learn about permissions (chmod), and how the system works in general. For example, you can find all the httpd.conf files by typing this in the terminal. '$ find / -name httpd.conf'
Also, I don't see any reason to install apache over the one that comes with 10.3 unless you need apache2 instead of apache1.3. You probably don't.
Considering that the default install of apache is updated regularly by the Apple Software Updates, I would never replace it with my own install. I'm just not that good at keeping up with security patches to maintain it myself.
1) ServerLogistics install everything in /Library
2) Serverlogistics supplant the version of Apache 1.3 and PHP that comes with OS X
3) the files found in /etc/httpd/ is for the Apple Apache 1.3 version
4) EVERY file that the ServerLogistics Apache 2.0 uses is in /Library/Apache2
5) ServerLogistics webroot is in /Library/Apache2/htdocs
6) Apple webroot is in /Library/WebServer
7) ServerLogistics configuration files are in /Library/Apache2/conf
8) the Sharing Preference Pane can only be used to (de)activate the Apple Apache 1.3
9) you'll have to install and use the Apache2 preference pane from the ServerLogistics Apache2 package to (de)activate the ServerLogistics Apache 2.0
10) If you want to use the ServerLogistics Apache2 you must have de-activated the Personal Websharing i the Sharing Preferences Pane (simplified answer - it's possible to have both running, but that's for advanced people)
11) If you've turned on the Firewall, you'll have to open for access to Apache2 explicitly. You can just make a new entry in the firewall with the same port numbers as for Personal Websharing.
12) Please note, that the ServerLogistics PHP package is in two parts: the Apache module and the executable. If you just want to mess around with Apache2+PHP you don't need the executable. If you want to use PHP from the Terminal, you'll need the executable too, and make some additional settings in the settings for your shell.
You might take a look at my personal webpages - link in my profile. The pages are in danish, but ought to be understandable for people not too language challenged.
whoisgregg:
The ServerLogistics packages don't replace the Apple Apache 1.3 and PHP. They install in /Library and don't touch ANY of the files Apple uses for their installation of Apache 1.3
whoisgregg:
The ServerLogistics packages don't replace the Apple Apache 1.3 and PHP.
I realize that. I was using the word "replace" in the context of "in my everyday use" not in the literal sense of existing in my file system. I apologize for the confusion. :)
I really only want to do this once - am I better off just installing the server logistics full apache and full php with all libs than messing with the apple ones and websharing.I really want php to be fully functional
without having to drop in extra libs as needed.
and if so is it basically just a matter of pointing the document root in httpd.conf to any directory I want?
sorry about all the questions but I'm back off to se asia for 6 months on friday and am desperately trying to get this sorted before I leave.
LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps You can see the status of these lines and where they are in httpd.conf by executing the following command in Terminal:
cat /etc/httpd/httpd.conf ¦ grep -n php Your html filenames will also have to end in .php instead of .html. If you are putting php code in a *.html file it won't get parsed.
Another thing that might foul things up for you is your php start tags. They come in two flavours: '<?' and '<?php'. The first form is called "Short Open Tags", and it's!not! recommended to use these as they might conflict with xml opening tags that look like this : '<?xml'. It's possible to turn off the use of "Short Open Tags" in your php.ini file. I'm not sure whether Apple's Apache actually loads a php.ini file, but you can find out
1) where php looks for it
2) find the default one
3) take a look at how "Short Open Tags" is set
as to 1):
create a file named phpinfo.php in your web root folder with just the following:
<?php phpinfo();?> as to 2):
execute the following command:
sudo find / -iname '*php.ini*' cp /private/etc/php.ini.default /private/etc/php.ini as to 3)
To see the standard setting for "Short Open Tags" execute the following command:
cat /private/etc/php.ini.default ¦ sed -n '/70,90/p' Note: /private/etc and /etc are actually the same as /etc is a link to /private/etc
whoisgregg:
OK - that clears up the confusion ;)
That was why I chose to use 'supplant' instead of 'replace' ;)
[edited by: BjarneDM at 7:09 pm (utc) on Jan. 11, 2005]
Mac os apache and php running just fine after a bit of configuration file editing.
Just a couple more questions though - Can I set this websharing so its on permanently, I keep having to restart it every time I shut down and clicking the padlock closed does not help.
Also now moving away from what I assume was the easy part - can anybody give me any advice on what mysql package to install that will run with Mac os apache and php.
I'm sort of hoping that my limited telnet experience will help out once installed but any tips would be much appreciated.
php:
you'll need to have MySQL support compiled in in order for php and MySQL to be able to talk to each other. You can see whether this is the case on the phpinfo page; there has to be a parameter like this: '--with-mysql=<path>' under 'Configure Command'. Apple's php doesn't have support for MySQL (along with a lot of other nice things) - and it's also several versions behind the official stable releases.
MySQL:
there are two stable versions: 4.0.23 and 4.1.8. 4.0.23 is the version you'll have to choose if you are using php 4.3.x. You can use both versions of MySQL with php 5.0.x, but 4.1.8 is only fully supported under php 5.0.x. A version of php 5.0.x with full support for MySQL 4.1.8 has the following in phpinfo: '--with-mysql=<path>' '--enable-embedded-mysqli=<path>'
In short:
you'll have to install at least both a new version of php as well as a version of MySQL.
You can go two ways: The Marc Liyanage way - or the ServerLogistics way
[entropy.ch...]
[serverlogistic.com...]
I'll recommend the ServerLogistics way as the packages you get from there are nicely integrated with one another and are the simplest - very much simpler - to administer for newbies. And please do read the included short pdf install manuals. To be quite frank, it's very clear to me that you have skipped reading the install manuals for the ServerLogistic packages - otherwise you wouldn't have asked several of your questions as they are clearly covered in the Apache install manual.
I won't give you support if you go the Marc Liyanage way. Marc has extensive instructions on his pages.
If any of your questions are covered in the ServerLogistics install manuals, you'll just get an RTFM from me in the future.
I've emailed the three ServerLogistics install manuals to you
I'll have to start from scratch I think and install full version everything so as not to have future problems- mac apache etc is useless to me without mysql support and I do not want to find its lacking something after an exhausting install.
off to cambodia tomorrow so will have plenty of time to peruse guides and will only ask questions that I cannot get an answer to. Thanks again
steve
Have access to panther web server disc and am wondering if this is something I can use by doing a minimum install or salvage individual programs off? I do not want to overload my poor little laptop with a full server setup.
Before anybody gives me a lecture on pirated software just let me remind everybody its the free open source aspects of the disc I am interested in only. Or failing this any advice on how I could come by latest php,mysql and apache from within cambodia without spending 10 hours at an internet cafe? - thanks
!BUT! none of the versions you can extract off the X Server disks will be up-to-date. Depending on what you want to use it for this might or might not be an issue for you. The version of PHP will be in the 4.3.x range and I don't know what version of MySQL is included. If you are un-lucky it might even be from the 3.23.x series which by now is pretty much discontinued and replaced with the 4.1 series (or at the very least the 4.0.x series).
In my opinion, you'll be best served (pun intended) by suffering through that 10-hour download. But do use a download manager that's able to re-connect and resume. Monica (http://www.blackdiamond.co.za/bdmonica.html) is one such that I'm using to my very great satisfaction. Or you can go for the commandline and use curl or wget (separate install from fink) in Terminal.
If you go for the ServerLogistics solution, you can upgrade it to the very latest versions of everything by following the instructions on my web-site.
Re the apple user guides for php etc on my previous attempts on 10.1 - they were actually missing from the old packages I downloaded so sorry about all the questions.
now have everything up to date and installed and working the best I can with docs provided but have a problem that seems to be php related.
installed php,mysql,apache2 and everyhting seems to be working however I installed 2 different open source packages to test the installation and one has a problem.
Open realty works fine and no database problem however xoops is a different story - has an autoinstall script which reported everything as being ok (paths, database etc) on finishing installation and getting report stating installed correctly tried index page and after some short time get a blank page with no source - no errors reported on screen. Other pages from within xoops work ok but main page is not showing anything.
database seems fine as openrealty is working fine.
am stuck and have gone through docs to no avail - register_globals on (only problem I could find).
any ideas greatly appreciated. Thanks again.
server running like a champion but could do with any speed enhancement tips - runs a little slow on heavy pages with database
Also, I just wanted to add that I never needed to reinstall PHP to get MySQL working with it. The first time I compiled from source, the second time I used Fink -- both worked w/o touching PHP.
Is it possible theres some conflict going on between apache and mysql servers? on loading pages that use database they can be painfully slow(up to 20 seconds sometimes) and then less than a second at other times.
no errors but painfully slow at times
btw 400 megs ram.
also another possibly stupid question - being new to mac os I cannot get access to .htacces files from within mac osx - the finder will not let me view system files for editing and textedit keeps throwing on an extension everytime I create one.
(finder is set to view all file types but still no joy)
Just type 'sudo pico filename' or 'sudo vi filename' or 'sudo emacs filename' to edit the file in pico, vi or emacs respectively. It will ask for your administrative password.
Alternatively, you can change the file's permissions. First do 'ls -l filename' to see the existing owner (in case you need to set it back) and then do 'sudo chown username filename' where username is your OS X username.
2) 400MB RAM
That's probably your problem. The minimum amount of RAM recommended by trade journals and reviewers of Mac OS X to run comfortably in is 512MB RAM. What's most probably happening in you case is that Apache and MySQL has been swapped out to the HardDisk after not being used for some time. Then, when you call upon them to serve your pages they have to be swapped into RAM again. That's what's causing the long response times. The short response times occur when both Apache and MySQL are already loaded into RAM. Consider upgrading your RAM to the max possible in your computer. Look, I bought my TiBook in 2002 and the first thing I ordered the dealer to do was install the max of 1GB RAM. At present Mac OS X 10.3.7 is also using 2GB of HardDisk swap in addition to my 1GB RAM. You can see how much swap disk your computer is using by running this command :
ls -aloF /var/vm 3) editing system files generally
Many of these are owned by root and are not even editable by an administrator without temporarily elevating the rights of the administator by pre-fixing the command with 'sudo' (enter 'man sudo' in Terminal for an explanation). If you need an editor that's aware of these rights and is using a pretty GUI as well as offering a command line interface, I'll recommend BBEdit - VersionTracker [versiontracker.com]. Yes, it's a bit expensive, but most people find it worth the money. TextEdit is normally unable to handle files owned by 'root'. You'll have to start TextEdit with root privilegies; see here - macOSXhints [macosxhints.com] - for information on how to do that. Also, take at look at 'man open' in Terminal.
4) being new
It's not so much being new to Mac OS X that seems to be your problem. It's being new to the whole Unix/Linux concepts of file access rights and user administrating that seems to be at the root of your problems. See my comment #4 in this thread: [webmasterworld.com...] for recommended reading. Look, Mac OS X *deliberately* hides a lot (if not most of) the FreeBSD Unix underpinnings of the system in order to make it easy for the common in-experienced user. What you are presently doing / trying to do is to dwell deep into the Unix parts.
have been using terminal but Was sort of hoping to not relearn unix commands after switching to mac os and thought that telnet type access was something I could drop allong with windows(for local developement anyway).
thanks again for all your help - I'm a mile ahead from when this thread first started thanks to all here. :)