Skip to content

Niyabi/WDL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Everthing is still under construction.

WSL Debian localhost

Project purpose is to help with creating local Apache web server with PHP and MariaDB database.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development purposes.

Prerequisites

What things you need to install the software and how to install them

  • Windows Subsystem for Linux
  • Debian linux from Microsoft Store

Installing

A step by step how to install WDL

Update packages list, upgrade packages and install git

sudo apt update && sudo apt upgrade -y && sudo apt install -y git

Then clone repo

cd ~ && git clone https://github.com/Niyabi/WDL.git

Then let's run script which will install required packages and configure them. At The end phpMyAdmin installer will ask few things. When asked if to configure database check Yes, when asked about webserver check (using Spacebar) apache2.

sudo sh ~/WDL/wdl.sh

How to use

To start web server run start.sh.

sudo sh ~/WDL/start.sh

To stop web server run stop.sh.

sudo sh ~/WDL/stop.sh

To create virtual host run virtual-host.sh. You will be asked for project name and path to project, eg myproject in /mnt/c/Users/YourUserName/Documents/myproject so your URL will be myproject.local.

sudo sh ~/WDL/virtual-host.sh

To connect to virtual host open Notepad as administrator, open hosts file in C:\Windows\System32\drivers\etc. Type localhost IP adress (127.0.0.1) and project URL e.g. 127.0.0.1 myproject.local. Save and close file.

To access database use use HeidiSQL or phpMyAdmin (http://localhost/phpmyadmin/). To login to phpMyAdmin (if not asked for username during phpMyAdmin installation) username will be phpmyadmin and password the one you set during installation.

Notes

This configuration allows use of mutiple version of PHP at the same time. To install different, than 7.2, version of PHP use this command:

sudo apt install -y phpX.Y phpX.Y-fpm

For example:

sudo apt install -y php7.0 php7.0-fpm

To install PHP extension run:

sudo apt install -y phpX.Y-ext

For example:

sudo apt install -y php7.0-pdo

In virtual host config file (found here: /etc/apache2/sites-available/) you have to change php-fpm sock in this line:

SetHandler "proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/"

For example:

SetHandler "proxy:unix:/var/run/php/php7.0-fpm.sock|fcgi://localhost/"

TODO

  1. User able to choose PHP version
  2. Additional PHP version installer
  3. Exception protection
  4. Apache optimization
  5. MariaDB optimization
  6. PHP optimization

Authors

License

This project is licensed under the GNU GPL v3 License - see the LICENSE.md file for details

About

WSL Debian localhost

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages