I’m no linux guru and I had to get a whole bunch of resources together to compile this list on how to set up LAMP (linux apache mysql and php).
You must run these as root:
apt-get update apt-get upgrade apt-get dist-upgrade- aptitude install build-essential
apt-get install ubuntu-standard apt-get install lamp-server^ apt-get install php5-cli- apt-get install php5-curl
(rest and/or go take a dump) apt-get install curl apt-get install wget apt-get install imagemagick apt-get install emacs- apt-get install ufw (uncomplicated firewall)
- apt-get install sendmail (if you need php mail() function)
- apt-get install g++ libmysql++-dev (for sphinx)
Change apache’s memory usage setting ..
If you want imagemagick (latest), you need PECL to install (do not run apt-get install php5-imagick => outdated version)
- apt-get install php-pear
- apt-get install imagemagick libmagickwand-dev
- pecl install imagick
- Open your php.ini (/etc/php5/apache2/php.ini) and add this line:
extension=imagick.so
Then
12. a2enmod rewrite
13. a2enmod mod_headers (if you have wordpress blogs and want to have caching)
14. a2endmod mod_expires (same as #13)
15. a2endmod auth_basic (basic apache security)
16. a2endmod auth_digest
15. /etc/init.d/apache2 restart
16. /etc/init.d/mysql restart
17. chgrp -R www-data /path/to/your/www” (so PHP can read/write to ur directory)
18. chmod -R 775 /path/to/your/www (so PHP can read/write to ur directory)
Some things to change
- Change maxclients on apache2.conf to something small… like 10 or 15
- Change keepalive to off unless your site gets pounded (ex. high traffic site).. or time to live on keep alive connections to something small like 2
- PHP.ini upload limit – if you have high image site (like PawshPal.com), change it to smoething more suitable like 10m
PS:If your VPS provider doesn’t give you access to their nameservers (cuz they’re doosh bags), you can always go with EveryDNS. Set it up there and point to EveryDNS dns servers on your registrar.
PPS: If your Ubuntu distro doesn’t respond to this command:
apt-get install libapache2-mod-security
You need to manually download from here then run “dpkg -i libapache-mod-security_2.5.12-1_i386.deb”.
===============
Update 9-11-2011
If you want to add sphinx search feature for your app, follow this direction instead of using apt-get:
- wget http://sphinxsearch.com/files/sphinx-2.0.1-beta.tar.gz (or whatever the latest is)
cd sphinx./configure./make- ./make install
You need to build sphinx index for your mysql tables. Good tutorials here and here.
Once that’s done
1. build index (might want to add this to crontab)
/usr/local/bin/indexer pawshpal_content_index –config /usr/local/etc/sphinx.conf
2. test out the index w/command line interface search
/usr/local/bin/search –config /usr/local/etc/sphinx.conf “wtf”
3. start the search server (might want to run this command as service on startup)
/usr/local/bin/searchd –config /usr/local/etc/sphinx.conf
aptitude install build-essential
Related posts: