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

Can this be used with PHP sites and Virtual Hosts? #6

Open
cerebralideas opened this issue Sep 25, 2012 · 6 comments
Open

Can this be used with PHP sites and Virtual Hosts? #6

cerebralideas opened this issue Sep 25, 2012 · 6 comments

Comments

@cerebralideas
Copy link

I use MAMP with virtual hosts using port 80. I can't seem to figure out exactly how to configure the reload config. Here's how I want to write it:

reload: {
    port: 80,
    proxy: {
        host: 'dev.mywebapp.site'
    }
}

This may be a stupid question, but can this also work with PHP sites that don't have a root index.html file?

@zigotica
Copy link

+1 on this!

@imjared
Copy link

imjared commented Dec 17, 2012

Same issue with the virtual hosts. I've tried using

    reload: {
      proxy: {
        host: 'susydemo'
      }
    },

and my output in terminal is as follows:

Running "reload" task
Proxying http://susydemo:80/
reload server running at http://localhost:8001

@imjared
Copy link

imjared commented Dec 17, 2012

Managed to get it working with the following:

    // added server under grunt.initConfig
    server: {
      base: 'http://susydemo'
    },
    reload: {
      proxy: {
        port: 80,
        host: 'susydemo' // is the name of my vhost
      }
    },
    watch:{
        files:['index.html', 'style.less'],
        tasks:'default reload'
    },
    // etc...

@cerebralideas
Copy link
Author

Thanks @imjared for sharing your fix, but unfortunately, it didn't work for me. Here's my related grunt config:

server: {
    base: 'http://phi.site'
},
reload: {
    proxy: {
        port: 80,
        host: 'phi.site'
    }
}

I'm still getting the following even after adding the server configuration:

Running "reload" task
Proxying http://phi.site:80/
reload server running at http://localhost:8001

Did you happen to do more than just add the server config? Thanks in advance for any help you may be able to offer :)

@imjared
Copy link

imjared commented Dec 18, 2012

Is http://phi.site:80 accessible? If so, try hitting http://phi.site:8001, make a change to index.html with grunt watch running, and hopefully you'll see magic.

If that doesn't work for you, I'm afraid I won't be too much more help 😞

@cerebralideas
Copy link
Author

Thanks for the reply @imjared, http://phi.site:80 works, but http://phi.site:8001 does not. I tried adding port: 80 to the grunt file like so:

server: {
    base: 'http://phi.site'
},
reload: {
    port: 80, // added this
    proxy: {
        port: 80,
        host: 'phi.site'
    }
} 

But, that didn't help either. The problem is I'm not familiar with ports and such, so I'm not really sure what the different ports are supposed to reflect. Oh well, thanks for trying to help :)

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