I using VirtualBox in Windows and I have installed Kali Linux on it. I have configured NAT network so that I can connect to the Apache server in the Linux VM through Windows browser. It works fine and I can access files in /var/www
folder in my VM.
I have set a shared folder that can be accessed by both Windows and Kali Linux. I want to set that folder as the www
folder Apache2 server. How can I do that..?
I tried editing apache2.conf
file by replacing <Directory /var/www>
as <Directory /media/sf_www>
. (sf_www
is the shared folder). But it gives 403
error.
Then I tried replacing vboxsf:x:142:
with vboxsf:x:142:www-data
in /etc/group
file and restart the VM. But the result was same.
So, how can I configure a shared folder as the www
folder of the Apache2 server..?
No need to manually mount the folder. Tick the auto mount
option in the shared folder settings. My shared folder is named as www
. So the folder will be created in as media/sf_www
in the VM.
Replace <Directory /var/www> ... </Directory>
tag with the following code in the /etc/apache2/apache2.conf
file.
<Directory /media/sf_www>
Options Indexes
AllowOverride None
Order Allow,Deny
Allow from all
Require all granted
</Directory>
Replace DocumentRoot /var/www/html
line in the file /etc/apache2/sites-available/000-default.conf
with DocumentRoot /media/sf_www
Add user group in the file /ect/group
.
Restart the machine. All done.
Tested in Kali Linux 2016.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加