Skip to main content

Thread: Per user public_html directory not working


i have configured apache web server , configured access public_html per user directory. however, whenever trying access public_html directory of user, giving me 404 error.

apache2.conf file -

code:
#  # based upon ncsa server configuration files rob mccool.  #  # main apache server configuration file.  contains  # configuration directives give server instructions.  # see http://httpd.apache.org/docs/2.2/ detailed information  # directives.  #  # not read instructions in here without understanding  # do.  they're here hints or reminders.  if unsure  # consult online docs. have been warned.    #  # configuration directives grouped 3 basic sections:  #  1. directives control operation of apache server process  #     whole (the 'global environment').  #  2. directives define parameters of 'main' or 'default' server,  #     responds requests aren't handled virtual host.  #     these directives provide default values settings  #     of virtual hosts.  #  3. settings virtual hosts, allow web requests sent  #     different ip addresses or hostnames , have them handled  #     same apache server process.  #  # configuration , logfile names: if filenames specify many  # of server's control files begin "/" (or "drive:/" win32),  # server use explicit path.  if filenames *not* begin  # "/", value of serverroot prepended -- "/var/log/apache2/foo.log"  # serverroot set "" interpreted  # server "//var/log/apache2/foo.log".  #    ### section 1: global environment  #  # directives in section affect overall operation of apache,  # such number of concurrent requests can handle or  # can find configuration files.  #    #  # serverroot: top of directory tree under server's  # configuration, error, , log files kept.  #  # note!  if intend place on nfs (or otherwise network)  # mounted filesystem please read lockfile documentation (available  # @ <url:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);  # save lot of trouble.  #  # not add slash @ end of directory path.  #  serverroot "/etc/apache2"    #  # accept serialization lock file must stored on local disk.  #  #<ifmodule !mpm_winnt.c>  #<ifmodule !mpm_netware.c>  lockfile /var/lock/apache2/accept.lock  #</ifmodule>  #</ifmodule>    #  # pidfile: file in server should record process  # identification number when starts.  # needs set in /etc/apache2/envvars  #  pidfile ${apache_pid_file}    #  # timeout: number of seconds before receives , sends time out.  #  timeout 300    #  # keepalive: whether or not allow persistent connections (more  # 1 request per connection). set "off" deactivate.  #  keepalive on    #  # maxkeepaliverequests: maximum number of requests allow  # during persistent connection. set 0 allow unlimited amount.  # recommend leave number high, maximum performance.  #  maxkeepaliverequests 100    #  # keepalivetimeout: number of seconds wait next request  # same client on same connection.  #  keepalivetimeout 15    ##  ## server-pool size regulation (mpm specific)  ##     # prefork mpm  # startservers: number of server processes start  # minspareservers: minimum number of server processes kept spare  # maxspareservers: maximum number of server processes kept spare  # maxclients: maximum number of server processes allowed start  # maxrequestsperchild: maximum number of requests server process serves  <ifmodule mpm_prefork_module>      startservers          5      minspareservers       5      maxspareservers      10      maxclients          150      maxrequestsperchild   0  </ifmodule>    # worker mpm  # startservers: initial number of server processes start  # maxclients: maximum number of simultaneous client connections  # minsparethreads: minimum number of worker threads kept spare  # maxsparethreads: maximum number of worker threads kept spare  # threadsperchild: constant number of worker threads in each server process  # maxrequestsperchild: maximum number of requests server process serves  <ifmodule mpm_worker_module>      startservers          2      minsparethreads      25      maxsparethreads      75       threadlimit          64      threadsperchild      25      maxclients          150      maxrequestsperchild   0  </ifmodule>    # event mpm  # startservers: initial number of server processes start  # maxclients: maximum number of simultaneous client connections  # minsparethreads: minimum number of worker threads kept spare  # maxsparethreads: maximum number of worker threads kept spare  # threadsperchild: constant number of worker threads in each server process  # maxrequestsperchild: maximum number of requests server process serves  <ifmodule mpm_event_module>      startservers          2      maxclients          150      minsparethreads      25      maxsparethreads      75       threadlimit          64      threadsperchild      25      maxrequestsperchild   0  </ifmodule>    # these need set in /etc/apache2/envvars  user ${apache_run_user}  group ${apache_run_group}    #  # accessfilename: name of file in each directory  # additional configuration directives.  see allowoverride  # directive.  #    accessfilename .htaccess    #  # following lines prevent .htaccess , .htpasswd files being   # viewed web clients.   #  <files ~ "^\.ht">      order allow,deny      deny      satisfy  </files>    #  # defaulttype default mime type server use document  # if cannot otherwise determine one, such filename extensions.  # if server contains text or html documents, "text/plain"  # value.  if of content binary, such applications  # or images, may want use "application/octet-stream" instead  # keep browsers trying display binary files though  # text.  #  defaulttype text/plain      #  # hostnamelookups: log names of clients or ip addresses  # e.g., www.apache.org (on) or 204.62.129.132 (off).  # default off because it'd overall better net if people  # had knowingly turn feature on, since enabling means  # each client request result in @ least 1 lookup request  # nameserver.  #  hostnamelookups off    # errorlog: location of error log file.  # if not specify errorlog directive within <virtualhost>  # container, error messages relating virtual host  # logged here.  if *do* define error logfile <virtualhost>  # container, host's errors logged there , not here.  #  errorlog /var/log/apache2/error.log    #  # loglevel: control number of messages logged error_log.  # possible values include: debug, info, notice, warn, error, crit,  # alert, emerg.  #  loglevel warn    # include module configuration:  include /etc/apache2/mods-enabled/*.load  include /etc/apache2/mods-enabled/*.conf    # include user configurations:  include /etc/apache2/httpd.conf    # include ports listing  include /etc/apache2/ports.conf    #  # following directives define format nicknames use  # customlog directive (see below).  # if behind reverse proxy, might want change %h %{x-forwarded-for}i  #  logformat "%v:%p %h %l %u %t \"%r\" %>s %o \"%{referer}i\" \"%{user-agent}i\"" vhost_combined  logformat "%h %l %u %t \"%r\" %>s %o \"%{referer}i\" \"%{user-agent}i\"" combined  logformat "%h %l %u %t \"%r\" %>s %o" common  logformat "%{referer}i -> %u" referer  logformat "%{user-agent}i" agent     # turn on userdirs    <ifmodule mod_userdir.c>      userdir public_html        <directory /home/*/public_html>        order allow,deny        allow      </directory>    </ifmodule>    #  # define access log virtualhosts don't define own logfile  customlog /var/log/apache2/other_vhosts_access.log vhost_combined      # include of directories ignores editors' , dpkg's backup files,  # see readme.debian details.    # include generic snippets of statements  include /etc/apache2/conf.d/    # include virtual host configurations:  include /etc/apache2/sites-enabled/

try this:
undo changes apache2.conf, execute these commands:
code:
sudo a2enmod userdir sudo /etc/init.d/apache2 restart
see /etc/apache2/mods-available/userdir.conf

hope helps


Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [SOLVED] Per user public_html directory not working


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account