Apache, MySql and PHP Howto (from source)

Everyone loves web applications that use Apache, PHP and MySQL, and everyone loves having their very own web servere that runs them. The problem is, how do you do it? If your’re like me, you don’t do it enough to remember, so here are some quick directions to get you started.

First we must download the latest versions of Apache, MySQL and PHP and extract them. You may have to dig a little since these places are always changing where they keep things, but the links below should be of some use. Just make sure you download the source distribution.

MySQL Download >
Apache Download >
PHP Download >

I always put these applications in /usr/local/server, but you can select whatever location you like. Simply add whatever directory you want into the –prefix directive.

First, let’s build and install MySQL

# cd /path/to/mysql/source/directory
# ./configure –prefix=/usr/local/server/mysql
# make
# make install

Next, we have to build and install the Apache web server. In this example, we are building it with SSL, URL Rewrite and Shared Object support.

# cd /path/to/apache/source/directory
# ./configure –prefix=/usr/local/server/apache –enable-module=so –enable-rewrite -enable-ssl
# make
# make install

Finally, build and install PHP. There are lots of things you can include when building PHP, but these are the most common.

# ./configure –with-apxs2=/usr/local/server/apache/bin/apxs –with-mysql=/usr/local/server/mysql –enable-debug=no –enable-track-vars=yes –enable-bcmath=yes –enable-memory-limit=yes –with-imap –with-ldap=/usr/local/server/ldap –enable-ftp –with-gd –with-jpeg-dir=/usr/local –with-png-dir=/usr/local –with-zlib-dir=/usr
# make
# make install

That should do it… If everything went well, you can start up your fancy new apache web server.

# /usr/local/server/apache/bin/apachectl start

Things to remember when creating Apache SSL certs

Since I don’t create certs all that often, I’ve always been frusterated by having to search out the commands every time I have to make one. Frequently I forget about removing tripple DES from the server.key file, and end up with a cert that makes me enter a psss phraze every time I start up Apache.

Thus, I decided to create an entry here with all the commands, so that I will never have to go searching for them again.

First, change directory into your Apache configuration directory:

# cd /path/to/httpd/conf

Generate the server key (with password):

# openssl genrsa -des3 -out server.key 1024

Optionally, we can generate a key file without a password. This means that Apache will start without requesting a password. This is important should there ever be a power failure, or when a reset is required and no one knows the password. Use the following command:

# openssl rsa -in server.key -out server.pem

A CSR (Certificate Signing Request) is required for afirming that the server key is valid. The server.pem is used in place of server.key as we don’t require a password:

# openssl req -new -key server.pem -out server.csr

You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter ‘.’, the field will be left blank.

Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Your State
Locality Name (eg, city) []:Your Cit
Organization Name (eg, company) [Internet Widgits Pty Ltd]: Your Company Nam
Organizational Unit Name (eg, section) []:Department Name
Common Name (eg, YOUR name) []: server.spiralbound.net
Email Address []:me@spiralbound.net
Please enter the following ‘extra’ attributes to be sent with your certificate request
A challenge password []:
An optional company name []:

Finally, the certificate needs to be signed. Normally this is done by an official authority such as Thawte. However, if this is not available, we can sign the certificate ourselves. In this example a time limit of 3 years, or 1095 days is set for the amount of time to be valid. Again, we use the server.pem file without a password.

# openssl x509 -req -days 1095 -in server.csr -signkey server.pem -out server.crt

Gannon Guckert Gate

Since George W. Bush took office his secrecy with respect to the media has been unprecedented. He rarely holds press conferences, and on the rare occasions when he does, his answers are constantly obfuscated by double-speak and misdirection. Thus it is for good reason that the blogosphere and independent media became suspicious when little known reporter Jeff Gannon was called on by President Bush at one of these rare conferences, and ended his question with the softball: “How are you going to work with people who seem to have divorced themselves from reality?” referring to Senator Hillary Clinton and Senate Minority Leader Harry Reid.

