简体   繁体   中英

apache 2.2 url to user home subfolder issue

I have an Ubuntu12 server running Apache 2.2.22. I setup a simple html page which worked fine. But what I really want to do is serve files that are in a Users folder. I have tried Alias and symlink but neither worked and all I get is connection timed out.

ServerName sitexyz.abc DocumentRoot /home/bill/folder AllowOverride All ...

If I change the file above (DocumentRoot and Directory settings) to look at /var/www/html the basic index.html there is served fine.

Ignoring ssl, password authentication etc I can't seem to get the basic serving of files right. What should I check or t'shoot first?

Thanks

Check the permissions of the user Apache is running as. It most likely does not have read permissions on other users' home directories.

This worked for me. I must admit I don't know what every line means. I hope someone else finds it useful.

    DocumentRoot /var/www/html
    <Directory /var/www/html/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /folder/ "/home/bill/folder/"
    <Directory "/home/bill/folder/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
    </Directory>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM