Solution: Apache2 personal web sharing 403 Forbidden error

Many people are puzzled about Apache 2 throwing 403 Forbidden errors when accessing the user's personal website, although the computer website works. And a lot of incorrect solutions are floating around. I decided to post some info that hopefully will clarify the issue.
As an example, my new Mac mini would run a website OK at http://192.168.0.2/ but my personal website at http://192.168.0.2/~username/ would give a 403 Forbidden error. I believe I have found out why. This is due to incorrect user-level settings that I believe were migrated from a previous OS version. I migrated from an old Power Mac G5 Quad with MacOS X 10.5 to my new Mac mini with MacOS X Lion 10.7.
The problem here is that Apache denies access to the user level Sites folder. If you create a new user on Lion, the system will create a username.conf, where username is the user's short name. But if you migrated from a previous version, this file will not exist, so Apache will not serve pages from the user's Sites folder. Some people tried to fix this by modifying httpd.conf, for example, by putting virtual hosts on the computer's main site. But that's not the right place to fix it. This should be fixed at the username.conf level. So.. look for this file with your username:
    /private/etc/apache2/users/yourusername.conf
If it does not exist, you will have to create it in a text editor, and change the owners. First get a text editor and create it, for example you could do this in pico
    sudo pico /private/etc/apache2/users/yourusername.conf
Then add this to the file and save it:
    <Directory "/Users/yourusername/Sites/">
    Options Indexes MultiViews ExecCGI
    AllowOverride AuthConfig FileInfo
    Order allow,deny
    Allow from all
    </Directory>
Be sure to hit Control-O (letter o) to write out the file then Control-X to exit the pico editor. Note that I have enabled some options, like ExecCGI to allow .cgi files to run, and Authconfig and FileInfo so some useful .htaccess methods work. You could dumb it down and say AllowOverride none like the default settings.
Once you have created the yourusername.conf file, you will have to change the ownership to system:wheel. However, oddly enough, you can't chown system, you have to chown root. So the command will look like this:
    sudo chown root:wheel /private/etc/apache2/users/yourusername.conf
You can put other directives here that will only apply to this user. Try to avoid modifying httpd.conf, it's easy to mess up globally and it can be hard to fix if you break it.

Howdy, I was having the same problem you were having, until I noticed that I had placed some incompatible File Sharing settings on my home folder. Specifically, I had placed No Access for the 'everyone' group, which is the group that Apache uses.
Thus, even though my ~/Sites folder had "public" permissions, the enclosing folder (~/) had even more restrictive permissions so Apache couldn't serve anything from it.
Check to see if you've enabled any custom File Sharing permissions on your home (or Sites) directory in the Sharing preference pane.
hth.
Message was edited by: Wesley Miyazaki [corrected OS version]