After some digging, it turned out that “Jeff Gannon” is really an alias for an individual named James D. Guckert, who represented a conservative news site called “Talon News”. Somehow, within a short time of entering “journalism,” Guckert, masquerading as Gannon was able to get credentialed and attend numerous White House briefings, where he lobed softball questions at White House officials. According to DemocraticUnderground.com, “Gannon was actually in the White House as early as February 28, 2003 — a month before Talon News even existed”.

Whenever one goes digging, the most interesting details usually buried the deepest, and this story is no exception. It turns out that by day, Guckert was merely a half-credentialed “journalist” planted by the Bush Administration to ask easy questions, but by night was transformed into a high dollar male escort and gay porn star! Guckert appeared on a wide variety of websites that feature homosexual pornography, including HotMilitaryStud.com and MilitaryEscorts.com. These sites have now been taken down and are listed for sale in the Adult/Porn category.

One would think that when the White House plants a fake reporter who is also a gay porn star and male escort, the religious right would be outraged, but interestingly they have not. In an article by Bill Berkowitz entitled “Christian Right Mum on Gannon Affair Why have the “traditional family values” folks erected a wall of silence around the Gannon scandal?” a long list of religious news organizations and Christian political action committees were contacted, with not so much as one willing to comment on the scandal. Apparently, the same individuals who are so up in arms against gay rights have no problem with the President allowing a homosexual male prostitute to meander around the west wing of the White House so long as it serves their agenda.

This scandal does not seem to be going away nearly as quickly as the President would like. With so much buzz in the blogosphere, even extremely conservative media sources such as Fox News have been browbeaten into covering it. What is truly disturbing to me is not the fact that Guckert is a male escort and gay porn star, but the fact that the Bush Administration has taken to planting fake journalists who simply repeat GOP talking points and ask questions that advance the neo conservative agenda.

Christian Right Mum on Gannon Affair
A Man Called Jeff… More than you really want to see of Guckert

Bush Audio tapes Leaked

The quotes below are taken from a New York TImes article from Feb 19, 2005. Doug Wead is a personal friend of George Bush. During the course of writing a book about then future president he secretly recorded some private conversations.

NOTE: We are currently trying to acquire the entire transcripts of these tapes, as well as the audio files themselves. Check back regularly for updates.

>>Variously earnest, confident or prickly in those conversations, Bush weighs the political risks and benefits of his religious faith, discusses campaign strategy and comments on rivals. John McCain “will wear thin,” he predicted. John Ashcroft, he confided, would be a “very good Supreme Court pick” or a “fabulous” vice president. And in exchanges about his handling of questions from the news media about his past, Bush appears to have acknowledged trying marijuana.

>>Preparing to meet Christian leaders in September 1998, Bush told Mr. Wead, “As you said, there are some code words. There are some proper ways to say things, and some improper ways.” He added, “I am going to say that I’ve accepted Christ into my life. And that’s a true statement.”

>>But Bush also repeatedly worried that prominent evangelical Christians would not like his refusal “to kick gays.” At the same time, he was wary of unnerving secular voters by meeting publicly with evangelical leaders. When he thought his aides had agreed to such a meeting, Bush complained to Karl Rove, his political strategist, “What the hell is this about?”

>>Bush, who has acknowledged a drinking problem years ago, told Mr. Wead on the tapes that he could withstand scrutiny of his past. He said it involved nothing more than “just, you know, wild behavior.” He worried, though, that allegations of cocaine use would surface in the campaign, and he blamed his opponents for stirring rumors. “If nobody shows up, there’s no story,” he told Mr. Wead, “and if somebody shows up, it is going to be made up.” But when Mr. Wead said that Bush had in the past publicly denied using cocaine, Bush replied, “I haven’t denied anything.”

>>He refused to answer reporters’ questions about his past behavior, he said, even though it might cost him the election. Defending his approach, Bush said: “I wouldn’t answer the marijuana questions. You know why? Because I don’t want some little kid doing what I tried.”

