Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have the following directory setup:

/var/www/html

and

/home/tim/Website/files_here

The folder html is actually a link to /home/tim/Website. This means all my Website files are in my home area (they get included in the backup etc).

Is there anything wrong with this method? Is there a better way to get the homepage to be in /home/tim/Website?

Are symbolic links on a web server ever incompatible with users not on linux?

share|improve this question
1  
Symlinks are somewhat bad practice on a web-server. There is a good explanation on Server Fault about this: serverfault.com/a/244612/66406. But, in your case, you are using the symbolic link on your root directory, so you can still have the FollowSymLinks option in apache disabled and it would still work. So that security problem wouldn't be an issue. –  Dan Sep 24 at 15:54

1 Answer 1

up vote 17 down vote accepted

There's nothing wrong with that, as long as the apache process can read the files in your home directory.

If you're on a development machine, you could just as well put your files under the /var/www directory or a subdirectory thereof, but you can also edit /etc/apache2/sites-available/default so that the line with DocumentRoot points to your /home/tim/Website/files_here folder.

There's also mod_userdir, an apache module that permits files in /home/<username>/public_html to be served.

share|improve this answer
    
+1 Perfect, it explained everything I wanted to know and extra! –  Tim Sep 1 at 9:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.