A few quick notes on turning up a LAMP environment (Linux, Apache, MySQL, PHP).
First off for those looking for a development box, and don’t care much for installing, check out XAMPP. Its a quick and dirty way to get up and running fast, however, not overly recommended for a production environment.
For a bit more control, go hand by hand. This guide is for hand compiling, if your Linux flavor has a package manager such as YUM, that is not covered here.
I’m attempting to give enough information to provide a ballpark idea of what’s going on. The details are for googling, the best way to learn.
1. We’ll start with apache, this does need to be done before the PHP install. Go download HTTP server from apache. To go directly to your box, you can copy the download location and run a wget to grab the tarball.
2. Put your tarball someplace consistent, such as /usr/local/src. Unpack the tarball, tar -zxvf tarName
3. Now you’ll have to compile apache, first off run the configure, ./configure, be sure to use the –prefix to put apache some place better than /usr/local/src, such as /usr/local/apache2. Making sure to add in all your desired modules, now run make followed by make install.
4. If you run into an issue of a forgotten module,:
- go to the src directory
- /usr/local/apache2/bin/apxs -c mod_crap.c
- cp .libs/mod_crap.so /usr/local/apache2/modules
5. Not to get lazy, typing, but to do PHP and MySQL is pretty much the same steps.
6. Go download the source files, run ./configure, make, make install
7. Setup httpd.conf
-
- LoadModule php5_module modules/libphp5.so
- AddHandler php5-script php
- NameVirtualHost *:80
- Include /usr/local/apache2/conf.d/*.conf
- DirectoryIndex index.php index.html index.html.var
- make sure all path to log files point to /var/log/httpd
- Set up logrotate: edit /etc/logrotate.conf : edit /etc/logrotate.d/httpd (sample files below)
- mkdir /usr/local/apache2/conf.d
- Add the conf.d files provided
Hope that gives everyone a little bit of a start.