Home LAMPP
Post
Cancel

LAMPP

Siap nanti belom ya :D

Apache2

1
sudo apt install -y apache2

PHP

1
2
sudo apt-get install -y php libapache2-mod-php
sudo apt-get install -y php-curl php-gd php-json php-mbstring php-xml

MySql

1
2
3
4
5
6
7
8
9
10
11
sudo apt-get install -y mysql-server php-mysql
sudo service mysql restart
sudo mysql_secure_installation
    #> Validate password component: N
    #> New password: MyPassword
    #> Remove anonymous users: Y
    #> Disallow root login remotely: Y
    #> Reload privilege tables now: Y
sudo service mysql stop
sudo usermod -d /var/lib/mysql mysql
sudo service mysql start

change doc root to home

1
2
3
4
cd ~
mkdir www
sudo sed -i "s;/var/www;$HOME/www;g" /etc/apache2/apache2.conf
sudo sed -i "s;/var/www/html;$HOME/www;g" /etc/apache2/sites-available/000-default.conf
1
2
3
mkdir ~/test
# optional
# sudo chown -R $USER:$USER ~/test

create domain

1
sudo nano /etc/apache2/sites-available/test.conf
  • add these: ```

<VirtualHost *:80> ServerName your_domain ServerAlias www.your_domain ServerAdmin webmaster@localhost DocumentRoot /var/www/your_domain ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>

1
2
3
4
5
6
sudo a2ensite test.dev
sudo a2dissite 000-default
sudo apache2ctl configtest
sudo service apache2 reload

## Config Firewall / UFW

sudo ufw app list sudo ufw allow in “Apache” sudo ufw status ```

matikan saja dulu firewall di ubuntu wsl, lagian ini cuman kita jadiin sebagai development server.

This post is licensed under CC BY 4.0 by the author.