Migrate website to Ubuntu webserver (apache2, php and mysql installed)

iKnow-IT banner

Upload limit in phpmyadmin: was 2M
$ sudo vi /etc/php5/apache2/php.ini
upload_max_filesize = 100M
post_max_size = 100M
$ sudo /etc/init.d/apache2 restart

create db user in phpmyadmin conform settings.php
$ sudo vi /volume1/web/<SITENAME>/sites/default/settings.php

$ cd /etc/apache2/sites-available
$ sudo cp default <SITENAME>
$ sudo nano <SITENAME>
Edit the file to look like this (the changes are in bold).

       <VirtualHost *:80>
       ServerAdmin webmaster@localhost
       ServerName <SITENAME>

       DocumentRoot /volume1/web/<SITENAME>
       <Directory />
               Options FollowSymLinks
               AllowOverride None
       </Directory>
       <Directory /volume1/web/<SITENAME>>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
       </Directory>

       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
       <Directory "/usr/lib/cgi-bin">
               AllowOverride None
               Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
               Order allow,deny
               Allow from all
       </Directory>

       ErrorLog /var/log/apache2/error.log

       # Possible values include: debug, info, notice, warn, error, crit,
       # alert, emerg.
       LogLevel warn

       CustomLog /var/log/apache2/access.log combined

   Alias /doc/ "/usr/share/doc/"
   <Directory "/usr/share/doc/">
       Options Indexes MultiViews FollowSymLinks
       AllowOverride None
       Order deny,allow
       Deny from all
       Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>

</VirtualHost>
       Note: The line that changes AllowOverride None to AllowOverride All is  required if you want to enable URL re-writes through a .htaccess file.
$ sudo a2ensite <SITENAME>                
$ sudo vi /etc/hosts (change the row in)
               127.0.0.1 localhost <SITENAME>

$ sudo /etc/init.d/apache2 reload

If you use another as port 80 you can add the port to the /etc/apache2/ports.conf file
like:
NameVirtualHost *:8066
Listen 8066

$ sudo vi /etc/apache2/ports.conf

$ sudo a2enmod vhost_alias rewrite

$ sudo /etc/init.d/apache2 reload