Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto detecting /web and /public #42

Closed
kerns opened this issue Aug 18, 2013 · 3 comments
Closed

Auto detecting /web and /public #42

kerns opened this issue Aug 18, 2013 · 3 comments

Comments

@kerns
Copy link

kerns commented Aug 18, 2013

@pgib Sorry, I've tried everything I can think of on a number of machines now, and it really feels like this feature is broken in the most recent version of your wonderful script.

Note that vhost-stage is just my alias for your script,...It is running in batch mode, but still...it seems to completely ignore the existence of web or public subfolders. And if I disable batch mode it just ignores or fails to ask about web or public altogether.

$ vhost-stage what.kerns.co
Create http://what.kerns.co:80/? [Y/n]: Y
+ Looking in /Users/dvk/Sites for an existing document root to use...
  - Use /Users/dvk/Sites/what.kerns.co as the virtualhost folder? [Y/n] Y
  - Found a public folder suggesting a Rails/Merb/Rack project. Use as DocumentRoot? [y/N] + Creating virtualhost file... done
+ Restarting Apache... done

I rely on this feature as I typically organize project materials like /docs and /logs and other things I don't want part of the public-facing web part of the project at the root level of the folder.

Would you mind just testing this in your own environment at some point?

@kerns
Copy link
Author

kerns commented Aug 20, 2013

Sorry. @pgib ...just wanted to clarify a few things. One is that I did of course boost my max search depth, I think it is set to 5.

Two, and this is just to be clear about my wishes –  "the dream" is to be able to create a folder at some location, say... ~/Sites/projects/my-site/public ...and then run . virtualhost.sh my-site and have the script intelligently set the web root set to /Users/dvk/Sites/projects/my-site/public

And it seems like this dream used to be a reality....or what?

@pgib
Copy link
Contributor

pgib commented Aug 20, 2013

This seems to work for me:

$ mkdir -p ~/Sites/my-site/public
$ virtualhost.sh my-site
virtualhost.sh requires super-user privileges to work.
Enter your password to continue...
Checking for updates... none found
Create http://my-site:80/? [Y/n]: y
+ Looking in /Users/patrick/Sites for an existing document root to use...
  - Use /Users/patrick/Sites/my-site as the virtualhost folder? [Y/n] 
  - Found a public folder suggesting a Rails/Rack project. Use as DocumentRoot? [y/N] y
+ Creating virtualhost file... done
+ Flushing cache... done
+ Restarting Apache... done

http://my-site:80/ is setup and ready for use.

Launching virtualhost... done

And then my virtual host file has:

# Created Tue Aug 20 12:44:28 PDT 2013
<VirtualHost *:80>
  DocumentRoot "/Users/patrick/Sites/my-site/public"
  ServerName my-site
  #ServerAlias your.alias.here

  ScriptAlias /cgi-bin "/Users/patrick/Sites/my-site/public/cgi-bin"

  <Directory "/Users/patrick/Sites/my-site/public">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  #CustomLog "" combined
  #ErrorLog ""

</VirtualHost>

@pgib
Copy link
Contributor

pgib commented Aug 20, 2013

Oh, I see: in BATCH_MODE, this is not working.

pgib added a commit that referenced this issue Aug 20, 2013
…se a custom log folder if BATCH_MODE=yes was set. So you can now set:

    LOG_FOLDER="__DOCUMENT_ROOT__/logs"

In your `~/.virtualhost.sh.conf` file, and `__DOCUMENT_ROOT__` will get substituted for the document root you've picked. Note that this requires a Ruby runtime, which should be already satisfied on any Mac OS X platform. sed wizards are welcome to submit a PR to remove this requirement.
@pgib pgib mentioned this issue Aug 20, 2013
@pgib pgib closed this as completed in 286ee7a Aug 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants