The easiest way is to change the user of the directory /opt/lampp/htdocs:
Code:
sudo chown username /opt/lampp/htdocs
This is (in my opinion) the easiest option for your own use, but not a good option for a real web server (outside your computer).
You can also log in as root, but that could be dangerous! As root, you have total control over the system, and you can accidentally delete files and do other dangerous things you don't want. So DON'T use it.
And you can also, as john newbuntu said, change the root directory of the web server (root means the base directory, in this case).

