M
M
mr-ZA2018-02-08 11:50:20
linux
mr-ZA, 2018-02-08 11:50:20

How to set up a test environment on LAMP to test the operation of a website?

Greetings to all, I would like to learn more about the answer to this question from knowledgeable people ..
In general, we need a test environment for php-js-mysql mocking on Debian9
-Lamp installed according to the instructions from the loss, everything works
-It seemed very convenient for me to create a directory site and connecting via a2ensite --> site.conf to use the file manager directly in the Apache web face and run test pieces of code directly from the browser
- The problem is that it often happens that the directory is inaccessible and Apache swears:
+ I had to add a crutch and write in the script chmod 777
-Besides, I set up synchronization of files with RSYNC
host Windows —> share folder in win —> virtualbox-mounted share folder in Debian —> site folder test-site
- Also created a task in [sudo crontab -e] —> */2 * * * * /var /www/test-site/script.sh
Please explain how to set up this whole zoo in a normal way. The
script is located in the /var/www directory and its contents are as follows:

#!/bin/bash
rsync -avzh --delete /media/sf_shara/web/test/ /var/www/test-site/
sudo chmod -R 777 /var/www/test-site/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Victor Taran, 2018-02-08
@mr-ZA

Everything is very simple.
1. You mount the /var/www folder on linux.
Actually, all
2 options are using openserver on Windows (if you swim in Linux, then it’s the very thing) https://ospanel.io/ for developing tools here for the eyes, and as a full-fledged web server can be used.
3. Rights to files, here I will give you food for thought
, rights are not 644but 644 www-data: www:dateor something like that (there are actually even more of them)
Do not forget that
1 group is responsible for the rights of the admin
2 group is responsible for the rights of trusted users (members of group)
3 all others
Therefore, you do not have rights, since your user is not included in the www-data group (from which Apache runs) or from whichever web server you run there. (in the current configuration, this will not help either, since the trust group also has 4, but if it were 774 it would work;)
Therefore, what you need to do
In this case, the owner will be the web server and it will fall into the first group where you have 6 and not 4
Well, or from the reverse, change the user for Apache to yours.
here's another for clarity
5a7c3ede3e1f9755399523.png

S
Sanes, 2018-02-08
@Sanes

https://bitbucket.org/Drobkov/userplus-webserver-ubuntu

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question