Aug 192010
 

article

 Posted by at 3:36 pm

  16 Responses to “title”

  1. I did everything here according to your instructions on Snow Leopard OSX 10.6.

    It worked great and I have my rails apps up and running locally.

    However, I seem to have several problems:

    1. I had a phpinfo.php in my htdocs root:

    http://localhost/phpinfo.php

    Routing Error

    No route matches “/phpinfo.php” with {:method=>:get}

    So, course, now it apears that the document route is the rails app rather than the apache2 htdocs.

    I have the same problem accessing phpmyadmin

    http://localhost/phpmyadmin/index.php?

    Routing Error

    No route matches “/phpmyadmin/index.php” with {:method=>:get}

    Same issue.

    Not a big deal but will need to add more information for clarifying these types of routing issues.

    Thanks looking forward to seeing more of your posts.

    Sanjaya Yogi

  2. Hi, thank you for you nice comment.

    Your error is happening probably because one of your rails apps is default host of your apache and you dont have any other default vhost.
    The default is actually the first rails vhost on the passenger file.

    To be able to enable php and others you will have to enable another default vhost with localhost as servername.

    This is what did to fix your problem:
    Edit the file /etc/apache2/httpd.conf to enable vhosts

    1
    2
    
    # Virtual hosts
    Include /private/etc/apache2/extra/httpd-vhosts.conf

    then open /private/etc/apache2/extra/httpd-vhosts.conf file,
    delete or comment everything from there and add this block ONLY:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    #
    # Use name-based virtual hosting.
    #
    NameVirtualHost *:80
     
    # Change /Users/fred/ to your appropriate login name
    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot /Users/fred/Sites/
        RewriteEngine On
        DefaultType text/html
        <Directory "/Users/fred/Sites">
            DefaultType text/html
            Options +ExecCGI FollowSymLinks Indexes
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>

    there you go, worked nice for me.

  3. Everything went beautifully up to the point of going to Safari and entering
    http://jclis1.local

    It can’t find the server jclis1.local. I checked all logs and found no errors and the httpd deamon is running. I’ve had rails running on windows XP and Linux servers for the past two years.

    Any help would be greatly appreciated.

    Thanks

    John Lewis

  4. Please scratch my recent cry for help. My error_log is now registering errors I can pursue.

    John Lewis

  5. Perfect. Smooth installation on OSX 10.6.6!! Thanks a ton!

  6. After following your instructions for Snow Leopard 10.6, I can access localhost site but not either of two virtual host sites. When I attempt to connect to http://mysite.local I get “[client 127.0.0.1]Directory index forbidden by Options directive: /Users/myname/rails/mysite/public”

    I have rails and apache running on Windows XP and Linux (both development and production).

    Any help will be greatly appreciated.

    Johnl

  7. One added piece of info for my recent comments…..The Safari Screen advises “You do not have permission to access / on this server”

    johnl

  8. try the apache error log and what does it say? I think it’s /private/var/log/apache2/error_log

    Also, could be that your folder permissions are restrictive. i.e. they are read-only by you and apache might not be able to read it.
    try adding others readable?
    chmod 755 /Users/myname/ /Users/myname/rails /Users/myname/rails/mysite

  9. The apache error log errs on startup as follows:

    [Mon Jan 17 11:02:31 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
    [Mon Jan 17 11:02:31 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Mon Jan 17 11:02:31 2011] [notice] Digest: generating secret for digest authentication …
    [Mon Jan 17 11:02:31 2011] [notice] Digest: done
    [Mon Jan 17 11:02:31 2011] [notice] Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8l DAV/2 Phusion_Passenger/3.0.2 configured — resuming normal operations

    My rails error log gives the following when I attempt to access http://jclis1.local:
    [Mon Jan 17 11:16:33 2011] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /Users/myname/rails/jclis1/public/

    Both logs repeated the same error after I did chmod 75 on files you recommended.

  10. Good Morning!

    I tried again to access http://myname.local and the apache2/error_log added a new line which would support your thesis that permissions could be a problem. The added line reads:

    ttpd: Could not reliably determine the server’s fully qualified domain name, using My-name-iMac.local for ServerName

    I can’t fine where it’s reading myname as My-name-iMac. It’s obvious it’s not reading the proper configuration file…..and I don’t know why.

    johnl

  11. What a maroon! I finally noticed the Admin account which was set up at the Apple store is set at ‘My app’ while my login and ‘who am i’ is ‘myapp’. The only account in /Users is the ‘myapp’. Where/why is the system reading the ‘My app’ account (wherever it is).

    johnl

  12. Since the only errors seemed to be registering on apache startup, I went after the one in my local error_log proclaiming “Directory index forbidden by Options directives” and changed the public directory directive in
    httpd-passenger.conf by adding “Indexes”.

    Now I have no errors in either the apache2/error_log or my local error_log. Unfortunately, when I now request http://myname.local, Safari comes back with:
    Safari can’t connect to the server.
    Safari can’t open the page “http://jclis1.local/” because Safari can’t connect to the server “myname.local”.

    Since I made the change regarding Indexes in the same file that contains the virtual host names, I’m at a loss to understand why it doesn’t recognize the virtual host name(s).

    johnl

  13. As Dr. Frankenstein said……IT’S ALIVE!

    After a shutdown and startup….it worked! Apparently, the addition of “Indexes” to the Options Directive was the fix needed.

    Sorry to have choked you site with so much babble. Your setup instructions for rails are truely awesome.

    Thanks again

    Johnl

  14. Thank you! This was the only way to get the Mysql Rails gem to install correctly on my new 2011 MacBook Air. I did not use the steps for Apache or Passenger because my dev environment doesn’t use that but everything worked like a charm. I spent at least a whole day wrestling with the gem install configuration and in the end I guess it was MacPorts that saved my ass – that and your super helpful guide.

    thanks!

Sorry, the comment form is closed at this time.

Switch to our mobile site