Install And Change Apache2 And MySQL Default Directory In Ubuntu 12.04

get the Apache2, PHP5 and MySQL

1
2
3
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install mysql-server

to move your default directory for your site in apache2 make directory where your new site will be stored, for this example i’ll use /home/www/

1
mdkir /home/www/

then set the permission

1
chown -R www-data:www-data /home/www

edit default file in /etc/apache2/sites-available/ to be like this, change the DocumentRoot and Directory to the new directory that you want, in this case im using /home/www

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        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 ${APACHE_LOG_DIR}/error.log

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

    CustomLog ${APACHE_LOG_DIR}/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>

restart the apache2

1
sudo service apache2 restart

done!

to change MySQL default data directory to new one, here’s the step

first stop the MySQL Service

1
sudo service mysql stop

make new directory to store your new data, in this example i’ll use /home/mysql

1
sudo mkdir /home/mysql

copy your mysql data from the old one to the new one

1
sudo cp -R /var/lib/mysql/* /home/mysql/

set the permission

1
sudo chown -R mysql:mysql /home/mysql

edit my.cnf file in /etc/mysql , just edit the data location from

1
datadir = /var/lib/mysql

to

1
datadir = /home/mysql

then edit /etc/apparmor.d/usr.sbin.mysqld

1
sudo gedit /etc/apparmor.d/usr.sbin.mysqld

change

1
2
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,

to

1
2
/home/mysql/ r,
/home/mysql/** rwk,

Reload apparmor

1
sudo /etc/init.d/apparmor reload

Then start mysql

1
sudo service mysql start

Good Luck!!

Asus S46CM Simple Review

Specification:

Processor : Intel® Core™ i5 3317U Processor
Operating System : Windows 8 Single Language OEM
Chipset : Intel® HM76 Express Chipset
Memory : DDR3 1600 MHz SDRAM, 2 x SO-DIMM socket for expansion up to 8 GB SDRAM
Display : 14.0″ 16:9 HD (1366×768) LED Backlight
Graphic : NVIDIA® GeForce® GT 635M with 2GB DDR3 VRAM
Storage : 2.5″ SATA 750GB 5400RPM + 24GB SSD Cache
Optical Drive : No Optical Drive
Card Reader : card reader ( SD )
Camera : HD Web Camera
Networking :
Integrated 802.11 b/g/n
Built-in Bluetooth™ V4.0 (Optional)
10/100/1000 Base T
Interface:
1 x COMBO audio jack
1 x VGA port/Mini D-sub 15-pin for external monitor
1 x USB 3.0 port(s)
2 x USB 2.0 port(s)
1 x RJ45 LAN Jack for LAN insert
1 x HDMI
Audio
Built-in Speakers And Microphone
Battery
4Cells 2950 mAh 44 Whrs
Power Adapter
Output :
19 V DC, 3.42 A, 65 W
Input :
100 -240 V AC, 50/60 Hz universal
Dimensions
34.8 x 24.8 x 2.10 ~2.10 cm (WxDxH)
Weight
2.0 kg (with 4 cell battery)

CPU-Z Validation :
CPUZ

GPU :
GPUZ
http://www.techpowerup.com/gpuz/drbgm/

GPUZ
http://www.techpowerup.com/gpuz/k2fmc/

WEI :
With Corsair Memory
Corsair

With Patriot
Patriot

Memory :
Default Memory
Samsung Memory

Corsair 4GB
Corsair

Patriot 4GB
Patriot

Left Side
Left Side

Right Side (Empty DVD Slot)
DVD Slot

Keyboard With Windows 8 Logo on Start Button
Keyboard

HWMonitor
HWMonitor

HDD 750GB
HDTune HDD 750GB

SSD Cache 24GB
HDTune SSD[/img]

PCMark 7
PCMark 7

3DMark 11
3DMark11

Super PI :
Super PI