>>He mocked Vice President Al Gore for acknowledging marijuana use. “Baby boomers have got to grow up and say, yeah, I may have done drugs, but instead of admitting it, say to kids, don’t do them,” he said.

>>Bush threatened that if his rival Steve Forbes attacked him too hard during the campaign and won, both Bush, then the Texas governor, and his brother, Gov. Jeb Bush of Florida, would withhold their support. “He can forget Texas. And he can forget Florida. And I will sit on my hands,” Bush said.

>>Bush also regularly gripes about the barbs of the press and his rivals. And he is cocky at times. “It’s me versus the world,” he told Mr. Wead. “The good news is, the world is on my side. Or more than half of it.”

>>”I believe tomorrow is going to change Texas politics forever,” he told Mr. Wead. “The top three offices right below me will be the first time there has been a Republican in that slot since the Civil War. Isn’t that amazing? And I hate to be a braggart, but they are going to win for one reason: me.”

>>When Mr. Wead warned him that “power corrupts,” for example, Bush told him not to worry: “I have got a great wife. And I read the Bible daily. The Bible is pretty good about keeping your ego in check.”

>>Preparing to meet with influential Christian conservatives, Bush tested his lines with Mr. Wead. “I’m going to tell them the five turning points in my life,” he said. “Accepting Christ. Marrying my wife. Having children. Running for governor. And listening to my mother.”

>>…apparently ruling out potential vice presidents including Gov. Tom Ridge of Pennsylvania and Gen. Colin L. Powell, who favored abortion rights. Picking any of them could turn conservative Christians away from the ticket, Bush

>>…”Look, James, I got to tell you two things right off the bat. One, I’m not going to kick gays, because I’m a sinner. How can I differentiate sin?”

>>…convention of the Christian Coalition, a conservative political group: “This crowd uses gays as the enemy. It’s hard to distinguish between fear of the homosexual political agenda and fear of homosexuality, however.”

>>”This is an issue I have been trying to downplay,” Bush said. “I think it is bad for Republicans to be kicking gays.”

>> “No, what I said was, I wouldn’t fire gays.”

>>Bush had already identified one gay-rights issue where he found common ground with conservative Christians: same-sex marriage. “Gay marriage, I am against that. Special rights, I am against that,” Bush told Mr. Wead, five years before a Massachusetts court brought the issue to national attention.

>>”Sovereignty. The issue is huge. The mere mention of Kofi Annan in the U.N. caused the crowd to go into a veritable fit. The coalition wants America strong and wants the American flag flying overseas, not the pale blue of the U.N

>>”I don’t like it either,” Bush said of the Clinton investigations. “But on the other hand, I think he has disgraced the nation.”

>>When Mr. Wead warned that he had heard reporters talking about Bush’s “immature” past, Bush said, “That’s part of my schtick, which is, look, we have all made mistakes.”

>>He said he learned “a couple of really good lines” from Mr. Robison, the Texas pastor: “What you need to say time and time again is not talk about the details of your transgressions but talk about what I have learned. I’ve sinned and I’ve learned.”

>>”I said, ‘James’ – he stopped – I said, ‘I did some things when I was young that were immature,’ ” Bush said. “He said, ‘But have you learned?’ I said, ‘James, that’s the difference between me and the president. I’ve learned. I am prepared to accept the responsibility of this office.’ “By the summer of 1999, Bush was telling Mr. Wead his approach to such prying questions had evolved. “I think it is time for somebody to just draw the line and look people in the eye and say, I am not going to participate in ugly rumors about me, and blame my opponents, and hold the line, and stand up for a system that will not allow this kind of crap to go on.”

>>…used illegal drugs in the past …”I am just not going to answer those questions. And it might cost me the election,”

>>”It’s unbelievable,” Bush said, reciting various rumors about his past that his aides had picked up from reporters. “They just float sewer out there.”

>>”I like Ashcroft a lot,” he told Mr. Wead in November 1998. “He is a competent man. He would be a good Supreme Court pick. He would be a good attorney general. He would be a good vice president.”

