Sort of OT

Robert Moskowitz rgm at htt-consult.com
Thu Sep 4 19:35:01 UTC 2014


On 09/03/2014 07:56 PM, Roger wrote:
> I'm hoping an apache expert may be able to help me.
> Following tutorials on how to set up apache to access a web page 
> development directory in my /home/user file system using <VirtualHost>.
>
> <VirtualHost *:80>
>     ServerAdmin user at localhost
>     DocumentRoot /var/www/html/mydirectory
>     ServerName localhost
>     ErrorLog ${APACHE_LOG_DIR}/error.log
>     CustomLog ${APACHE_LOG_DIR}/access.log combined
> </VirtualHost>
>
> I do not wish to change <DirectoryRoot> in httpd.conf.
>
> I loaded the config files (ubuntu and apple) as per web tutorials, 
> reset and restarted apache.
> Have the correct paths in <Directory "/a/b/c">
> But in a browser localhost/directory/index.html  always reports error: 
> Not Found The requested URL /directory was not found on this server.

Here is what I do:

cat <<EOF>/etc/httpd/conf.d/00-init.conf || exit 1
ServerAdmin me at fqdn
ServerName fqdn:80
# NameVirtualHost *:80
# NameVirtualHost *:443
EOF

then in the main httpd.conf:

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid.  This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
#
<IfModule mod_userdir.c>
     #
     # UserDir is disabled by default since it can confirm the presence
     # of a username on the system (depending on home directory
     # permissions).
     #
#    UserDir disable

     #
     # To enable requests to /~user/ to serve the user's public_html
     # directory, remove the "UserDir disable" line above, and uncomment
     # the following line instead:
     #
     UserDir public_html

</IfModule>

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
     AllowOverride FileInfo AuthConfig Limit
     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
     <Limit GET POST OPTIONS>
         Order allow,deny
         Allow from all
     </Limit>
     <LimitExcept GET POST OPTIONS>
         Order deny,allow
         Deny from all
     </LimitExcept>
</Directory>

then don't for get permissions.

chmod 711 /home/me


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20140904/17c6e8c1/attachment.html>


More information about the users mailing list