Cara Install LEMP untuk Laravel di Ubuntu
Install NGINX
sudo apt install nginx
Install MySQL/MariaDB
sudo apt-get install mysql-server
sudo mysql_secure_installation
sudo apt install mariadb-server mariadb-client
Install PHP
Set PPA PHP
sudo apt-get install software-properties-common
sudo apt install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Install PHP Extension and Other
PHP 5.6 Version:
sudo apt-get install php5.6-xml php5.6-gettext php5.6-memcached php5.6-cli php5.6-common php5.6-json php5.6-opcache php5.6-mysql php5.6-mbstring php5.6-mcrypt php5.6-zip php5.6-fpm php5.6-ldap php5.6-tidy php5.6-recode php5.6-curl php5.6-sqlite3 php5.6-mysql php5.6-pgsql
PHP 7.1 version:
sudo apt-get install php7.1-xml php7.1-gettext php7.1-memcached php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm php7.1-ldap php7.1-tidy php7.1-recode php7.1-curl php7.1-sqlite3 php7.1-mysql php7.1-pgsql
PHP 7.4 version:
apt-get install php7.4 php7.4-fpm php7.4-xml php7.4-common php7.4-memcached php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mysql php7.4-mbstring php7.4-zip php7.4-fpm php7.4-ldap php7.4-tidy php7.4-curl php7.4-sqlite3 php7.4-mysql php7.4-pgsql
enable php-fpm to nginx
sudo nano /etc/php/7.4/fpm/pool.d/www.conf
search and define like this or uncomment
listen = /run/php/php7.4-fpm.sock
check php fpm default in nginx
sudo nano /etc/nginx/sites-available/default
and uncomment location of php section
Install PhpMyAdmin
sudo apt install phpmyadmin
please press esc
because we use nginx than apache or lightd
then select yes
when dbconfig-common package
prompt showed.
configure phpmyadmin to nginx
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
sudo chmod 775 -R /usr/share/phpmyadmin/
sudo chown root:www-data -R /usr/share/phpmyadmin/
Dont forget to always restart nginx after reconfig
sudo systemctl restart nginx
Fix Database
sudo mysql -u root
CREATE USER 'webapp'@'%' IDENTIFIED BY 'password_anda';
GRANT ALL PRIVILEGES ON *.* TO 'webapp'@'%' WITH GRANT OPTION;
Install Composer
wget -O composer-setup.php https://getcomposer.org/installer
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
Posting Komentar untuk "Cara Install LEMP untuk Laravel di Ubuntu"