Install my LAMP on ubuntu 18.

Install my LAMP on ubuntu 18.

1 apt-get update
2 chmod 0600 /var/swapfile
3 mkswap /var/swapfile
4 swapon /var/swapfile
10 vi /etc/fstab
11 add to fstab: /var/swapfile swap swap defaults 0 0
12 mysql -u root -h localhost -p
13 mysql -u root -h localhost
mysql> use mysql;
UPDATE user set plugin=’mysql_native_password’ where user=’root’;
ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘newpassword’;
FLUSH PRIVILEGES;
quit
24 Install PHP 7.3
25 apt install software-properties-common
26 add-apt-repository ppa:ondrej/php
27 apt install php7.3 php7.3-common php7.3-opcache php7.3-cli php7.3-gd php7.3-curl php7.3-mysql
28 php -v

29 adduser webmaster, user of the folder /home/webmaster in order to be used by the webmaster, folder where the site files are.
30 systemctl restart apache2
31 vi /etc/apache2/envvars, change the user www-data to webmaster
32 chmod -R webmaster.webmaster /var/log/apache2/
33 chown -R webmaster.webmaster /var/log/apache2/
34 chown -R webmaster.webmaster /var/run/apache2/
35 chown -R webmaster.webmaster /var/lock/apache2/
36 systemctl restart apache2
37 ps aux
38 vi /etc/apache2/apache2.conf , edit the path or document root to /home/webmaster/yoursite, to use rewite change the line AllowOverride from none to All.
39 vi /etc/apache2/sites-available/000-default.conf, edit the documentroot again.
40 systemctl restart apache2
41 exit
42 a2enmod rewrite
43 systemctl restart apache2

Leave a Reply