0% found this document useful (0 votes)
44 views4 pages

How To Set Up The Htaccess File On Apache

The document provides instructions on how to install and configure LAMP servers and PHP on Linux systems. It includes steps on installing LAMP on Linux Mint with one command, installing different PHP versions on Ubuntu using PPAs, setting the default PHP version, installing PHP modules, and resetting the MySQL root password on Ubuntu 18.04.

Uploaded by

Eko Wahyudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views4 pages

How To Set Up The Htaccess File On Apache

The document provides instructions on how to install and configure LAMP servers and PHP on Linux systems. It includes steps on installing LAMP on Linux Mint with one command, installing different PHP versions on Ubuntu using PPAs, setting the default PHP version, installing PHP modules, and resetting the MySQL root password on Ubuntu 18.04.

Uploaded by

Eko Wahyudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Object 1

How to Set Up the htaccess File on Apache


Pada baris “<Directory /var/www/html/example.com/public_html>”, ganti sesuai
kebuthuan “<Directory /var/www/html/koperasi>”

https://www.linode.com/docs/web-servers/apache/how-to-set-up-htaccess-on-apache/

How to Install LAMP Server on Linux Mint 18


With One Command
https://blog.storagecraft.com/install-lamp-server-linux-mint-18-
command/

sudo apt-get update && sudo apt-get dist-upgrade -y


sudo reboot
sudo apt-get install lamp-server^ -y
sudo nano /var/www/phpinfo.php

<?php phpinfo(); ?>

sudo service apache2 restart

sudo apt-get install phpmyadmin -y


How to Install Different PHP (5.6, 7.0 and 7.1)
Versions in Ubuntu
https://www.tecmint.com/install-different-php-versions-in-ubuntu/

Show PHP Version Information


$sudo apt show php
OR
$ sudo apt show php -a

Install PHP (5.6, 7.0, 7.1) on Ubuntu Using PPA


$ sudo apt install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php

$ sudo apt-get update

For Apache Web Server


$ sudo apt install php5.6 [PHP 5.6]
$ sudo apt install php7.0 [PHP 7.0]
$ sudo apt install php7.1 [PHP 7.1]

For Nginx Web Server


$ sudo apt install php5.6-fpm [PHP 5.6]
$ sudo apt install php7.0-fpm [PHP 7.0]
$ sudo apt install php7.1-fpm [PHP 7.1]

Install PHP
$ sudo apt install php5.6
$ sudo apt install php7.0
$ sudo apt install php7.1

------------ Install PHP Modules ------------


$ sudo apt install php5.6-cli php5.6-xml php5.6-mysql
$ sudo apt install php7.0-cli php7.0-xml php7.0-mysql
$ sudo apt install php7.1-cli php7.1-xml php7.1-mysql

check version : $ php -v

------------ Set Default PHP Version 5.6 ------------


$ sudo update-alternatives --set php /usr/bin/php5.6

------------ Set Default PHP Version 7.0 ------------


$ sudo update-alternatives --set php /usr/bin/php7.0
------------ Set Default PHP Version 7.1 ------------
$ sudo update-alternatives --set php /usr/bin/php7.1

To set the PHP version that will work with Apache web server, use the
commands below. First disable the current version with the a2dismod
command and then enable the one you want with the a2enmod command.
$ sudo a2dismod php7.0
$ sudo a2enmod php7.1
$ sudo systemctl restart apache2

After switching from one version to another, you can find your PHP
configuration file, by running the command below.
------------ For PHP 5.6 ------------
$ sudo update-alternatives --set php /usr/bin/php5.6
$ php -i | grep "Loaded Configuration File"

------------ For PHP 7.0 ------------


$ sudo update-alternatives --set php /usr/bin/php7.0
$ php -i | grep "Loaded Configuration File"

------------ For PHP 7,1 ------------


$ sudo update-alternatives --set php /usr/bin/php7.1
$ php -i | grep "Loaded Configuration File"
How to reset root MySQL password on
Ubuntu 18.04 Bionic Beaver Linux
https://linuxconfig.org/how-to-reset-root-mysql-password-on-ubuntu-18-
04-bionic-beaver-linux

$ sudo service mysql stop

$ sudo mkdir -p /var/run/mysqld


$ sudo chown mysql:mysql /var/run/mysqld

$ sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &


$ [1] 2708

$ jobs
[1]+ Running sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

$ mysql -u root

mysql> FLUSH PRIVILEGES;


Query OK, 0 rows affected (0.00 sec)

mysql> USE mysql;


Database changed
mysql> UPDATE user SET authentication_string=PASSWORD("Password_Baru") WHERE
User='root';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 1

mysql> UPDATE user SET plugin="mysql_native_password" WHERE User='root';


Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0

mysql> quit

$ sudo pkill mysqld


linuxconfig@ubuntu:~$ jobs
[1]+ Done sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking

$ sudo service mysql start

$ mysql -u root --password=Passw0rd_Baru

You might also like