Here is a guide on how to install fruithost as a development environment. The prerequisite is that your Windows machine supports the Windows Subsystem for Linux (WSL).
We recommend using Windows Terminal.
Enter the following command:
wsl --install --distribution Debian
Follow the instructions (if WSL has been started for the first time, restart your system later - you will receive restart information on this later).
Enter your user name and password and close the WSL window (not the Windows Terminal!).
The Version 1 of WSL is often set by default. Use the following command to switch to Version 2:
wsl --set-default-version 2
If you only enter wsl in the Windows Terminal, you can directly access the Debian system, otherwise the distribution must always be specified with the -d Debian parameter in the WSL command.
wsl --set-default Debian
First enter the command wsl --user root in the Windows Terminal. This starts Debian and you log in with the user name root.
Note that the next steps must be carried out only with the user root, as you need admin rights to set up the system.
Warning
This part is only for development. You will need the password later if you want to connect to the system with MySQL or the SFTP client.
Enter the following command and follow the instructions.
passwd
For the development environment, we assume that the my.fruit domain is used. The fruithost panel can be accessed after installation via the web address http://my.fruit/.
hostname my.fruit hostnamectl set-hostname my.fruit nano /etc/hosts
We restart the network interfaces so that the set host name is adopted:
sudo /etc/init.d/networking restart
ip address
Make a note of this IP address, as this is the IP of the Debian system. The entire server can be reached from here.
Since Debian does not have an active program service running under WSL by default, we need to edit two files to make Debian run automatically with systemd.
Follow the instructions below: https://github.com/fruithost/Documentation/blob/main/WSL2.md
apt update apt install curl lshw
Enter the installation command (as already described in the normal installation instructions) and follow the instructions:
curl -o- https://raw.githubusercontent.com/fruithost/Installers/master/debian.sh | bash
The installation takes some time (about 10 - 20 minutes) because a brand new installed system has to be updated and some packages are automatically compiled by packet-manager.
Look in the VirtualHost from the panel to see whether the host name was taken over during installation, as the system is not a real root server, this information, which is automatically available from a hosting provider, is missing:
nano /etc/fruithost/config/apache2/panel.conf
Check if the Hostname my.fruit was successfully written, otherwise correct it.
After a change, restart the webserver with following command:
service apache2 restart
Now you can open http://my.fruit/ on your webbrowser and log in to your account.
Open with administrator privileges the File C:\Windows\System32\drivers\etc\hosts with an Code-Editor (for Sample Notepad++).
And add developing domains to the hostfile, based on the given IP address from Debian (as in 3️⃣ ["Check IP-Address of Debian"] described):
# Panel-Domain
172.24.71.136 my.fruit
# Sample Domains for Testing
172.24.71.136 example1.fruit
172.24.71.136 example2.fruit
172.24.71.136 example3.fruit
172.24.71.136 example4.fruit
172.24.71.136 example5.fruit
apt install ssh
Change configuration of SSH
nano /etc/ssh/sshd_config
Add following lines (or modify the lines where the options are given):
PermitRootLogin yes
And restarting ssh:
service ssh restart
nano /etc/mysql/mariadb.conf.d/50-server.cnf
Add following lines (or modify the lines where the options are given):
#bind-address 127.0.0.1
And restart mysql:
service mariadb restart
Log into mysql:
mysql -u root use mysql; GRANT ALL ON . to 'root'@'%' IDENTIFIED BY '<YourRootPassword>' WITH GRANT OPTION; FLUSH PRIVILEGES; exit;