Ok I'm told the best and easiest way to install Apache/Nginx, PHP, MySQL for production these days is to pull in the software using apt-get or similar package manager for your specific distro. The advantage of this is you're using reliably built packages and you can easily update them in production.
Now I'm currently using Ubuntu 12.04 and keen for the latest versions of this software:
- Apache 2.4.x or Nginx 1.2.x
- PHP 5.4.x
- MySQL 5.5.x
However every guide I've come across seems to have me install all this stuff but after I've done all the configuration it doesn't end up working and I have no idea what went wrong or how to fix it.
So far I've come up with:
1) Install dotdeb repositories using these instructions:
2) Install Apache 2.2.22, PHP 5.4.3, MySQL 5.5.24 with:
aptitude install mysql-server apache2 libapache2-mod-php5 php5-mysql php5-apc php5-curl
3) Install mod-rewrite package with:
a2enmod rewrite
Now that works and I can get a phpinfo() running and displaying properly and connecting to the database. However this only gets me Apache 2.2.22 (I would prefer 2.4.x for the latest speed increases) and also I can't get mod-rewrite working, it just refuses to redirect everything to index.php so only the homepage works.
I have the htaccess code set up as:
RewriteEngine on
RewriteBase /
# Forward any url without the listed extentions to index.php
RewriteRule !\.(js|css|ico|txt|gif|jpg|jpeg|png|ttf)$ index.php
I dunno, this is the 5th install of Ubuntu I've had to do now to try and get this working but still at square one and not getting anywhere.
Does anyone have a working guide or solution to install all these technologies together and make them interact nicely?