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.
Ubuntu – How to redirect apache /var/www to the home directory and access all the directories and files in the home directory
13.04Apache2
Best Answer
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 droppingsudo 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:
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!