Busy geeking. Here’s an old one to hold you over for awhile:
Lesson: After running emerge –update, pay close attention to the the changes in configuration files proposed by etc-update. I didn’t, and caused myself a lot of avoidable grief. During one of my system-wide updates, I trashed Apache’s config files. Being the slightly retarded geek wannabe that I am, I had a heck of a time tracking down the information I needed to get my LAMP server running the way I wanted it to.
After much Clustying, file editing, head-banging, hair-pulling and cussing, I found out that it was pretty much working in the first place. All it needed was a couple of minor tweaks.
I first noticed something was wrong when I fired up the test website I have lurking in my /home/lizardbrain/public_html directory. The pages all loaded, but instead of being interpreted, the PHP script was rendered as text. It didn’t take me long to find that I needed to add some stuff to /etc/conf.d/apache2 (file paths are the ones on my Gentoo box; your distro may stash the files in other places). The first thing I did was add “-D PHP5” to the APACHE2_OPTS line in /etc/conf.d/apache2. It still didn’t work — I kept getting “Not Found” error messages. Actually, I had fixed about half the problem and didn’t know it, so I continued to clusty and tweak the config files. Most of what I did was unnecessary, but at least didn’t break anything. What finally gave me the clue that I was on the wrong track was when I restored /etc/apache2/httpd.conf to its original condition and copied a .php file from my public_html directory to the server’s home directory: it worked. All I needed to do from that point was get Apache to serve pages to my test site.
For those of you who got here by querying the search term “apache2 Invalid command ‘UserDir’,” /etc/apache2/httpd.conf does not allow the setting of “UserDir public_html.” What I had to do was add another option, “-D USERDIR,” to /etc/conf.d/apache2. Then I had to edit /etc/apache2/httpd.conf to add UserDir instructions.
Here’s what it boiled down to:
In /etc/conf.d/apache2, add
-D PHP5 -D USERDIR
to the APACHE2_OPTS line. Make sure you add these options within the existing quotation marks.
In /etc/apache2/httpd.conf, add
This gave me basic functionality. Since there is no public access to this computer, I didn’t bother to add anything else to /etc/apache2/httpd.conf to restrict access. For those who need more security, I got this from the Gentoo Forums:
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
# <Directory /home/*/public_html*gt;
# AllowOverride FileInfo AuthConfig Limit Indexes
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# Enable this additional section if you would like to make use of a
# suexec-enabled cgi-bin directory on a per-user basis.
# Options ExecCGI
# SetHandler cgi-script
Now, when I point my browser to http://mygentoobox/~lizardbrain/, my test site appears, and php scripts are rendered correctly. As usual, the Gentoo Forums were my best friend, once I figured out the correct search terms.
I’ll be keelhauled! It’s Talk Like A Pirate Day! And I forgot!
Me, I gotta sit here and try to figure out Apache2’s new configuration files so I can get my LAMP server back up and running.
Update: Over at Cuffy’s place it’s talk like a parrot day.
The attacks on the World Trade Center towers and on the Pentagon on 11 September 2001 may have seemed like a declaration of war. They were not; they were merely the most egregious overt acts of a war that had been declared years, even centuries, before. The war continues today. It’s being waged not just in the Middle East, but here in the U.S. as well. It’s being waged against us not just by those who have declared the war, but also by those who enable and apologize here at home.
We are at war. It is a war which will mark the end of civilization or the the end of a barbaric, medieval death cult. This is not my opinion; it is what our enemies have stated on many occasions. We can fight it, or we can offer up our throats, and those of our children, to the knife. I know which course I choose.
I will not submit.
I Will Not Submit