How can I make a public HTML folder in Ubuntu?

前端 未结 3 762
北海茫月
北海茫月 2021-02-03 22:51

Simple question, but for some reason I couldn\'t find the exact answer on Google:

I have a fresh Ubuntu install on Slicehost, and would like to make a public directory i

3条回答
  •  悲哀的现实
    2021-02-03 23:29

    The other answers are on the right track with mod_userdir, but using that will give your website the base URL http://www.yourdomain.com/~username/ - for instance, a file /home/username/public_html/index.html would be accessible as http://www.yourdomain.com/~username/index.html. If you want your files to be accessible under the domain root, as http://www.yourdomain.com/index.html for example, then you'll need to put the directive

    DocumentRoot /home/username/public_html
    

    in the Apache configuration file.

提交回复
热议问题