Sekedar pengingat saja, jadi maaf kalau berantakan.. :D
# INSTALL APACHE
sudo apt install apache2
sudo ufw app list
sudo ufw app info "Apache Full"
sudo ufw allow in "Apache Full"
test : http://your_server_ip
cek ip address :
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
# INSTALL MYSQL
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
sudo vi /etc/mysql/my.cnf
[mysqld]
validate_password.policy=LOW
#Jika pusing hapus aja policy nya :
#1. Login to the mysql server as root mysql -h localhost -u root -p
#2. Run the following sql command: uninstall plugin validate_password;
#3. If last line doesn't work (new mysql release), you should execute UNINSTALL COMPONENT 'file://component_validate_password';
FLUSH PRIVILEGES;
Cek ulang :
SELECT user,authentication_string,plugin,host FROM mysql.user;
exit
sudo apt install php libapache2-mod-php php-mysql
sudo vi /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
# menjadi :
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
sudo systemctl restart apache2
sudo systemctl status apache2
# MEMBUAT VIRTUAL HOST APACHE
sudo vi /etc/apache2/sites-available/your_domain.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName your_domain
ServerAlias www.your_domain
DocumentRoot /var/www/your_domain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite your_domain.conf
sudo a2dissite 000-default.conf
sudo apache2ctl configtest
sudo vi /etc/apache2/apache2.conf
ServerName gudangarsip.my.id
sudo systemctl restart apache2
# INSTALL PHP
sudo apt update
sudo apt-get install php7.4-gettext
sudo apt install phpmyadmin php-mbstring php-gettext
sudo phpenmod mbstring
sudo systemctl restart apache2
# INSTALL phpmyadmin
sudo vi /etc/apache2/conf-available/phpmyadmin.conf
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
. . .
sudo vi /usr/share/phpmyadmin/.htaccess
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user
sudo htpasswd -c /etc/phpmyadmin/.htpasswd username