1

I currently work in a place where every developer programs on the same server and I don't believe it is a very good usage since I have to work on a network share, so it's a bit slow.

I setup a copy of BitNami MAMPstack and everything is working pretty good on port 8080 (I don't have any admin rights on my workstation).

The only problem is: I don't always work on the same project so I have to work on multiple local network vhosts. I'd like to make local vhosts that would point on my local machine. (Usually done simply by editing the hosts file). But since I don't have any admin rights, I can't edit /etc/hosts...

I use Firefox for development and I saw an add-on that was supposed to do so, but still at the end it edits the hosts file and needs admin rights...

Any ideas? Anyone knows how to do so?

Thanks a lot!

1
  • How do your co-workers get around this issue? Nov 2, 2010 at 21:41

3 Answers 3

3

You really want to talk to your support personnel so that you get the rights you need AND don't fall afoul of your workplace's service agreements. That said, this is a question worth answering for folks who get locked out.

If you boot the system in single-user mode (hold down COMMAND-S while booting), you will get access to the file system to modify the hosts file (you will need to invoke a CLI editor like nano from its full path). Remember that OS X doesn't always use the same info as other Unix services, but I think MAMP should do so. It is possible that your admins have disabled single-user mode, but most likely not.

1
  • Thanks for your detailed and quick answer. Unfortunately I work in a huge enterprise and making such a demand would take months. Just to simply give me the rights to edit my own hosts file (which should be permitted by default IMO). So I'm still searching for a solution. I don't think the admins would be happy to see me play with the single-user mode haha but thanks anyway! :)
    – Tommy B.
    Nov 2, 2010 at 20:30
2

Instead of trying to setup name-based-virtual hosts, why not use alternate addresses or ports instead? This will allow you to setup your local web server without needing any admin rights or messing around with name resolution at all.

If you where using alternate ports you bind each virtual host to a different port (ie port 8000 > project1, 8001 > project2, 8002 > project3)?

If you are only using this from your local system then you could bind the virtual hosts to different loopback addresses (ie 127.0.0.1:8000 > project1, 127.0.0.2:8000 > project2, 127.0.0.3:8000 > project3).

http://httpd.apache.org/docs/2.2/vhosts/ip-based.html

Listen 127.0.0.1:8000
Listen 127.0.0.2:8000
Listen 127.0.0.3:8000

<VirtualHost 127.0.0.1:8000>
  # project 1
  ..
</VirtualHost>
<VirtualHost 127.0.0.2:8000>
  # project 2
  ..
</VirtualHost>
<VirtualHost 127.0.0.3:8000>
  # project 3
  ..
</VirtualHost>

You could even create another virtual host that included a quick index page that linked off to your other virtual hosts do you don't have to remember which ip/port to use.

1
  • yea, that could be a reasonable workaround... No toes to be stepped on there. As far as an index page (I tend to refer to mine as a 'launcher') of commonly-used resources, I've found that to be an invaluable tool; Just a bunch of links/note/phone numbers that I'd want to keep on hand. It's ugly (it's a place to use to go somewhere else), but functional (sits in the browser shortcut bar).
    – gWaldo
    Nov 3, 2010 at 1:32
1

You haven't said that you asked your support staff for admin access (or at least for them to make your change for you...). I'd try that first, providing them with a business case for your request. If your request is denied, run it up the flagpole until you get the answer you need.

1
  • Even if it will take months, you should put in the request to get the ball rolling. Nov 2, 2010 at 21:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .