Webserver forbidden at localhost

Seems a lot has been written on this, but for each topic that is "solved" and archived, I can't find the solution.
Here's what I'm trying to do:
I want to use my MacPro to serve several different domains, and I would like these all in my Sites folder (just easier to manipulate, I think). I have set up a folder for each domain, with an appropriate index file in each folder.
I have changed my DocumentRoot to /Users/username/Sites/ and have placed a test index.html file there.
Now, when I point my browser to http://localhost/~username/ I get the test page. However, when I point my browser to http://localhost/ I get the 403 Forbidden error. I've check the permissions in /Library/Webserver/Documents and they are 775 (as they are on my MacMini which is serving properly under localhost).
First steps first (I'll get to the vhosts later):
1. What does the tilde do? Why must one use the tilde to specify the correct path?
2. Since I have to specify localhost/~username to get to my Sites folder, I'm guessing that the DocumentRoot has not successfully changed. But if that's true, then
3. Why is /localhost/ giving me the 403 error?
Any help out of my circular reasoning is greatly appreciated!

The tilde does nothing unless mod_userdir is installed and configured properly--which it is by default in Apple's current Apache installation. It is meant to be used in lieu of a properly configured virtual host, giving you the ability to offer each user on the system their own web space by simply prepending it to their username.
If you configure your global DocumentRoot to point to a specific user's Sites directory then you should discontinue the use of this tilde syntax as you no longer require the path expansion mod_userdir performs.
I'd very strongly recommend picking up a copy of "Apache: The Definitive Guide" or "The Apache Cookbook" before blindly mucking around with unfamiliar config file directives. You can very easily break the entire installation.

Similar Messages

  • Virtual Hosts vs Localhost

    OK, I'm on about step #13 of Apple's virtual hosts enabling obstacle course, and I'm still confused. I've modified the httpd.conf, hosts and NetInfo files, and I can now preview the home page of ONE of my virtual host sites. The problem is that I see the page whether I type in http://localhost/, http://Geobop/, http://GW/ or http://GS/. It should preview only at http://Geobop/.
    I rediscovered the article Enabling Virtual Hosts on MacOS X at http://www.evolt.org/article/EnablingVirtual_Hosts_on_MacOSX/18/13138/
    and added a script to my httpd.conf file, as follows:
    # Leave this one alone - it makes sure that localhost works.
    <VirtualHost 127.0.0.1>
    DocumentRoot /Library/WebServer/Documents
    ServerName localhost
    </VirtualHost>
    #<VirtualHost 127.0.0.1:80>
    # ServerName geobop
    # ServerAdmin [email protected]
    # DocumentRoot /Users/MYNAME/Sites/Geobop
    #</VirtualHost>
    If I understand correctly, this is supposed to make http://localhost/ display something unique, rather than a local website. However, all the URL's I cited above still display the same thing...but this time around they display blank pages with columns of numerals along the left margin.
    In an earlier experiment, I deleted all my virtual hosts from httpd.conf. Then all these URL's displayed the following:
    Index of /
    Name Last modified Size Description
    [DIR] Parent Directory 13-Mar-2007 15:49 -
    [ ] index.php 06-Oct-2006 15:36 1k
    [ ] php5.fcgi 06-Oct-2006 18:18 1k
    [ ] phpMyAdmin-2.9.0.2.tar 06-Oct-2006 17:44 11.4M
    [ ] phpinfo.php 06-Oct-2006 15:20 1k
    [ ] phpinfo.php5 06-Oct-2006 18:20 1k
    Apache/1.3.33 Server at localhost Port 80
    Can someone tell me what's going on and how to fix it. This process was three times easier on my PC, though I hate Microsoft.
    Thanks.

    Thanks for your explainations but it keeps frustrating me. I'll try to give an exact overview to my settings and my tries to implement your suggestions:
    Computer name: MacBook Pro
    Host: server.local
    Wi-Fi: 192.168.178.100 (static, as I said no DHCP)
    DNS-Settings:
    Forwarding Servers: 192.168.178.100
    Perform lookups for only some clients: "The server itself" and "Clients on the local network"
    Host name: server.local
    IP address: 192.168.178.100
    (no aliases)
    automatically created after setting this host name:
         Primary zone: server.local
         Machine: zone: server.local, host name: server.local, IP address: 192.168.178.100
         Nameserver: zone: server.local, Name-server: server.local
    Now I create a new host:
    Host name: thenewwebsite.site
    IP address: 192.168.178.100
    (no aliases)
    automatically created after setting this host name:
         Primary zone: thenewwebsite.site
         Machine: zone: thenewwebsite.site, host name: thenewwebsite.site, IP address: 192.168.178.100
         Nameserver: zone: thenewwebsite.site, Name-server: thenewwebsite.site
    Now going to "Web" service:
    hit the [+] button
    domain-name: thenewwebsite.site
    --> and it gives me the red bullet again saying it could not resolve this and trying to load "thenewwebsite.site" from the browser consequently fails.
    I also tried to set the machine-zone and the nameserver-zone for the thenewwebsite.site host to server.local - didn't changed anything, loading "thenewwebsite.site" fails.
    Designed in California, designed to make ist easier ??? huu ???

  • Apache Help! Computer has slowed to a crawl & no net access

    After following tutorials: firstly here, and secondly here, my laptop has slowed to an excruciating crawl, when the machine boots it asks for my username and password when the Sys Prefs are set to auto log in. It also can't access the net anymore.
    It was able to utilize PHP files located in the /Library/WebServer/Documents (http://localhost/page.php), but when trying to use http://dev/sitename it would fail and I received an error on line 2 upon execution of "sudo apachectl configtest" when no typos were present.
    I've tried putting everything back the way it was originally but have had no luck.
    Any ideas? I'm dyin' here.......

    Follow up: Was never able to fix the mysterious issue. I did an "Archive and Install" and that seems to have fixed the problem.

  • CF10, FB 4.7, Apache on MAC

    Hi All,
    I have couple days trying to configure this new MAC with FB 4.7 and ColdFusion 10.
    Alex was helping me to debug this issue but I still cannot figure this out, sorry no an expert in MAC or apache.
    http://apache-flex-users.2333346.n4.nabble.com/Flex-amp-CF-on-MAC-OSX-10-8-4-td2614.html
    Here is the way I configured the CF in MAC:
    http://iknowkungfoo.com/blog/index.cfm/2013/2/27/Installing-ColdFusion -10-on-OSX-108-Mountain-Lion
    So my web server is:
    [ localhost:cfusion ] Apache : /private/etc/apache2
    The article said that I can use "/Users/myUserName/Sites" as my web root, or not? I am confuse.
    I am trying to configure my project for Flash Builder4.7, in windows for CF9 and IIS i set:
    ColdFusion root folder: c:/ColdFusion9
    Web root: c:/inetpub/wwwroot
    Root URL: http://localhost/
    Output folder: c:/inetpub/wwwroot/myTest-debug
    So far I figure this in MAC
    ColdFusion root folder: /Applications/ColdFusion10/cfusion
    Web root: ???
    Root URL: http://localhost/
    Output folder: This should be the same as the web root.
    I hope this is clear. Thanks!

    I found this article:
    http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmya dmin-osx-108-mountain-lion
    It helps to understand that "OSX has historically had 2 web roots one at a system level and one at a user level."
    System Level:
         /Library/WebServer/Documents/
         http://localhost/
    User Level:
         /Users/username/Sites/
         http://localhost/~username/
    Also explain how to change permissions.
    I want to use the user level, do I need to copy the CFIDE folder into /Users/username/Sites/?

  • Web Services demo - Webpage cannot be displayed

    Hello,
    I would like to run the example webpages in the Web Services demo project (http://ftp.ni.com/pub/devzone/tut/webservicedemo.z​ip), but none of the three pages can be displayed in internet explorer.
    I have completed every step in the included Readme document, no problem occured when building and deploying the two examples. Also the System Webserver and Applications Webserver are enabled.
    Please can anyone help me solve this issue?
    Thanks in advance!
    Regards,
    Marco

    Hi,
    For those who ecountered the same problem: I figured it out how to fix it:
    Try to add the port number of your Application webserver next to localhost in the URL. Like http://localhost:8080/Math/Sum/1/3.

  • Apache setup in 10.3.9, enable documentroot

    Hi,
    I've been using the personal web sharing feature of os x for a while now and can access all work in my sites folder from http://localhost/~digitalpencil/
    I understand however, that you can also access apache through the webserver documentroot? i.e machd/library/webserver or http://localhost/mysitefolder/
    How do I set this up?
    All advice is much appreciated.
    Thanks

    Don't bother.. I'm an idiot, the folder aptly titled 'documents'.. lol

  • BufferedImage - byte[] ??

    I want to send an Image from my applet to my servlet via an HTTP connection. I want to do the encoding of the image to gif/jpeg on the server side and not in the applet, therefor I have to transfer
    the Image object via http as binary data. Because the BufferedImage is not serializable I have to send it as byte[] or something else. How can I get my BufferedImage as a byte[] to send it over my Http connection?
    regards,
    Fredrik Forsberg

    Earlier I tried out a solution where I sent the image data as a byte array over a raw socket and that worked out fine. But that only worked because I got a ByteOutputStream by encoding the BufferedImage. Without encoding the picure I have to get the data elseway. Now Im sending over an int array that I got by calling getRGB() on the Image object.
    Recently I got problems. The server refuses to react to my
    http connection from the applet. When I load the url from a browser
    the server reacts in a normal way though. Why?
    Here I make the connection in the applet to the webserver
    location = "http://localhost:8080/portal/saveImageFromApplet.do";
    servletUrl = new URL(location);
    servletConnection = servletUrl.openConnection();
    servletConnection.setDoOutput(true);
    servletConnection.setDoInput(true);
    servletConnection.setUseCaches (false);
    servletConnection.setDefaultUseCaches (false);
    servletConnection.setRequestProperty ("Content-Type", "application/octet-stream");
    outputToServlet = new ObjectOutputStream (servletConnection.getOutputStream());
    outputToServlet.writeObject(pixels); // pixels is a int[]
    outputToServlet.flush();
    outputToServlet.close();
    Nothing happens. Not even an exception in the applet. The servlet actually is an Action class called by the controller servlet in the Struts framework.
    Have anybody had the same problem with this Applet-servlet communication via Http?

  • Virtual Hosts - I'm lost!

    I've been pulling my hair out trying to figure out how to get MySQL, phpMyAdmin and virtual hosts set up on my MacBook Pro. I finally paid a computer science student $100 to do it for me, and he botched it, so I'm now going back to square one.
    My websites are located in /Users/username/sites/. I've modified the httpd.conf, hosts and NetInfo files, and I can now preview the home page of ONE of my virtual host sites. The problem is that I see the page whether I type http://localhost/, http://Geobop/, http://GW/ or http://GS/ into my browser. It should preview only at http://Geobop/.
    I rediscovered the article Enabling Virtual Hosts on MacOS X at http://www.evolt.org/article/EnablingVirtual_Hosts_on_MacOSX/18/13138/
    and added a script to my httpd.conf file, as follows:
    # Leave this one alone - it makes sure that localhost works.
    <VirtualHost 127.0.0.1>
    DocumentRoot /Library/WebServer/Documents
    ServerName localhost
    </VirtualHost>
    #<VirtualHost 127.0.0.1:80>
    # ServerName geobop
    # ServerAdmin [email protected]
    # DocumentRoot /Users/MYNAME/Sites/Geobop
    #</VirtualHost>
    If I understand correctly, this is supposed to make http://localhost/ display something unique, rather than a local website. However, all the URL's I cited above still display the same thing...but this time around they display blank pages with columns of numerals along the left margin.
    In an earlier experiment, I deleted all my virtual hosts from httpd.conf. Then all these URL's displayed the following:
    Index of /
    Name Last modified Size Description
    [DIR] Parent Directory 13-Mar-2007 15:49 -
    [ ] index.php 06-Oct-2006 15:36 1k
    [ ] php5.fcgi 06-Oct-2006 18:18 1k
    [ ] phpMyAdmin-2.9.0.2.tar 06-Oct-2006 17:44 11.4M
    [ ] phpinfo.php 06-Oct-2006 15:20 1k
    [ ] phpinfo.php5 06-Oct-2006 18:20 1k
    Apache/1.3.33 Server at localhost Port 80
    Can someone tell me what's going on and how to fix it? If I can get Apache and my virtual hosts squared away, then I'm going to try to get MySQL and phpMyAdmin back up and running.
    Thanks.

    I don't know much about it, but I do have two comments since it does not sound like a virtual hosts problem.
    1) Netinfo Machines will not work by default. You will need to configure lookupd to give Netinfo priority over DNS:
    lookupd -configuration
    The default configuration will be:
    LookupOrder: Cache FF DNS NI DS
    configname: Host Configuration
    What you need to do is configure lookupd to give NI priority over DNS. Here is how it should look:
    LookupOrder: Cache NI FF DNS DS
    To do this, use commands like this, you will need to have root access enabled:
    su
    lookupd -configuration
    cd /etc
    sudo mkdir lookupd
    cd lookupd
    echo LookupOrder Cache NI FF DNS DS > hosts
    reboot
    lookupd -configuration
    After rebooting, your lookupd order should put NI in front of DNS. Now you can make entries in the "machines" column to your local domains.
    2) MySQL is not installed, however a socket is configured so yeah it's a little confusing. You have to go to the website http://dev.mysql.com/downloads/mysql/5.0.html and scroll down to OSX. Just ignore the pesky questionnaire screen before the download page.

  • Firefox profile got corrupted? can't run cgi scripts anymore

    Something happened recently that hosed my ability to run cgi scripts from my firefox profile.  If I browse to my local webserver at http://localhost/blah I was able to run a cgi script.  Now for some reason, firefox asks me if to save the script rather than running it.
    Opening monitorix.cgi
    You have chosen to open monitorix.cgi
    which is a: BIN file
    from: http://localhost
    Would you like to save this file?
    [Cancel] [Save File]
    If I load firefox with a fresh profile, I am able to run the cgi script with no such problems.  I don't want to create a new profile to solve this.  Does anyone know which setting controls this behavior so I can fix it?
    Thanks!
    EDIT: this is too weird.  If I browse to http://reborn/blah (reborn is the hostname of my local PC) rather than http://localhost/blah, the script runs just fine!  What's going on?  Again, this localhost problem only affect my user's firefox profile.
    Last edited by graysky (2010-02-06 19:52:44)

    Same thing seems to be true when I try connecting to other PC's on my LAN.  If I use their hostname I get nothing, if I use their IP it works.
    Browsing to --> http://mars/http will result in firefox trying to connect "transferring data from mars..." and it hangs as such forever.
    Browsing to --> http://192.168.1.101 will result in the page loading perfectly.
    If I repeat the above using a new profile within firefox, everything works!  I'm at a loss to explain it.
    $ cat /etc/hosts
    127.0.0.1 localhost.localdomain localhost reborn
    192.168.0.101 mars
    Last edited by graysky (2010-02-06 19:56:50)

  • Chart binded data not showing when Window State property of form is set to Maximized

    Possible bug?
    Using In VS 2013 Community, .NET 4.5, MySQL w/Connector/NET...
    When a form is maximized, it wil not render the binded datasource on a chart.
    Example is a new project...  chart dragged onto a form... add a Dataset when initializing the chart and immediately bind that to the Datasource property with no changes to the chart except changing your XValue from a column to a line type. I only have
    3 columns in the table. keyId, entryDate, mcf.
    I can also maximize the window after the form is up and running and it doesn't effect the chart at all.
    Any ideas? I need the window to run in a maximized state.
    Many thanks!

    Hi,
    to debug your web content in IE
    f12>Debug tab, select "Break on all errors"... the debugger will break on any errors.
    Emulation tab, tells you which emulation mode the browser is using and which userAgent string it is using.
    File>Properties shows which IE security zone it maps to.
    "When a form is maximized it will not render the binded datasource on a chart"
    Probably you are running from a localhost proxy (http://localhost:8080)... the IE developer tool will show you any scripting errors. Publish your 'test' to a named webserver. eg.
    http://localhost/test.local
    - Questions about html, css and scripting for website developers. If possible please include with your question a link to your website or a mashup that shows the issue.
    Regards.
    Rob^_^

  • Cannot run a podcast using localhost or Intranet internal webserver

    Hi,
    I am testing the usability of podcasts on our training webserver to provide alternative platforms for users to access training videos.
    If I create a podcast xml file with the videos on an external webserver and put the URL link to the xml file in the subscribe to a podcast box, it works fine.
    If I replicate the structure and put it on one of our Intranet webservers, using either the Domain name or the IP address, the Podcast cannot be found.
    Putting the URL directly into a Browsers address bar shows the title of the Podcast in the page but no link to the video, which is what I normally do to check connections.
    Does iTunes podcasting files not work on internal severs or connections using Localhost as the server name?

    Thanks both of you, I just figured it out! As you might expect, it was something stupid.
    Creating a new php file as you suggested worked, so that led me down a path to do a few more tests and realised the mysql database connection file that had been moved. My dad must have also moved that when he renamed the sites folder -- didn't tell me about that one!!
    thanks again for the help

  • 403 Forbidden comes up when I try to set up a localhost

    When I get to checking whether WampServer is installed properly on my computer, it asks me to open up the web browser and navigate to http://localhost. When I do that, the page say
    "Forbidden
    You don''t have permission to access / on this server"
    The first time I installed this today, it asked something about blocking and I checked keep blocking. I thought that might have caused the problem. I tried uninstalling and then reinstalling, but that question never comes up any more so I don't get a chance to answer the opposite way.

    This is probably one of the files that is required by the template you are using.
    These files are inside the iWeb app. Control click the iWeb app icon and select "Show package contents".
    You need to dig down through the folders and files to find what you want...
    Contents/Resources/da.lproj/Templates/
    If the file is missing you would need to re install the iWeb app...
    http://www.iwebformusicians.com/iWeb/iWeb-Tips.html

  • Adding PHP5 caused webserver to give Forbidden message

    Hello,
    When attempting to install PHP5 on to Mac OSX server, it has left the webserver giving users the:
    Forbidden
    You don't have permission to access / on this server.
    Apache/1.3.33 Server at 192.168.0.1 Port 80
    I have have double checked all the permissions on the folders/files that I am serving and everything seems correct. I am at a loss as to where to look next.
    Has a config file been modified?
    Also, when I try to add the PHP5 module, it crashes the webserver.
    Any thoughts would be appreciated.

    I finally found the answer to my own problem. Here is the solution for anyone else with the same experience.
    http://discussions.apple.com/thread.jspa?messageID=1900509&#1900509

  • [SOLVED] Apache Access forbidden Error 403 localhost

    Hello,
    I believe this should be some thing very stupid, but I  can't find it... so here I am.
    I have just installed apache (# pacman -S apache)
    Configured httpd.comf, and created 2 virtual hosts with extra/httpd-vhosts.conf
    When I believed every thing was ok, I have started Apache as root (# apachectl start)
    Started ok, no errors (also tried start it as user with sudo, and /etc/init.d/httpd start)
    So when I go to http://localhos (or the virtual host) I allways get Access forbidden Error 403
    I have set 777 permissions to /srv/http and the virtual host (/home/username/local-web/site1.dev)
    I have tried every thing , changed dir owners to "http:http" ...
    At the Apache error log I get:
    "[Thu Oct 29 02:39:48 2009] [error] [client 127.0.0.1] (13)Permission denied: access to / denied"
    There is a very simple plain index.html file at /srv/http and the virtual host, all file/dir permissions very permisive... so that can't be the problem.
    Am I missing some thing? Do I need to manually create the "http" user and/or add it to some group?
    Last edited by iopo (2009-10-29 22:06:59)

    Ok, here's the code:
    # 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.2> for detailed information.
    # In particular, see
    # <URL:http://httpd.apache.org/docs/2.2/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 "/var/log/httpd/foo_log"
    # with ServerRoot set to "/etc/httpd" will be interpreted by the
    # server as "/etc/httpd//var/log/httpd/foo_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 point the LockFile directive
    # at a local disk. If you wish to share the same ServerRoot for multiple
    # httpd daemons, you will need to change at least LockFile and PidFile.
    ServerRoot "/etc/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_default_module modules/mod_authn_default.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 authnz_ldap_module modules/mod_authnz_ldap.so
    LoadModule authz_default_module modules/mod_authz_default.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule auth_digest_module modules/mod_auth_digest.so
    LoadModule file_cache_module modules/mod_file_cache.so
    LoadModule cache_module modules/mod_cache.so
    LoadModule disk_cache_module modules/mod_disk_cache.so
    LoadModule mem_cache_module modules/mod_mem_cache.so
    LoadModule dbd_module modules/mod_dbd.so
    LoadModule dumpio_module modules/mod_dumpio.so
    LoadModule ext_filter_module modules/mod_ext_filter.so
    LoadModule include_module modules/mod_include.so
    LoadModule filter_module modules/mod_filter.so
    LoadModule substitute_module modules/mod_substitute.so
    LoadModule deflate_module modules/mod_deflate.so
    LoadModule ldap_module modules/mod_ldap.so
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule log_forensic_module modules/mod_log_forensic.so
    LoadModule logio_module modules/mod_logio.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 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_scgi_module modules/mod_proxy_scgi.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    LoadModule ssl_module modules/mod_ssl.so
    LoadModule mime_module modules/mod_mime.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 cgi_module modules/mod_cgi.so
    LoadModule cgid_module modules/mod_cgid.so
    LoadModule dav_fs_module modules/mod_dav_fs.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 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 !mpm_netware_module>
    <IfModule !mpm_winnt_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>
    </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
    # 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"
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    # First, we configure the "default" to be a very restrictive set of
    # features.
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    </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.
    # This should be changed to whatever you set DocumentRoot to.
    <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.2/mod/core.html#options
    # for more information.
    # Options Indexes FollowSymLinks
    Options Indexes All
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    AllowOverride None
    # Controls who can get stuff from this server.
    Order allow,deny
    Allow from all
    </Directory>
    <Directory "/home/gral/web-sit/local">
    Options +Indexes FollowSymLinks +ExecCGI
    AllowOverride AuthConfig FileInfo
    Order allow,deny
    Allow from all
    </Directory>
    # this was just a test
    # 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.
    <FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
    </FilesMatch>
    # 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 /var/run/httpd/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
    Order allow,deny
    Allow from all
    </Directory>
    # DefaultType: the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value. If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    DefaultType text/plain
    <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
    # EnableMMAP and EnableSendfile: On systems that support it,
    # memory-mapping or the sendfile syscall is 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.
    #EnableMMAP off
    #EnableSendfile off
    # 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
    # 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>

  • Forbidden Permissions Error with username localhost

    Hello all,
    I have a new 15" Powerbook Retina with a clean install of Mountain Lion 10.8. As has been well documented, web hosting doens't work off the bat. I have gone through the steps of setting up local web hosting but am running into a problem that several people have but I can't find a solution to. I get a 403 error when trying to load anything in my local Sites directory. My conf file looks like this:
    <Directory "/Users/patrick/Sites/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    Permission on Sites is set to drwxr-xr-x. I have found various permission fixes like:
    sudo chown root:wheel /etc/apache2/users/*
    sudo chmod 644 /etc/apache2/users/*
    I have rebooted Apache a bazillion times but still errors. Things run fine on the root Documents directory, but I can't get things working in my local directory. I Have no caps in my shortname. I have tried many different things. Looking at the Apache error logs I am just getting this:
    [Thu Aug 23 18:46:24 2012] [error] [client fe80::1] (13)Permission denied: access to /~patrick/phpMyAdmin denied
    Any help greatly appreciate!

    hi, thanx for replying my msg.. here is my jsp code..
    <html>
    <head>
    <title>Inventory</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <%@page import="java.lang.*"%>
    <%@page import="java.util.*"%>
    <%@page import="Inventory" %>
    <jsp:useBean id="myinv" scope="session" class="Inventory" />
    <jsp:setProperty name="myinv" property="*" />
    <% myinv.setDriver();
    myinv.setQuery();
    myinv.getColumn();
    myinv.getRow(); %>
    <%! int col =0; %>
    <%! int row =0; %>
    <% col = myinv.getColumn();
    row = myinv.getRow();%>
    <% out.print(col); %>
    <% Vector outVector = myinv.getVectorRow(); %>
    <body bgcolor="#FFFFFF">
    <table width="65%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="4%"> </td>
    <td width="38%">ProductID</td>
    <td width="23%">Quantity</td>
    <td width="35%">Stock Status</td>
    </tr>
    </table>
    <P><br><br></P>
    <% int vd =0;%>
    <%! String product_ID; %>
    <table width="60%" border="0" cellspacing="0" cellpadding="0">
    <% vd=0; %>
    <% while (vd<outVector.size()) { %>
    <tr>
    <% for (int j=0; j<col; j++) { %>
    <td width=30%>
    <% if (j==0) { %>
    <% product_ID = (String)outVector.elementAt(vd) ;%>
    <a href="http://10.1.23.99:8080/inv/jsp/viewall.jsp?prodID=<%=product_ID%>">
    <% out.print(outVector.elementAt(vd)); %> </a>
    <% } %>
    <% if (j > 0) { %>
    <% out.print(outVector.elementAt(vd)); %>
    <% } %>
    </td>
    <% vd++; %><% } %>
    </tr>
    <% } %>
    </table>
    <% myinv.CloseConnection(); %>
    </body>
    </html>

Maybe you are looking for