PPIL project to create a carpooling web application
In "Nom du Virtual Host" write the name of the api : api-traveltogether
Write the path in the second field to the index.php file. (.../www/TravelTogether/backend).
Leave the last field empty.
Follow the instructions with DNS reload.
Restart WAMP if rewrite_module was disabled.
sudo gedit /opt/lampp/etc/httpd.conf
Check at the line 487-488 and uncomment the line with the Include.
You have to get this line
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
Restart XAMPP
Open the hosts file
sudo gedit /etc/hosts
Write the name of your domain like api-traveltogether
127.0.0.1 api-traveltogether
Go to the httpd-vhost file :
sudo gedit /opt/lampp/etc/extra/httpd-vhosts.conf
At the end of the file paste these lines :
<VirtualHost *>
DocumentRoot "chemin vers le dossier backend (../../TravelTogether/backend)"
ServerName api-traveltogether
<Directory "le chemin jusqu'au fichier index.php">
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
Restart XAMPP
Now you can acces to api from http://api-traveltogether/
Open cmd in Admin Open this file with notepad.exe
notepad.exe \drivers\etc\hosts
Add this line at the end :
127.0.0.1 api-traveltogether
Save and quit notepad
Open the file httpd-vhosts.conf at
C:\xampp\apache\conf\extra\httpd-vhosts.conf
Add these lines :
<VirtualHost *>
DocumentRoot "chemin vers le dossier backend (../htdocs/TravelTogether/backend)"
ServerName api-traveltogether
<Directory "chemin vers le dossier backend (../htdocs/TravelTogether/backend)">
Options FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
Save the file and restart XAMP.
Now you can acces to api from http://api-traveltogether/
Pull the project in your www folder
git pull github
cd TravelTogether
You must be in the folder containing the script.
SOURCE script.sql;
touch backend/dbconnect/dbinfos.php
put your db infos in the file like this :
<?php
$login = "your_login";
$password = "your_password";
$url = "same url than js file";
touch frontend/src/data/url_api.js
write your api url infos :
export const url_api = {
url: "http://domain_to_api_root",
};
Download Node.js from https://nodejs.org/en/download/
wget -qO- https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
cd frontend
npm install
npm start