It is unfortunate that the Apache webserver is installed and configured with
dramatic difference across even modern Linux platforms. Here’s what
I’m seeing for SuSE 10 right now (at work; at home I have 10.1 and
we’ll see how different that is). It is quite literally a pain in the
kazoo as compared to what I experienced 5 or 6 years ago on RedHat 7.1.
However, I don’t dare go against the grain because there are benefits
to doing things the right way on your platform.
Install and run...
I followed an article by my old friend, Kevin Millecam, (Google “apache
linux millecam”) a little bit before it started deviating from what I
could relate to. Kevin wrote this article to rave reviews a few years
ago—back before SuSE 10. What is even more useful, once I get to it, is
the coverage of PHP and MySQL. I have so far climbed the PHP mountain, although
not really since SuSE’s Apache2 simply came already installed with it. (I
mean, when I loaded my box in January 2006, I specifically asked for Apache2 to
get installed during the initial installation because I knew that sooner or
later I would need to use it.
I found in SuSE 10 that Yast doesn’t mention Apache by name, but instead
calls it the http server . Okay, I’m clever enough to guess that
“http server’ refers to the Apache web server because the Apache
Software Foundating is bigger than just their webserver. And, Yast is handy in
expert mode once you get there, for setting up Apache in the respective boot
levels, but that is all it does for you.
Where’s my stuff?
RedHat installs Apache across /var/local and /usr/local which is
where you’d install it if you were compiling it for yourself from Apache
sources.
SuSE comes with Apache 2 and if you let Yast take care of the problem for you,
it gets installed who knows where. I haven’t found all the places it
goes, but I can tell you that it isn’t in /usr/local presumably
because SuSE considers it system software.
It has been asserted to me that Yast can configure things like Document Roots.
I was looking forward to this since the last time I messed with those, for my
Apache server running on NetWare (whence you are reading this very document), I
failed to perform the configuration correctly (and, my hand was being held by
Novell’s Apache guy too). However, I did not find this to be true in the
version of Yast installed on my SuSE 10. On SuSE 10.1, it happens under Yast
for http server .
What’s more, I haven’t yet figured out how to muck with
/etc/apache2/httpd.conf directly because that file now asks one not to
muck with it. So, I’m still looking for how and where to do that. There
are very unclear suggestions in that file, but some refer to files that
don’t exist on my SuSE host. (But, more on this topic in the next
section.)
Disconcertingly, path ~/public_html is useless to the Apache server on
my host—a very convenient phenomenon that Kevin’s article had led
me to believe would work. I would love to be able to put my stuff there.
Yast or not to Yast?
At work, I’ve found that SuSE 10’s Yast doesn’t provide for
as much cool configuration as the SuSE 10.1/2 I have at home (I installed 10.1,
but some things have been upgraded to 10.2, something I didn’t do on
purpose, but happened already prior to my installation of 10.1 or as part of an
automatic upgrade I tried to set up and which may have worked).
In particular, I find that at work I have to modify
/etc/sysconfig/apache2 by hand to get APACHE_CONF_INCLUDE_FILES
set to /etc/apache2/mod_userdir.conf in support of using
~/public_html use as a document root.
As you might guess, at work now (10.0) I restarted the dæmon with the
change just described and it now works. I hate having to learn a new way to do
things each release. There should be a best practices and then we’re
done.
Populating the document root...
At this point, I can only say that /srv/www/htdocs is where I found what
is displayed when, from a browser on any host here at my work, you type
http://taliesin.vintela.com/ . This is not to say that this path
isn’t an eminently wonderful place for a webserver’s documents to
go, it just seems very specific to SuSE.
I placed the following PHP content there and got what I was looking for once
I did it. I called the document, info.php and reached it thus:
http://taliesin.vintela.com/info.php
<?php phpinfo(); ?>
This magically causes a page from php.net to come up with system
information on it (quite useful).
PHP works, therefore, if not where I would prefer to see it
(on ~/public_html where Kevin put his).