>>When Mr. Wead predicted an uproar if Mr. Ashcroft were appointed to the court because of his conservative religious views, Bush replied, “Well, tough.”

>>”I want Ashcroft to stay in there, and I want him to be very strong,” Bush said. ” I would love it to be a Bush-Ashcroft race. Only because I respect him. He wouldn’t say ugly things about me. And I damn sure wouldn’t say ugly things about him.”

>>Evangelicals were not going to like him, Bush said. “He’s too preppy,” Bush said, calling Mr. Forbes “mean spirited.”

“Steve Forbes is going to hear this message from me. I will do nothing for him if he does to me what he did to Dole. Period. There is going to be a consequence. He is not dealing with the average, you know, ‘Oh gosh, let’s all get together after it’s over.’ I will promise you, I will not help him. I don’t care.”

>>When Mr. Wead suggested in June 2000 that Mr. McCain’s popularity with Democrats and moderate voters might make him a strong vice presidential candidate, Bush almost laughed. “Oh, come on!” He added, “I don’t know if he helps us win.”

>>Bush could hardly contain his disdain for Mr. Gore, his Democratic opponent, at one point calling him “pathologically a liar.” His confidence in the moral purpose of his campaign to usher in “a responsibility era” never wavered, but he acknowledged that winning might require hard jabs. “I may have to get a little rough for a while,” he told Mr. Wead, “but that is what the old man had to do with Dukakis, remember?”

More as we try to acquire the transcripts….

Troubles with NitrItes in colder water

It seems that we have a lot of koi keepers who need, for one reason or another to bring some of their fish in during winter months. Sometimes they find a sick fish in their pond that needs treatment, or sometimes they just want want to keep some of their best fish in for the winter.

Because Cyprinus carpio (koi) are cold water fish, many people chose to maintain water temperatures below 60* F. While the low temperatures used (50* F – 60* F) are somewhat dangerous for koi, is very doable provided the fish are in good health, not overcrowded, and the filter is 100% cycled. The real danger comes when the biological filter is not totally up to snuff before it is exposed to colder water. This is because of the different reproduction rates of the two types of bacteria responsible for oxidizing nitrogen.

Because biofilters take a very long time to cycle in water below 70* F many people use ammonia binders such as Amquel to mitigate its dangerous effects. When ammonia bound up by Amquel. It’s not toxic to fish, but is still indirectly dangerous because it needs to be converted to NitrIte, which cannot be controlled by ammonia binders. While it is true that salt helps control the NitrIte problem to some extend, it is really only a bandaid, and does not work when NitrIte levels are very high.

For folks who are dealing with cycling a filter in colder water, I suggest two things. First, filters in cool water need to be quite large, so we often need to add to the filtration. A simple way is to drill a bunch of holes into the bottom of a 5 Gal bucket, fill it with lava rock (stones for gas grills) or plastic kitchen scrubbies, suspend it above the tank, and feed it with a sump pump, letting the water trickle through the media, and drain out through the holes, back into the tank. Try to distribute the water evenly over the top of the media. Making a spray bar out of tube or pipe with holes drilled in it helps with this. Try to size the pump to turn over all the water in the holding tank 4 to 5 times an hour.

Next we need to get some bacteria in there. Nitrosonomas are the bacteria that first convert Ammonia into NitrIte and then another type of bacteria (Nitrobacter) takes over and converts the NitrIte into fairly harmless NitrAte. The problem is that Nitrobacter divide much more slowly than Nitrosonomas, and our fish have to live with NitrIte much longer than Ammonia throughout the cycle process. They will also divide much more slowly, or even not at all in colder water.

When the water temperature is low, we find ourselves in a bit of trouble. We need to keep the water temp down, and the Ph low to mitigate the toxicity of the Ammonia, but our Nitrobacter will either develop slowly or not at all under these conditions. Nitrosonomas will convert all the Ammonia to NitrIte, but Nitrobacter will never come along to detoxify the NitrItes into NitrAtes. NitrItes will spiral out of control, and the fish will suffer no matter how much salt is added.

