-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_lamp.txt
77 lines (58 loc) · 1.78 KB
/
install_lamp.txt
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Install Tasksel
sudo apt-get -y install tasksel
# Install LAMP
sudo tasksel install lamp-server
#aptitude failed error?
sudo apt-get update
# Install PHPMyAdmin
sudo apt-get install phpmyadmin
#if mysql version >= 5.7 and mysql only work with sudo then
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# Set group to www-data
sudo chgrp www-data /var/www/html
# Make it writable for the group
sudo chmod 775 /var/www/html
# Set GID to www-data for all sub-folders
sudo chmod g+s /var/www/html
# Add your username to www-data group
sudo usermod -a -G www-data username
# Finally change ownership to username
sudo chown username /var/www/html
# Your account shouldn't have any more permission issues
#Install Curl for PHP5
sudo apt-get install php5-curl
#Install Curl for > php5
sudo apt-get install php-curl
#Install Mycrypt for PHP5
sudo apt-get install php5-mcrypt
#Install Mycrypt > PHP5
sudo apt-get install php-mcrypt
#Activate Mcrypt For PHP5
sudo php5enmod mcrypt
#Activate Mcrypt > PHP5
sudo phpenmod mcrypt
# Restart Apache
sudo service apache2 reload
Enable Mod-Rewrite
# enable rewrite
sudo a2enmod rewrite
# restart apache
sudo service apache2 restart
Install Composer First
cd ~
curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
sudo nano /etc/mysql/my.cnf
[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
How To Add Swap Space
sudo fallocate -l 2G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab