I can't access anything inside of localhost, whenever I try to access anything inside of localhost it gives me 403 Forbidden error. I also can't add any files into the var/www/ folder unless I open it through sudo; Nonetheless, when I access localhost itself the default html appears which says it works. What could be causing this to happen? Thanks.
|
|
||||
|
|
|
Well, for security reasons,
Related to your "403 Forbidden error" you must be sure that the files inside of However, if we wish to use another local folder for testing in our website/HTML/PHP code, we can change the default folder location used by our localhost/php engine to manage these files. This is done using the following procedure:
Then, change all occurrences of " After that you must restart the computer for the purpose of the changes to take effect. Do not forget also that the files must have the proper file permissions to run properly. (755 is usually sufficient, but some folders [and/or files] may need 777 permissions to read and write them correctly.) Another trick would be to stop/restart the Apache service but I prefer to restart the computer. In addition, you might need to clear your cache/browsing history in order to the changes take effect and stop receiving the It works! from the sample page. Good luck! Parts of this answers comes from: http://askubuntu.com/a/25045/9598 |
|||
|
|
|
Please write to terminal: "gksu nautuilus" (without quotes) write your (if you're admin) password to pup up window.Navigate to /var/ on your file system. Right click on "www" directory and go to properties->permissions and set your user account to owner. Sorry for the terrible English. Update #1 While writing the message I'm sorry I did not notice that you have answered. |
|||
|
|
|
Go to sudo vim /etc/apache2/sites-available/default and change DocumentRoot e.g. DocumentRoot /home/your-name/www [2] sudo /etc/init.d/apache2 restart |
|||
