Shared folder of VirtualBox as Apache2 www directory

Ramesh-X

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..?

Ramesh-X

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]

編集
0

コメントを追加

0

関連記事

分類Dev

VirtualBox Guest Shared Folder Ignoring umask

分類Dev

How to restrict access to a folder in Apache2

分類Dev

Virtualbox shared folder mount from fstab fails; works once bootup is complete

分類Dev

Having Apache Access Folder Inside Home Directory

分類Dev

Assining permission to www folder

分類Dev

Symlink /var/www directory

分類Dev

How to redirect apache /var/www to the home directory and access all the directories and files in my home directory?

分類Dev

Shared Folder Students

分類Dev

Permission denied inside /var/www/html when creating a website and it's files with the apache2 server

分類Dev

apache2 / var / www / html403エラー

分類Dev

raspbianのapache2でSSLとWWWを強制する

分類Dev

Apache2の操作方法www.example.com

分類Dev

Change workspace directory of eclipse to www

分類Dev

CGI scripts on Apache2 gives 403 forbidden when the CGI are in a linked folder

分類Dev

Moving Folder in a Directory

分類Dev

Rename the folder of document directory

分類Dev

Access a shared folder from Android

分類Dev

Cannot write to Samba shared folder

分類Dev

samba shared folder and mounted disk

分類Dev

How to setup apache2 virtualhosts on your home directory on ubuntu 14.04?

分類Dev

apache2 not using directory specified in site-available/joomla.conf

分類Dev

I installed PHP7 but apache2 directory in /etc is not created. Now what?

分類Dev

Its better to put Symfony 2 in the "root" of the website (www) or in a sub-folder?

分類Dev

UbuntuのApacheのDocumentRootは/ var / www / htmlなので、apache2.confの一部に「<Directory / var / www />」と表示されるのはなぜですか。

分類Dev

Default permission of `/var/www` folder in Ubuntu

分類Dev

.htaccess redirect non-www to www except one directory not working

分類Dev

Added a folder to www. Appears as Folder structure on browser

分類Dev

How to create folder in a directory not in working directory

分類Dev

How can I access a shared folder from R on Ubuntu to a 2nd Ubuntu machine using Samba?

Related 関連記事

  1. 1

    VirtualBox Guest Shared Folder Ignoring umask

  2. 2

    How to restrict access to a folder in Apache2

  3. 3

    Virtualbox shared folder mount from fstab fails; works once bootup is complete

  4. 4

    Having Apache Access Folder Inside Home Directory

  5. 5

    Assining permission to www folder

  6. 6

    Symlink /var/www directory

  7. 7

    How to redirect apache /var/www to the home directory and access all the directories and files in my home directory?

  8. 8

    Shared Folder Students

  9. 9

    Permission denied inside /var/www/html when creating a website and it's files with the apache2 server

  10. 10

    apache2 / var / www / html403エラー

  11. 11

    raspbianのapache2でSSLとWWWを強制する

  12. 12

    Apache2の操作方法www.example.com

  13. 13

    Change workspace directory of eclipse to www

  14. 14

    CGI scripts on Apache2 gives 403 forbidden when the CGI are in a linked folder

  15. 15

    Moving Folder in a Directory

  16. 16

    Rename the folder of document directory

  17. 17

    Access a shared folder from Android

  18. 18

    Cannot write to Samba shared folder

  19. 19

    samba shared folder and mounted disk

  20. 20

    How to setup apache2 virtualhosts on your home directory on ubuntu 14.04?

  21. 21

    apache2 not using directory specified in site-available/joomla.conf

  22. 22

    I installed PHP7 but apache2 directory in /etc is not created. Now what?

  23. 23

    Its better to put Symfony 2 in the "root" of the website (www) or in a sub-folder?

  24. 24

    UbuntuのApacheのDocumentRootは/ var / www / htmlなので、apache2.confの一部に「<Directory / var / www />」と表示されるのはなぜですか。

  25. 25

    Default permission of `/var/www` folder in Ubuntu

  26. 26

    .htaccess redirect non-www to www except one directory not working

  27. 27

    Added a folder to www. Appears as Folder structure on browser

  28. 28

    How to create folder in a directory not in working directory

  29. 29

    How can I access a shared folder from R on Ubuntu to a 2nd Ubuntu machine using Samba?

ホットタグ

アーカイブ