So, we need an instant cycle. I’ve always thought how great it would be if someone kept a bunch of cycled filter material around to send off to folks facing this kind of problem. I keep planning to do it myself, but my wife can’t stand it when I run pumps all over the place. We always take our bacteria for granted, but it’s more precious than gold when you don’t have any.

I suggest everyone try to keep some live filter bacteria around at all times.

If not, one company bottles it up and sells it. They only ship overnight, with their product on cold packs. This is the ONLY company I know of that sells such a product, and it is NOT cheap! If you can find a person or company with healthy fish that can ring out their filters for you, that would be the best option, but if not, Fritz Pet’s Turbo Start is your best Option. It is also worth mentioning that, at least in my experience, Bio Spira from Marineland does not work.

No matter how you get the bacteria, you need to do a few things before you add it to make sure it works. If you get the bacteria from another person’s filter, you will need to remove all the fish for a couple of hours after dumping it in, or they will die. You can add them back in once the water becomes more or less clear.

1) Keep your existing filter running, and add the new one.

2) Doing hourly water changes, bring the Ammonia and NitrItes down to less than 1ppm.

3) Use a phosphate-based neutral Ph buffer. You could use baking soda, which usually holds the Ph around 8.0, but for cycling I suggest something that will hold it closer to neutral (7.0). I like Seachem’s neutral buffer because it holds the Ph at 7.0, which makes any Ammonia spike less toxic than it would be at 8.0. Either way, both types of bacteria require a Ph buffer to divide.

4) Add the bacteria. Don’t forget to remove the fish if you obtained bacteria (gunk) from someone’s filter.

5) Bring the temp up to at least 76* F. A 300 W aquarium filter should work for this. Make sure not to bring up the temp too fast or you will shock the fish. If your temp is still in the 60’s, you should be able to bring it up to 76* within 24 hours safely. You can let the temp fall again once the filter is cycled.

7) Keep a close eye on your Ammonia and NitrIte levels. I’ve done this a number of times, and the Ammonia usually rises to 1.0, and then drops. NitrIte then comes up to .5, and then drops. I’ve also done it, and never even seen Ammonia or NitrIte. With high stocking levels, I would expect to see a slight spike in both.

Howard Dean Victory Celebration

Last Sunday, DFA, and the Howard Bean Cafe in Montpelier, VT organized a victory celebration for Howard Dean’s election to the Chair of the Democratic National Committee. The local news media were there, along with dozens of DFA Members and Howard Dean supporters. Free coffee, cake, and a wonderful time was had by all

The overall feeling was that of relief. Many of those attending became excited by politics for the first time in their lives because of Howard Dean’s empowering message, and had been frustrated by how the former Democratic establishment had treated him. Most of those I talked with expressed a renewed hope for the party now that Dean is at the helm, and were excited and optimistic about the future.

Howard Dean truly is what our party needs. An honest, trustworthy person who tells America the truth and speaks from his heart. He more than anyone else at this point has the political understanding, and grassroots support to take the moral high ground back from the conservative radicals, and turn the red states blue!

Clarke’s al-Qaeda Threat Memo Leaked

Yeserday, the National Security Archive posted the widely-debated, but previously unavailable, January 25, 2001, memo from counterterrorism coordinator Richard Clarke to national security advisor Condoleezza Rice.

The document was central to debates in the 9/11 hearings over the Bush administration’s policies and actions on terrorism before September 11, 2001. Clarke’s memo requests an immediate meeting of the National Security Council’s Principals Committee to discuss broad strategies for combating al-Qaeda by giving counterterrorism aid to the Northern Alliance and Uzbekistan, expanding the counterterrorism budget and responding to the U.S.S. Cole attack.

Despite Clarke’s request, there was no Principals Committee meeting on al-Qaeda until September 4, 2001. The memo has been declassified for some time, but only became available yesterday.