Setup Ubuntu as a Web Server

So these are the general steps for setting up a web server (Apache, MySQL and PHP) on a Ubuntu server. If you are not sure on how to use unix command line see: http://www.leonardaustin.com/technical/ssh-commands

Install Apache MySQL and PHP

sudo tasksel install lamp-server
sudo /usr/sbin/apache2ctl restart

Install mod_rewrite

sudo a2enmod rewrite
sudo /usr/sbin/apache2ctl restart

You also need to find this file:

/etc/apache2/sites-available/default

and change “AllowOverride None” to “AllowOverride All” it appears a couple of times.

Install PHPMyAdmin

sudo apt-get install phpmyadmin

“In /etc/apache2/apache2.conf” Add “Include /etc/phpmyadmin/apache.conf”
The restart apache

sudo /usr/sbin/apache2ctl restart

Install XBedug – Optional for DEV only

sudo apt-get install php5-dev php-pear
sudo pecl install xdebug

# Make a note of the location of the xedebug.so then create a xdebug.ini with the below info and put it into “/etc/php5/conf.d”

; xdebug debugger
zend_extension="/usr/lib/php5/20060613/xdebug.so"
# IN php.ini file make sure html_errors = true
sudo /etc/init.d/apache2 restart

PHP Important Folder and Files

# /etc/php5
# /etc/php5/apache2/php.ini

Apache Important Folder and Files

# /etc/apache2/
# /etc/apache2/apache2.conf
# /etc/apache2/sites-available/default

Web Folder

# /var/www

Other Steps

Change php.ini errors to show all

Related posts:

  1. Install APC on Ubuntu with PHP 5.3
  2. Installing LAMP on Ubuntu
  3. phpize: not found
  4. How to Install Rsync on Ubuntu
  5. Sendmail on Ubuntu

Twitter Updates