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

chanzerre

I have installed Apache(LAMP) web server on my ubuntu machine and I want to do the above mentioned thing.I have tried creating symbolic links in the /var/www directory but it only shows files but not directories inside the directory linked.I want to redirect /var/www to my home folder so that I can access all the files and directories contained therein.Please help me.

Geppettvs D'Constanzo

I must warn you that what you wish to do is very risky and I don't suggest you to do it so.

But if you yet wish to do it AT YOUR OWN RISK:

You can change your default folder for www content by editing the information provided inside the /etc/apache2/sites-available/default file. By dropping sudo gedit /etc/apache2/sites-available/default and changing any occurrence of the /var/www and setting the folder that you wish to use.

The contents of the file will look like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/geppettvs/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/geppettvs/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

In this case I am using my /home/geppettvs/www folder in order to place the files that will be exposed to the public via http connections (port 80).

Give this a try. I hope this help you.

Please note that you may experience some issues when attempting to do certain things in some files or folders from the root directory if you don't give them the proper permissions but that's worth another question.

Good luck!

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Allowing apache access to a subdirectory in a home directory without access to the home directory

分類Dev

Having Apache Access Folder Inside Home Directory

分類Dev

What are .serverauth.##### files in my home directory?

分類Dev

I really need to access my files :( from my previous Home directory

分類Dev

Upstart PID files in home directory?

分類Dev

Setting Home Directory to `/home`

分類Dev

Find files over certain size under my home directory

分類Dev

Why there are so many cron.#### files in my home directory?

分類Dev

How to give user access to specific folder in home directory

分類Dev

How to I allow direct write access to a directory under /home/username?

分類Dev

How can I mount a drive under my home directory at boot?

分類Dev

How to move my GnuPG home directory from Ubuntu to Mac?

分類Dev

Unable to access file in home directory (Jupyter Notebook)

分類Dev

In Unix how would I copy /etc/passwd using relative path to a directory under my home directory?

分類Dev

How to move maven directory ".m2" from my home directory after installing IntelliJ

分類Dev

Adding directory to PYTHONPATH causes my home directory to be added as well

分類Dev

An inaccessible directory with a random name has appeared in my home directory

分類Dev

Moving /home to an existing directory

分類Dev

Home directory messed up

分類Dev

Changing Home Directory for cygwin

分類Dev

ssh and home directory permissions

分類Dev

Home directory encryption

分類Dev

Resizing the Root and Home directory

分類Dev

How to remove /home/directory folders in bash?

分類Dev

How to remove bad entry in home directory

分類Dev

How to change HOME directory and start directory on MSYS2?

分類Dev

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

分類Dev

How to split a directory of files into sub-directories

分類Dev

How would another user reach your home directory using a relative path from his own home directory?

Related 関連記事

  1. 1

    Allowing apache access to a subdirectory in a home directory without access to the home directory

  2. 2

    Having Apache Access Folder Inside Home Directory

  3. 3

    What are .serverauth.##### files in my home directory?

  4. 4

    I really need to access my files :( from my previous Home directory

  5. 5

    Upstart PID files in home directory?

  6. 6

    Setting Home Directory to `/home`

  7. 7

    Find files over certain size under my home directory

  8. 8

    Why there are so many cron.#### files in my home directory?

  9. 9

    How to give user access to specific folder in home directory

  10. 10

    How to I allow direct write access to a directory under /home/username?

  11. 11

    How can I mount a drive under my home directory at boot?

  12. 12

    How to move my GnuPG home directory from Ubuntu to Mac?

  13. 13

    Unable to access file in home directory (Jupyter Notebook)

  14. 14

    In Unix how would I copy /etc/passwd using relative path to a directory under my home directory?

  15. 15

    How to move maven directory ".m2" from my home directory after installing IntelliJ

  16. 16

    Adding directory to PYTHONPATH causes my home directory to be added as well

  17. 17

    An inaccessible directory with a random name has appeared in my home directory

  18. 18

    Moving /home to an existing directory

  19. 19

    Home directory messed up

  20. 20

    Changing Home Directory for cygwin

  21. 21

    ssh and home directory permissions

  22. 22

    Home directory encryption

  23. 23

    Resizing the Root and Home directory

  24. 24

    How to remove /home/directory folders in bash?

  25. 25

    How to remove bad entry in home directory

  26. 26

    How to change HOME directory and start directory on MSYS2?

  27. 27

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

  28. 28

    How to split a directory of files into sub-directories

  29. 29

    How would another user reach your home directory using a relative path from his own home directory?

ホットタグ

アーカイブ