Similar Messages

  • Apache2 & personal web sharing

    I have installed apache 2.2.8 and on http://127.0.0.1/ and http://localhost/ the browser is serving /usr/local/apache2/htdocs/index.html but:
    1. personal web sharing just hangs waiting when I click Turn On PWS
    2. http://127.0.0.1/~macuser/ does not bring up an index.html I placed there (in /Users/macuser/Sites/ )
    I am not sure what did I do wrong, as I am not a code guy and new to this
    I run the whole compile and install process several times because it did not work and in the process I had removed the default apache 1.3 that was installed and working
    It also seems like my system startup time is significantly longer than before the apache2 installation.
    when I run sudo /usr/local/apache2/bin/apachectl start in terminal it says "already running" although sys pref would not show personal web sharing is on
    I am not sure how is this all related but all I want is to be able to serve pages via apache from my Sites directory
    any ideas would should I check for?
    PPC 10.4.11
    Thanks

    is fairly easy to remedy this,
    Edit the httpd.conf which is in the apache2 directory you have created.
    Once open (i'd recommend BBedit but txt edit will do just make sure it doesn't save the file to rich text)
    search down the httpd.conf file untill you find ;
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    and change it too
    #<IfModule !mpm_netware.c>
    PidFile /private/var/run/httpd.pid
    #</IfModule>
    I'm afraid you'll have to get a bit developer as the next section is in the terminal;
    open up the terminal and in a new shell Apple Key + N;
    first type; sudo
    Then Your password if your admin: your password
    Then : cd /usr/sbin/;
    Then: mv apachectl apachectl-1.3;
    Then : ln -s /apache2/bin/apachectl apachectl;
    You'll now be able to stop and start web serving from your system preference pane;
    You should also modify httpd.conf with the following (however this isn't essentila just to switch it on from system prefs)
    change user and group to:
    User www
    Group www
    You may also need to change owner of the httpd.conf in the terminal file to edit it.
    sudo chmod -R 777 ((drag your apache directory here))
    all done
    Message was edited by: purplepanda1

  • For those of you still having Personal Web Sharing problems

    With Personal Web Sharing, Leopard doesn't seem to bring the config files for individual user accounts over from the apache1 directory to the apache2 directory which is why sometimes when you visit http://localhost/~username you get a 403 error message.
    The solution is to Go To Folder, /etc, find the httpd -> users folder and copy all the files in there (should be one for each user account) into apache2 -> users and restart Personal Web Sharing.
    If you're still having problems, one of the issues is with Filevault. If you have Filevault turned on, Personal Web Sharing will still probably give you an error for your user account, but the system wide web server will be fine.

    Tried this but still does not work. Also from another computer I cannot access the user web share or the default one (locally I can access the default) without getting a 403. It just searches and searches. It recognises that there is a system there but not able to read anything. My firewall is off by the was so is Filevault.
    Thanks

  • 403 Forbidden Error on directory but not on index page.

    I can't seem to find the source of the 403 Forbidden error. Index page works as expected but accessing the owncoud directory throws this error. Configs below.
    httpd.conf
    condensed:
    ServerRoot "/etc/httpd"
    Listen 80
    LoadModule authn_file_module modules/mod_authn_file.so
    LoadModule authn_socache_module modules/mod_authn_socache.so
    LoadModule authn_core_module modules/mod_authn_core.so
    LoadModule authz_host_module modules/mod_authz_host.so
    LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
    LoadModule authz_user_module modules/mod_authz_user.so
    LoadModule authz_core_module modules/mod_authz_core.so
    LoadModule access_compat_module modules/mod_access_compat.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    LoadModule reqtimeout_module modules/mod_reqtimeout.so
    LoadModule include_module modules/mod_include.so
    LoadModule filter_module modules/mod_filter.so
    LoadModule mime_module modules/mod_mime.so
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule env_module modules/mod_env.so
    LoadModule headers_module modules/mod_headers.so
    LoadModule setenvif_module modules/mod_setenvif.so
    LoadModule version_module modules/mod_version.so
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_connect_module modules/mod_proxy_connect.so
    LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
    LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
    LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    LoadModule proxy_express_module modules/mod_proxy_express.so
    LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
    LoadModule ssl_module modules/mod_ssl.so
    LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
    LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
    LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
    LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
    LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    LoadModule unixd_module modules/mod_unixd.so
    LoadModule status_module modules/mod_status.so
    LoadModule autoindex_module modules/mod_autoindex.so
    LoadModule negotiation_module modules/mod_negotiation.so
    LoadModule dir_module modules/mod_dir.so
    LoadModule php5_module modules/libphp5.so
    LoadModule userdir_module modules/mod_userdir.so
    LoadModule alias_module modules/mod_alias.so
    <IfModule unixd_module>
    User http
    Group http
    </IfModule>
    ServerAdmin [email protected]
    <Directory />
    AllowOverride none
    Require all denied
    </Directory>
    DocumentRoot "/srv/http"
    <Directory "/srv/http">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    </Directory>
    <Directory "/srv/http/owncloud">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    </Directory>
    <IfModule dir_module>
    DirectoryIndex index.html
    </IfModule>
    <Files ".ht*">
    Require all denied
    </Files>
    ErrorLog "/var/log/httpd/error_log"
    LogLevel warn
    <IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "/var/log/httpd/access_log" common
    </IfModule>
    <IfModule alias_module>
    ScriptAlias /cgi-bin/ "/srv/http/cgi-bin/"
    </IfModule>
    <IfModule cgid_module>
    </IfModule>
    <Directory "/srv/http/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
    </Directory>
    <IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    </IfModule>
    Include conf/extra/httpd-mpm.conf
    Include conf/extra/httpd-multilang-errordoc.conf
    Include conf/extra/httpd-autoindex.conf
    Include conf/extra/httpd-languages.conf
    Include conf/extra/httpd-userdir.conf
    Include conf/extra/httpd-default.conf
    Include conf/vhosts/itiest.com
    Include conf/extra/php5_module.conf
    <IfModule proxy_html_module>
    Include conf/extra/proxy-html.conf
    </IfModule>
    Include conf/extra/httpd-ssl.conf
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    </IfModule>
    Include conf/extra/owncloud.conf
    With Comments:
    # This is the main Apache HTTP server configuration file. It contains the
    # configuration directives that give the server its instructions.
    # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
    # In particular, see
    # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
    # for a discussion of each configuration directive.
    # Do NOT simply read the instructions in here without understanding
    # what they do. They're here only as hints or reminders. If you are unsure
    # consult the online docs. You have been warned.
    # Configuration and logfile names: If the filenames you specify for many
    # of the server's control files begin with "/" (or "drive:/" for Win32), the
    # server will use that explicit path. If the filenames do *not* begin
    # with "/", the value of ServerRoot is prepended -- so "logs/access_log"
    # with ServerRoot set to "/usr/local/apache2" will be interpreted by the
    # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
    # will be interpreted as '/logs/access_log'.
    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    # Do not add a slash at the end of the directory path. If you point
    # ServerRoot at a non-local disk, be sure to specify a local disk on the
    # Mutex directive, if file-based mutexes are used. If you wish to share the
    # same ServerRoot for multiple httpd daemons, you will need to change at
    # least PidFile.
    ServerRoot "/etc/httpd"
    # Mutex: Allows you to set the mutex mechanism and mutex file directory
    # for individual mutexes, or change the global defaults
    # Uncomment and change the directory if mutexes are file-based and the default
    # mutex file directory is not on a local disk or is not appropriate for some
    # other reason.
    # Mutex default:/run/httpd
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #Listen 12.34.56.78:80
    Listen 80
    # Dynamic Shared Object (DSO) Support
    # To be able to use the functionality of a module which was built as a DSO you
    # have to place corresponding `LoadModule' lines at this location so the
    # directives contained in it are actually available _before_ they are used.
    # Statically compiled modules (those listed by `httpd -l') do not need
    # to be loaded here.
    # Example:
    # LoadModule foo_module modules/mod_foo.so
    LoadModule authn_file_module modules/mod_authn_file.so
    #LoadModule authn_dbm_module modules/mod_authn_dbm.so
    #LoadModule authn_anon_module modules/mod_authn_anon.so
    #LoadModule authn_dbd_module modules/mod_authn_dbd.so
    LoadModule authn_socache_module modules/mod_authn_socache.so
    LoadModule authn_core_module modules/mod_authn_core.so
    LoadModule authz_host_module modules/mod_authz_host.so
    LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
    LoadModule authz_user_module modules/mod_authz_user.so
    #LoadModule authz_dbm_module modules/mod_authz_dbm.so
    #LoadModule authz_owner_module modules/mod_authz_owner.so
    #LoadModule authz_dbd_module modules/mod_authz_dbd.so
    LoadModule authz_core_module modules/mod_authz_core.so
    #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
    #LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
    LoadModule access_compat_module modules/mod_access_compat.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    #LoadModule auth_form_module modules/mod_auth_form.so
    #LoadModule auth_digest_module modules/mod_auth_digest.so
    #LoadModule allowmethods_module modules/mod_allowmethods.so
    #LoadModule file_cache_module modules/mod_file_cache.so
    #LoadModule cache_module modules/mod_cache.so
    #LoadModule cache_disk_module modules/mod_cache_disk.so
    #LoadModule cache_socache_module modules/mod_cache_socache.so
    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    #LoadModule socache_dbm_module modules/mod_socache_dbm.so
    #LoadModule socache_memcache_module modules/mod_socache_memcache.so
    #LoadModule watchdog_module modules/mod_watchdog.so
    #LoadModule macro_module modules/mod_macro.so
    #LoadModule dbd_module modules/mod_dbd.so
    #LoadModule dumpio_module modules/mod_dumpio.so
    #LoadModule echo_module modules/mod_echo.so
    #LoadModule buffer_module modules/mod_buffer.so
    #LoadModule data_module modules/mod_data.so
    #LoadModule ratelimit_module modules/mod_ratelimit.so
    LoadModule reqtimeout_module modules/mod_reqtimeout.so
    #LoadModule ext_filter_module modules/mod_ext_filter.so
    #LoadModule request_module modules/mod_request.so
    LoadModule include_module modules/mod_include.so
    LoadModule filter_module modules/mod_filter.so
    #LoadModule reflector_module modules/mod_reflector.so
    #LoadModule substitute_module modules/mod_substitute.so
    #LoadModule sed_module modules/mod_sed.so
    #LoadModule charset_lite_module modules/mod_charset_lite.so
    #LoadModule deflate_module modules/mod_deflate.so
    #LoadModule xml2enc_module modules/mod_xml2enc.so
    #LoadModule proxy_html_module modules/mod_proxy_html.so
    LoadModule mime_module modules/mod_mime.so
    #LoadModule ldap_module modules/mod_ldap.so
    LoadModule log_config_module modules/mod_log_config.so
    #LoadModule log_debug_module modules/mod_log_debug.so
    #LoadModule log_forensic_module modules/mod_log_forensic.so
    #LoadModule logio_module modules/mod_logio.so
    #LoadModule lua_module modules/mod_lua.so
    LoadModule env_module modules/mod_env.so
    #LoadModule mime_magic_module modules/mod_mime_magic.so
    #LoadModule cern_meta_module modules/mod_cern_meta.so
    #LoadModule expires_module modules/mod_expires.so
    LoadModule headers_module modules/mod_headers.so
    #LoadModule ident_module modules/mod_ident.so
    #LoadModule usertrack_module modules/mod_usertrack.so
    #LoadModule unique_id_module modules/mod_unique_id.so
    LoadModule setenvif_module modules/mod_setenvif.so
    LoadModule version_module modules/mod_version.so
    #LoadModule remoteip_module modules/mod_remoteip.so
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_connect_module modules/mod_proxy_connect.so
    LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
    LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
    #LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
    LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    LoadModule proxy_express_module modules/mod_proxy_express.so
    #LoadModule session_module modules/mod_session.so
    #LoadModule session_cookie_module modules/mod_session_cookie.so
    #LoadModule session_crypto_module modules/mod_session_crypto.so
    #LoadModule session_dbd_module modules/mod_session_dbd.so
    LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
    #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
    LoadModule ssl_module modules/mod_ssl.so
    #LoadModule dialup_module modules/mod_dialup.so
    LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
    LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
    LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
    LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
    LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    #LoadModule mpm_event_module modules/mod_mpm_event.so
    LoadModule unixd_module modules/mod_unixd.so
    #LoadModule heartbeat_module modules/mod_heartbeat.so
    #LoadModule heartmonitor_module modules/mod_heartmonitor.so
    #LoadModule dav_module modules/mod_dav.so
    LoadModule status_module modules/mod_status.so
    LoadModule autoindex_module modules/mod_autoindex.so
    #LoadModule asis_module modules/mod_asis.so
    #LoadModule info_module modules/mod_info.so
    #LoadModule suexec_module modules/mod_suexec.so
    #LoadModule cgid_module modules/mod_cgid.so
    #LoadModule cgi_module modules/mod_cgi.so
    #LoadModule dav_fs_module modules/mod_dav_fs.so
    #LoadModule dav_lock_module modules/mod_dav_lock.so
    #LoadModule vhost_alias_module modules/mod_vhost_alias.so
    LoadModule negotiation_module modules/mod_negotiation.so
    LoadModule dir_module modules/mod_dir.so
    LoadModule php5_module modules/libphp5.so
    #LoadModule imagemap_module modules/mod_imagemap.so
    #LoadModule actions_module modules/mod_actions.so
    #LoadModule speling_module modules/mod_speling.so
    LoadModule userdir_module modules/mod_userdir.so
    LoadModule alias_module modules/mod_alias.so
    #LoadModule rewrite_module modules/mod_rewrite.so
    <IfModule unixd_module>
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    User http
    Group http
    </IfModule>
    # 'Main' server configuration
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # <VirtualHost> definition. These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    # All of these directives may appear inside <VirtualHost> containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed. This address appears on some server-generated pages, such
    # as error documents. e.g. [email protected]
    ServerAdmin [email protected]
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    # If your host doesn't have a registered DNS name, enter its IP address here.
    #ServerName www.example.com:80
    # Deny access to the entirety of your server's filesystem. You must
    # explicitly permit access to web content directories in other
    # <Directory> blocks below.
    <Directory />
    AllowOverride none
    Require all denied
    </Directory>
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    DocumentRoot "/srv/http"
    <Directory "/srv/http">
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    Options Indexes FollowSymLinks
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # AllowOverride FileInfo AuthConfig Limit
    AllowOverride None
    # Controls who can get stuff from this server.
    Require all granted
    </Directory>
    <Directory "/srv/http/owncloud">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    </Directory>
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    <IfModule dir_module>
    DirectoryIndex index.html
    </IfModule>
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    <Files ".ht*">
    Require all denied
    </Files>
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here. If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    ErrorLog "/var/log/httpd/error_log"
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    <IfModule log_config_module>
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
    # You need to enable mod_logio.c to use %I and %O
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here. Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    CustomLog "/var/log/httpd/access_log" common
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #CustomLog "/var/log/httpd/access_log" combined
    </IfModule>
    <IfModule alias_module>
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL. You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client. The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    ScriptAlias /cgi-bin/ "/srv/http/cgi-bin/"
    </IfModule>
    <IfModule cgid_module>
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #Scriptsock cgisock
    </IfModule>
    # "/srv/http/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    <Directory "/srv/http/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
    </Directory>
    <IfModule mime_module>
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    TypesConfig conf/mime.types
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #AddType application/x-gzip .tgz
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #AddHandler cgi-script .cgi
    # For type maps (negotiated resources):
    #AddHandler type-map var
    # Filters allow you to process content before it is sent to the client.
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
    </IfModule>
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type. The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    #MIMEMagicFile conf/magic
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    # Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    # MaxRanges: Maximum number of Ranges in a request before
    # returning the entire resource, or one of the special
    # values 'default', 'none' or 'unlimited'.
    # Default setting is to accept 200 Ranges.
    #MaxRanges unlimited
    # EnableMMAP and EnableSendfile: On systems that support it,
    # memory-mapping or the sendfile syscall may be used to deliver
    # files. This usually improves server performance, but must
    # be turned off when serving from networked-mounted
    # filesystems or if support for these functions is otherwise
    # broken on your system.
    # Defaults: EnableMMAP On, EnableSendfile Off
    #EnableMMAP off
    #EnableSendfile on
    # Supplemental configuration
    # The configuration files in the conf/extra/ directory can be
    # included to add extra features or to modify the default configuration of
    # the server, or you may simply copy their contents here and change as
    # necessary.
    # Server-pool management (MPM specific)
    Include conf/extra/httpd-mpm.conf
    # Multi-language error messages
    Include conf/extra/httpd-multilang-errordoc.conf
    # Fancy directory listings
    Include conf/extra/httpd-autoindex.conf
    # Language settings
    Include conf/extra/httpd-languages.conf
    # User home directories
    Include conf/extra/httpd-userdir.conf
    # Real-time info on requests and configuration
    #Include conf/extra/httpd-info.conf
    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf
    # Local access to the Apache HTTP Server Manual
    #Include conf/extra/httpd-manual.conf
    # Distributed authoring and versioning (WebDAV)
    #Include conf/extra/httpd-dav.conf
    # Various default settings
    Include conf/extra/httpd-default.conf
    ## vhosts
    Include conf/vhosts/itiest.com
    Include conf/extra/php5_module.conf
    # Configure mod_proxy_html to understand HTML4/XHTML1
    <IfModule proxy_html_module>
    Include conf/extra/proxy-html.conf
    </IfModule>
    # Secure (SSL/TLS) connections
    Include conf/extra/httpd-ssl.conf
    # Note: The following must must be present to support
    # starting without SSL on platforms with no /dev/random equivalent
    # but a statically compiled-in mod_ssl.
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    </IfModule>
    # uncomment out the below to deal with user agents that deliberately
    # violate open standards by misusing DNT (DNT *must* be a specific
    # end-user choice)
    #<IfModule setenvif_module>
    #BrowserMatch "MSIE 10.0;" bad_DNT
    #</IfModule>
    #<IfModule headers_module>
    #RequestHeader unset DNT env=bad_DNT
    #</IfModule>
    Include conf/extra/owncloud.conf
    ##open_basedir=/srv/http/:/home/:/tmp/:/usr/share/pear/:/path/to/documentroot
    $  ls -al /srv/http/
    total 16876
    drwxr-xr-x 4 root http 4096 Mar 6 17:51 .
    drwxr-xr-x 4 root root 4096 Feb 15 13:57 ..
    -rwxrwxrwx 1 root http 295 Mar 6 11:51 index.html
    drwxrwxr-x 11 http http 4096 Feb 6 18:33 owncloud
    -rw-r--r-- 1 root root 17200380 Feb 6 18:41 owncloud-8.0.0.tar.bz2
    -rw-r--r-- 1 root root 52966 Mar 6 11:49 smallpizza.jpg
    -rw-r--r-- 1 root root 20 Mar 6 16:24 test.php
    # groups http
    wheel http
    Last edited by johan1391 (2015-03-07 04:11:12)

    /var/log/httpd/owncloud-error.log
    192.168.1.1 - - [06/Mar/2015:17:52:02 -0800] "GET /owncloud/ HTTP/1.1" 403 1002
    192.168.1.1 - - [06/Mar/2015:17:52:51 -0800] "GET /owncloud/ HTTP/1.1" 403 1002
    192.168.1.1 - - [06/Mar/2015:17:52:53 -0800] "GET /owncloud/ HTTP/1.1" 403 1002
    $ ls -al /usr/share/webapps/
    drwxr-xr-x 5 root root 4096 Mar 6 17:12 .
    drwxr-xr-x 165 root root 4096 Mar 6 21:22 ..
    drwxr-xr-x 4 http http 4096 Mar 6 17:49 owncloud
    drwxr-xr-x 10 root root 4096 Mar 5 02:11 phpMyAdmin
    drwxr-xr-x 6 root root 4096 Sep 18 09:08 php-xcache
    Also keep in mind that I've installed owncloud using the source downloaded from the website. I previously installed using the pacman, but wanted to configure it to be under a sub directory and not as my web root.
    Last edited by johan1391 (2015-03-07 19:03:19)

  • Need help getting personal web sharing working again

    I've somehow managed to hose my apache web server and am hoping someone can offer some advice to get it running correctly again:
    my problem: I can no longer access my website files running on my mini server computer, and even when I run a simple local connection (127.0.0.1) from the mini, I get 403 Forbidden errors.
    Background: I set up a web page on a mac mini that I had set up as a mini server many years ago. When I decided to resurrect the mini and use it for this purpose again, I noted that my website contents were not sitting in my user/sites folder, but instead, were in a folder called WebServer, sitting inside the Library folder of my hard drive. Unfortunately, I lost all of my notes as to how (or why) I configured my server this way.
    I decided that I wanted to set up multiple local hosts to try to run two different web pages and followed the directions here: http://www.wonderhowto.com/how-to-host-multiple-websites-mac-mini-server-260994/
    After messing around with this a bit I started to get the 403 errors and decided to remove all the additional code mentioned in the link above in the apache config file and go back to my original set up, but this is not working.
    Is there a easy way to remove apache and install a default version like that which comes with OSX to start over with a clean config file, or can someone tell me where in the config file to search to see what else is going wrong?

    Hi Mark, some clues... & are you restarting Apache each change?
    http://discussions.apple.com/thread.jspa?messageID=11085842
    http://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/
    http://techtrouts.com/mac-os-x-105-web-sharing-forbidden-403-on-httplocalhostuse rname/

  • Personal Web Sharing

    So I fire up ol' Personal Web Sharing, and it works fine for localhost. When I try to access it from the ip & name string I get a 403 forbidden error. I've done the "Get Info" and verified my permissions are correct. Still happens. According to Apple Tech Support, "...we can't help you fix it. There's nothing in our database about that."
    I've also used the disk utility to rebuild permissions, and restarted the server via the terminal interface - both to no avail.
    Any ideas would be greatly appreciated.
    BTW...I'm new to Mac, so if suggesting I investigated files such as .ini. or .conf, please include their paths. I can't seem to find the native install - apache folder.
    Thanks in advance for the help.
    SAM

    This posting on another thread has some good suggestions that might tell us more about what's going on. The first suggestion is to check the Console for error messages, which might show what's happening when you try to bring up your website either locally or from another computer. The other thing is to check apache's configuration using a Terminal command. Read this posting for more details:
    http://discussions.apple.com/message.jspa?messageID=1956252#1956252
    If the problem comes down to an Apache configuration issue, I found this free app that might make configuring Apache easier than using a text editor. It's called WebControl 1.0.7 and you can download it from here:
    http://www.macupdate.com/info.php/id/17003

  • Return The remote server returned an error: (403) Forbidden error for some file types

    hi
    am using below code to get the byte array 
    byte[] myDataBuffer = client.DownloadData((new Uri(sourceUrl)));
    for source of type .txt/.jpg no problem with accessing.but the file type with .master/.wsp/.cs
    it is returning "The remote server returned an error: (403) Forbidden error for some file types" Error.how can i get rid of this.please help me
    Thanks in Advance

    Hi,
    It seems there is something wrong with your code, from your code the account and key are the same, because their appsetting name are the same.
    string account = ConfigurationManager.AppSettings["StorageAccountName"];
    //string account = CloudConfigurationManager.GetSetting("StorageAccountName");
    //string key = CloudConfigurationManager.GetSetting("StorageAccountAccessKey");
    string key = ConfigurationManager.AppSettings["StorageAccountName"];
    string connectionString = String.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}", account, key);
    return CloudStorageAccount.Parse(connectionString);
    If you use CloudConfigurationManager.GetSetting, please consider set azure project as the startup project, if not, this value will be null, this resulted in solution being started as a web project that didn't run inside the Azure emulator. Since CloudConfigurationManager.GetSetting
    tries to get setting by contacting Azure (or Azure emulator in this case), and it is not running, it returns null.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Unable to start up Personal Web Sharing (OS X 10.3.9)

    I have been trying to start up Personal Web Sharing since yesterday. It keeps saying "Web Sharing starting up...", but nothing ever happens.
    Actually, what I want to do is to set up a test server environment (not a real server for everyone on the web to access) to learn PHP, MySQL and XOOPS. I bought Teach Yourself PHP, MySQL and Apache by Julie C. Meloni (Sams Publishing) and installed MySQL 5.0.22 and PHP 5.1.4 following the instructions on the book. But I was not able to see anything when I entered http://localhost/phpinfo.php on FireFox. (The book tells me to create a simple script called phpinfo.php and save it to /Library/WebServer/Documents.)
    I thought the problem might be that I didn't have Personal Web Sharing on, so I went to System Preferences' Sharing panel to start it up. But it just hangs in starting mode... never starts...
    I tried Charles's suggestion to Harvey ( http://discussions.apple.com/thread.jspa?messageID=680762&#680762 ). The /usr/sbin/apachectl configtest command returns the following result:
    Processing config directory: /private/etc/httpd/users/*.conf
    Processing config file: /private/etc/httpd/users/+entropy-php.conf
    Syntax error on line 8 of /private/etc/httpd/users/+entropy-php.conf:
    Cannot load /usr/local/php5/libphp5.so into server: (reason unknown)
    I'm wondering if PHP 5.x does not support Panther, but php.net doesn't seem to say so... (I downloaded PHP 4.4.4, but haven't figured out how to use it to replace PHP 5.1.4...) Or maybe it's because I'm connecting to the web via an open network (at a cafe)?
    Any suggestions will be much appreciated!
    powerbook g3 firewire   Mac OS X (10.3.9)   XLR8 G4 upgraded

    Thank you~ FifthWheel & Karl~!
    Even if you're on an open network, or on no network at all,
    Apache should start if it is properly configured (even with
    no network, the loopback address 'localhost' is still available).
    Thank you for the answer! This has been very confusing to me!
    I still haven't been able to find out whether PHP 5.1.4 is compatible with Panther's Apache or not (couldn't even find which version of Apache Panther has...) But a guy from another Mac forum (www.oikos.com.tw) seems to be very certain that Entropy's PHP 5.x package is not compatible with Panther. I guess I will just take what he said. I've already sent my complaint to Sams Publishing.
    I found "Building and Installing Apache 2.0.54 and PHP 5.0.4 on Mac OS X 10.3.8" on phpmac.com. But it seems quite risky for someone who does not have unix knowledge like me. So I guess what I should do is to find out how to remove the PHP 5.1.4 I installed and install PHP 4.x instead.
    Still seeking for a solution... I guess I should start learning Unix too...

  • Accessing separate drive with Personal Web Sharing

    Is it possible to simply use Personal Web Sharing to access an external Firewire hard drive?
    I have zero experience with Apache or most server operations. I can set up pretty basic sites with Dreamweaver and/or simple HTML. So if it is possible but difficult, I may need step by step instructions.
    I would really like to access this drive because it is easier to keep the large video files on it, but I would like to transfer them to my PS3 on a semi-regular basis. My PS3 has no problem accessing my sites folder (other than not showing the directory so I have to code an index file for it).
    Any way I can redirect my PS3 to my external drive using the Web sharing feature? Or is it exclusive to my users drive?
    Sorry to ask a simple question, but I can't seem to find the answer anywhere.
    Help is greatly appreciated to either of my problems. Accessing an external drive or figuring out why I get 403 Forbidden messages unless I code an index file.

    Is this drive connected to your computer? Are you trying to access the computer remotely? If so then you need to turn on file sharing and remote access.

  • Personal Web Sharing doesn't want to start. (Apache problem)

    I have accidently deleted apache folders from my iBook. Then I reinstalled the apache, but when I tried to start my Personal Web Sharing, it just won't start. It says "Web Sharing Starting Up", but it stays that way for ages. Any idea? It worked before (I mean before the accident). I dunno if it's got to do with the mySQL coz I reinstalled another version of mySQL.
    iMac   Mac OS X (10.4.4)  

    I am experiencing the same problem: going through the System Preferences (in OSX 10.4.10), to the Sharing pane, then the Services Tab, and clicking Start Personal Web Sharing only gives me "Starting Web Sharing..." and never actually starts it.
    I have tried the following solutions:
    • replaced httpd.conf files using both the httpd.conf.default file from the machine in error as well as from another Mac (adapting the usernames as appropriate)
    • replacing the entire /private/etc/httpd directory with the one from the other Mac, whose Web Server will start up
    • when starting it via Terminal, i get "fopen: no such file or directory" so I created it... no dice.
    Can anybody give me any more suggestions?
    If not, I do have AppleCare on it - think they might help?

  • Is there an FAQ or step by step tutorial for personal web sharing?

    First off, if anyone knows of an FAQ somewhere that answers this question, post me the link.
    Am trying to build a comon web page for synching iCal on a stans alone machine and am sure this is a very common question from new iCal users like myself:
    Situation:
    -Multiple users on same iMac
    -Different accounts Mom, Dad, Kids, Nanny
    -Need to collaborate schedules
    Want to create a webpage on my machine (without .mac) where we can publish calendars.
    Tried turning on personal web sharing in the system preferences but the addresses listed only show a page listed as "Access Forbidden."
    Is there a step by step tutorial out there? I could really use one.

    Thanks to all for replying. The information posted was very informative and answered my questions asked.
    I guess the real answer for me the very novice and deliberatly blissfull user is: No.
    I switched to Mac after assembling my own PCs to try and get then to do what I wanted. The driver/dll/ini issues were maddening!!!
    Am not tech-phobic, but am loathe to start working in the terminal and with code since I know so little and it was that commercial that said "I got tired of being my own tech dept." that made me switch.
    Looked at the tutorials and there are always comments underneath with comments about how there is a typo here, mispelling, there, better code over yander etc. linux/apache/unit/windows flame wars etc.
    All I want it to do is work or not. Since it is not; will find another way.
    Between purusing sites I think I came up with a simple low tech solution.
    In the shared folder create an iCal_Shared folder. From one user export a calendar complete with a date. For example Dad's work as of 15 JAN. Then in the duaghter's calendar import the same calendar. Knowing that as changes are made by me, I will have to update the exported file, and my daughter will have to be aware of the as of dates.
    A lot of solutions out there are for the corporate world. Am happy to Apple gaining market share but I am on a stand alone machine.
    The iPhoto manager is a great product from a third party and was happy to pay for it. Saves me a lot of time with 20K+ pictures.
    Just want an app causing iCal to behave simply, ie my daughter and I could share calendar information on our machine without running WebDAV server, a three tiered digital satelite hookup, etc,
    Pie Argh Squarred..It seems to me that Apple woule be better off if they came up with solutions like that that cost $20 since they would reach a lot more people than they are now with the $100 annual .mac extortion fee.
    Kudos to those of you who are much smarter and braver than I and again I thank you for your posts as they have opened my eyes as to just how old I am getting! Perhaps my daughter should solve this one for me!

  • Personal Web Sharing server will not start.

    I cannot start Personal Web Sharing. Have tried to install apache2, mysql and php from here: http://www.serverlogistics.com/downloads.php and since then it would not start.
    What can I do? Is there anyway I can reverse to old settings from a sertain date like you can on a windows system?
    If I try to start Apache in Termianl I get this:
    vayu-robins-computer:~ vayu$ /usr/sbin/apachectl start
    Processing config directory: /private/etc/httpd/users/*.conf
    Processing config file: /private/etc/httpd/users/+entropy-php.conf
    [Fri Jul 21 12:27:18 2006] [warn] module mod_php5.c is already added, skipping
    Processing config file: /private/etc/httpd/users/postgres.conf
    Processing config file: /private/etc/httpd/users/vayu.conf
    fopen: Permission denied
    httpd: could not open error log file /private/var/log/httpd/error_log.
    /usr/sbin/apachectl start: httpd could not be started
    I hope this will help.
    Thanks
    Vayu
    Imac Intel Core Duo   Mac OS X (10.4.7)  

    If you're just trying to get the default install to work again, we'll need to determine if the ServerLogistics install you said you tried has overwritten the system files, or set itself up separately.
    To see what version is installed in the default location, from the Terminal run:
    /usr/sbin/httpd -v
    This will report something like:
    Server version: Apache/1.3.33 (Darwin)
    Second, you can test your config files to see if they are all valid by running:
    /sbin/apachectl configtest
    This is what Apache does when it starts up, but without changing the process status. You'll be looking for a "Syntax OK" at the end of the output, or else specific error messages in your config files.
    Finally, you can check whether you have an Apache process already running a few different ways. One is to look in the /var/run directory for a 'httpd.pid' file, which will contain the process ID of any running Apache process. The other is to search the active process list:
    ps -ax | grep httpd
    If you see any matches other than your own 'grep httpd' command in the list, you may already have an Apache running and thus be unable to get another one to start via the Personal Web Sharing control panel.
    Again, the remedy would be clearer with some input from the ServerLogistics install documentation - what files were put where, how do they interact (if at all) with Apple's versions, etc.
    PowerBook G4, et al.   Mac OS X (10.4.7)  

  • Personal Web Sharing doesn't start up

    A while ago I shut off the "Personal Web Sharing" tool simply because I did not need it. However at this moment I'm trying to restart it (which I assume is the Apache web service). So I go to System Preferences -> Sharing, and tick the "Personal Web Sharing" box. However, when I do, all I get is the message "Web sharing is starting up..." It stalls there and doesn't go any further.
    I haven't made any changes to Apache, but I have attempted to install PHP on my system using the package on http://www.entropy.ch/software/macosx/ -- it failed, giving me a generic error message.
    Is there a solution to this problem? Does it have anything to do with the messed-up PHP installation?

    I am experiencing the same problem: going through the System Preferences (in OSX 10.4.10), to the Sharing pane, then the Services Tab, and clicking Start Personal Web Sharing only gives me "Starting Web Sharing..." and never actually starts it.
    I have tried the following solutions:
    • replaced httpd.conf files using both the httpd.conf.default file from the machine in error as well as from another Mac (adapting the usernames as appropriate)
    • replacing the entire /private/etc/httpd directory with the one from the other Mac, whose Web Server will start up
    • when starting it via Terminal, i get "fopen: no such file or directory" so I created it... no dice.
    Can anybody give me any more suggestions?
    If not, I do have AppleCare on it - think they might help?

  • Getting a "403 Forbidden" error when I login ..

    Hi all ... Well yesterday I did a new installation of Oracle Express Edition 11g DB, which installed fine ... I then installed OC4J, and then finally installed APEX Listener 4.1 ...
    Now, when I opened 127.0.0.1:8888/apex/listenerAdmin for the very first time .. I saw a page where I was to configure the connection .. At that point I was unable to get the 'Basic' connection working (I think the error was that the Listener was unable at connect to the database), and so I closed down that page ..
    Now, one day later, when I open 127.0.0.1:8888/apex/listenerAdmin, I am asked for some login details ... I don't know what to put here to login .. In fact I have not successfully logged in here even once ..
    However, some clues are as follows: Before installing APEX Listener, I defined some new roles and users from the OC4J web interface ... If I try logging in through any of these, I get the '403 Forbidden' error ... Otherwise, if I enter any other random login details, the same login box keeps popping up ..
    So anyone know whats the problem here ? ... I suspect that no connect between APEX Listener and the Oracle DB is yet defined, which is why these problems are occuring ...
    I tried 'undeploying' APEX listener from the OC4J web interface, and then again 'deploying' it, but the exact same thing is happening ..
    Can anyone help me out here ?
    EDIT:
    I assume maybe I'm supposed to use the APEX_PUBLIC_USER account, which I configured in oracle before installing APEX (as per intructions in Oracle installation guides), but even when I try logging in through APEX_PUBLIC_USER, my login details are not accepted ... Also, I AM able to login into Oracle Database using APEX_PUBLIC_USER, but not in APEX Listener ... And since unlike what I described above, when I enter my APEX_PUBLIC_USER login details, the same login prompt keeps reappearing, meaning the login is not recognised at all ...
    Edited by: user7366837 on Sep 9, 2011 3:39 AM

    Hi,
    Now, when I opened 127.0.0.1:8888/apex/listenerAdmin for the very first time .. I saw a page where I was to configure the connection .. At that point I was unable to get the 'Basic' connection working (I think the error was that the >Listener was unable at connect to the database), and so I closed down that page ..I think the page you actually opened was http://127.0.0.1:8888/apex/listenerConfigure . At least, this is the page for the initial configuration. You can call it again until you've configured the database successful for the first time.
    Now, one day later, when I open 127.0.0.1:8888/apex/listenerAdmin, I am asked for some login details ... I don't know what to put here to login .. In fact I have not successfully logged in here even once ..The admin page needs the credentials you've configured on your OC4J.
    However, some clues are as follows: Before installing APEX Listener, I defined some new roles and users from the OC4J web interface ... If I try logging in through any of these, I get the '403 Forbidden' error ...... which you seem to have done, but probably you've some typo in there. Please note that you have to use the exact role names as described in the installation manual. A common problem is that users don't care about case sensitivity... This would fit to the symptom: You have a correct username/password combination, so the basic authentication is done, but the user is not authorized to call listenerAdmin because he doesn't have the appropriate role.
    -Udo

  • 403 Forbidden Error while trying to access External SharePoint site in SP 2010

    I am trying to access external Claims based SP site and trying to download the file from a doc library.
    I am receiving the 403 Forbidden error when executing the code.
    I am using SP 2010 and Client Object Model.
    PFB the code I am running.
    using (SPCOM.ClientContext clientContext = ClaimClientContext.GetAuthenticatedContext(siteURL))
    if (clientContext != null)
    clientContext.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
    clientContext.Load(clientContext.Web);
    clientContext.ExecuteQuery();
    SPCOM.Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
    using (SPCOM.FileInformation fInfo = SPCOM.File.OpenBinaryDirect(clientContext, item["FileRef"].ToString()))
    string fileName = (string)item["FileRef"];
    fileName = string.Concat(SaveLocation, fileName.Substring(fileName.LastIndexOf("/") + 1));
    //now save it
    using (System.IO.FileStream outPutFile = System.IO.File.OpenWrite(fileName))
    fInfo.Stream.CopyTo(outPutFile);
    fInfo.Stream.Close();
    I suspect the OpenBinaryDirect method ,
    I am also using Cookie based authentication I guess PFB the code for that.
    public static ClientContext GetAuthenticatedContext(string targetSiteUrl)
    return (GetAuthenticatedContext(targetSiteUrl, 0, 0));
    /// <summary>
    /// This method will return a ClientContext object with the authentication cookie set.
    /// The ClientContext should be disposed of as any other IDisposable
    /// </summary>
    /// <param name="targetSiteUrl"></param>
    /// <returns></returns>
    public static ClientContext GetAuthenticatedContext(string targetSiteUrl, int popUpWidth, int popUpHeight)
    CookieCollection cookies = null;
    cookies = ClaimClientContext.GetAuthenticatedCookies(targetSiteUrl, popUpWidth, popUpHeight);
    if (cookies == null) return null;
    ClientContext context = new ClientContext(targetSiteUrl);
    try
    context.ExecutingWebRequest += delegate(object sender, WebRequestEventArgs e)
    e.WebRequestExecutor.WebRequest.CookieContainer = new CookieContainer();
    foreach (Cookie cookie in cookies)
    e.WebRequestExecutor.WebRequest.CookieContainer.Add(cookie);
    catch
    if (context != null) context.Dispose();
    throw;
    return context;
    If anyone has an idea of why is this happening, pls help me. 
    Thanks,
    K.V.N.PAVAN

    Hi,
    Please try to add following line of code before you initialize cookie container.
    e.WebRequestExecutor.WebRequest.UserAgent = “Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)”;
    http://razirais.wordpress.com/2011/05/19/how-to-fix-sharepoint-online-403-forbidden-error-while-downloading-files-using-client-object-model/
    Or change the following line of code
    clientContext.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
    to
    clientContext.Credentials=new NetworkCredential("Username", "Passworkd", "Domain");
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

Maybe you are looking for