The Joyent Community

A place where the Joyent community can gather, help each other out, and stay informed.

You are not logged in.

#1 2004-11-19 06:34:17

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Local Development (Mac)

How about we offer support to each other for how to best go about doing local development on various platforms? As we just saw with another MySQL fault on barclay, we developers need to focus on local development (and even testing, !) before putting applications live on a shared server.

Well, this was not the main intention for this post, but it turns out I do feel like we could benefit from an entire forum (maybe one for mac, the same or another for *nix, and one for windows?) towards helping each other with local development. We could also support each other with tips on how to keep optimizing for growth along with TextDrive's beautifully optimized servers. Does anyone else feel this would help?

On a more immediate note, if anyone's running a G5 and using Desktop Manager, the app appears to break after updating to the latest firmware (just released) for the G5. I'm now using VirtualDesktop, which works but is not as nice and isn't free. :(


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#2 2004-11-19 06:56:12

jason
a chief (i started this place)
From: San Francisco
Registered: 2004-06-01
Posts: 8821
Website  Expertise

Re: Local Development (Mac)

Let me move this over the new category, to be moderated by Justin.

Offline

 

#3 2004-11-19 08:25:05

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

My god did two textdrivers have the same thought at the same time? How unusual... NOT!


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#4 2004-12-03 00:17:54

misterk
?
From: Mpls, MN
Registered: 2004-06-01
Posts: 1168
Website  Expertise

Re: Local Development (Mac)

Ok - I'm stumped. My local apache has stopped working, and I can't figure out why. The break occurred about the time I installed php5 from mark liyanage. at first I thought it didnt work because I had the php5 module loaded twice, but I took all of the Load and AddModule directive out of httpd.conf and it still won't work, this time I don't get any errors.

Code:


[kjell@imac:~] % httpd -v
Server version: Apache/1.3.33 (Darwin)
Server built: Nov 29 2004 14:12:57


Here's what I get trying to start it:

Code:


[kjell@imac:~] % sudo apachectl start
Password:
Processing config directory: /private/etc/httpd/users/*.conf

Processing config file: /private/etc/httpd/users/joachimbjerke.conf Processing config file: /private/etc/httpd/users/vhosts.conf
/usr/sbin/apachectl start: httpd could not be started

My config files are valid. Where can I look to see why apache won't start? Anyone have any ideas?


-kjell

Offline

 

#5 2004-12-03 00:37:23

ryanschwartz
Joyeur Emeritus
From: Madison, Wisconsin
Registered: 2004-06-01
Posts: 1991
Website  Expertise

Re: Local Development (Mac)

have you looked at your log files? it'll say in error_log what's going on...

Offline

 

#6 2004-12-03 00:46:12

jason
a chief (i started this place)
From: San Francisco
Registered: 2004-06-01
Posts: 8821
Website  Expertise

Re: Local Development (Mac)

Where is your central httpd-error log? The path should be in httpd.conf

Offline

 

#7 2004-12-03 01:22:30

misterk
?
From: Mpls, MN
Registered: 2004-06-01
Posts: 1168
Website  Expertise

Re: Local Development (Mac)

ahhh, why didn't I do that! You guys' help is turning me into a lazy sob:

Code:


httpd: could not open error log file /Library/Webserver/dev/railslog/apache.log.
fopen: No such file or directory

But now where on earth is it trying to open that from? I have two rails applications running out of /Library/WebServer/dev/rails, but there isn't a railslog folder... if I make the file apache wants it works just fine... Is there a rails.conf file somewhere which junks up where the log should go? My error_log is in ErrorLog "/private/var/log/httpd/error_log", and not the dev directory...


-kjell

Offline

 

#8 2005-01-21 05:57:58

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

My main development environment is finally put together with Panther. mydomain.dev is convienently pointing to my site's local root, and apache/php/mysql is working peachy.

Now for PC testing. I've got a Win XP machine sharing my internet connection from Panther. Is there anyway to visit mydomain.dev and see my development site (on the Mac)?

Otherwise, I've made the switch to DNS Made Easy and would appreciate any tips on properly pointing alpha.mydomain.com to my local development machine. My net connection is a sprint DSL line. I'm not sure how to find the IP to point to my machine.

Which way is easier/safer for doing local development but being able to test the dev site on another computer (in this case Win XP)?


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#9 2005-01-21 06:12:23

trel1023
Moderator
Registered: 2004-06-01
Posts: 595
Website  Expertise

Re: Local Development (Mac)

i use dyndns.org to not have to know my local cablemodem IP.

you could point alpha.mydomain.com to yourusername.dyndns.org and you're set.

there are clients for all platforms that constantly monitor your IP for changes and upload when they see one.

it's the most elegant solution - in terms of work for me.

it's not the most elegant in how it looks - since it's actually a dyndns URL.

but if it's just for you, then who cares, right?

Offline

 

#10 2005-01-21 06:12:58

trel1023
Moderator
Registered: 2004-06-01
Posts: 595
Website  Expertise

Re: Local Development (Mac)

otherwise, you have to update your dns yourself whenever it changes.

which is, by the way, for the birds.

Offline

 

#11 2005-01-21 06:27:08

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

trel wrote:

there are clients for all platforms that constantly monitor your IP for changes and upload when they see one.


This is a DynDNS client, to change your IP with them? Is DynDNS better than DNS Made Easy for this reason? Maybe there's a client also for DNS Made Easy?


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#12 2005-01-21 10:05:29

Marten
Moderator
From: Netherlands
Registered: 2004-09-13
Posts: 594
Website  Expertise

Re: Local Development (Mac)

cameron wrote:

trel wrote:

there are clients for all platforms that constantly monitor your IP for changes and upload when they see one.


This is a DynDNS client, to change your IP with them? Is DynDNS better than DNS Made Easy for this reason? Maybe there's a client also for DNS Made Easy?


Like one of these?

At DME you can even do it with something as simple as a http request to a certain url, so you can even do it from say, a shell script. Ofcourse, that means sending your password unencrypted in the url so it's not really adviced, but it's possible. :)

Last edited by Marten (2005-01-21 10:07:04)

Offline

 

#13 2005-01-21 14:38:23

trel1023
Moderator
Registered: 2004-06-01
Posts: 595
Website  Expertise

Re: Local Development (Mac)

from that page at dnsmadeeasy.com:

DNS Made Easy also supports SSL transactions. You can use this extra security by switching to HTTPS:

Code:

https://www.dnsmadeeasy.com/servlet/updateip?username=<email>&password=<password>&id=<id>&ip=<your new ip>

Last edited by trel1023 (2005-01-21 14:39:17)

Offline

 

#14 2005-01-21 15:15:29

ryanschwartz
Joyeur Emeritus
From: Madison, Wisconsin
Registered: 2004-06-01
Posts: 1991
Website  Expertise

Re: Local Development (Mac)

And if you use this link when signing up with DNS Made Easy, you help support TextDrive as well as getting kick ass

Offline

 

#15 2005-01-21 16:42:42

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

I'm seeing the light! Thanks.


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#16 2005-01-21 18:05:27

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

So far these scripts are all using wget.

wget is not installed on OS X. I just tried installing it. But failed to make.

Other's are saying 'use fink'. Rather not. Should I?

Can someone help me change these wget commands to curl commands in this DME_update script:

Code:

$cmd = "wget -O /proc/self/fd/1 -q \"$getip_ext_url\"";
$cmd = "wget -O /proc/self/fd/1 -q \"$url?username=$username&password=$password&id=$id&ip=$new_ip\"";

Last edited by cameron (2005-01-21 18:06:14)


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#17 2005-01-21 18:07:31

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

ryanschwartz wrote:

And if you use this link when signing up with DNS Made Easy, you help support TextDrive as well as getting kick ass


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#18 2005-01-21 19:41:39

jason
a chief (i started this place)
From: San Francisco
Registered: 2004-06-01
Posts: 8821
Website  Expertise

Re: Local Development (Mac)

Hmm... so the dynamic DNS update like that could also be done for failovers.

Offline

 

#19 2005-01-21 19:54:17

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Hey jason, any help with my wget problem?


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#20 2005-01-21 23:26:03

misterk
?
From: Mpls, MN
Registered: 2004-06-01
Posts: 1168
Website  Expertise

Re: Local Development (Mac)

Do you have fink? If fink is on your machine (you would have had to put it there) wget is a quicke install. And it's a good utility. Fink is too!


-kjell

Offline

 

#21 2005-01-22 01:10:51

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

So, fink it is huh? It's huge though. What else would I use besides wget?


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#22 2005-01-22 01:28:58

misterk
?
From: Mpls, MN
Registered: 2004-06-01
Posts: 1168
Website  Expertise

Re: Local Development (Mac)

Fink is a package manager that simplifies installing a bunch of other littler things - it's not a utility like wget. I think if you want to install wget, the best way to do that is to use fink, but have you tried just changing the two wget's in the script into curls? I think they would both do the same thing, which is request a url which would then tell the server that your ip has changed and what it has changed too. Try it?


-kjell

Offline

 

#23 2005-01-22 01:49:41

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

I did try just changing wget to curl. It's giving me a malformed curl request. I'll try some more though. This unix command stuff is not strong for me though.

I did install fink once before on another machine and didn't seem to use any of the apps/utilities. What else do you use from it regularly?


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#24 2005-01-22 07:19:02

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Well, I can now officially update my Dynamic IP with DNS Made Easy using a customized DME Update script. For someone new, I'll post the info below. This is for setting your dynamic IP address with DNS Made Easy on a Mac Panther.

-- Get wget and follow build instructions
-- Get DME Update script (there are others, but this one is more intentional and easy to add records)
-- Open config.pl from DME update:

-- use these three parameters: $nic = "en1"; (per these this article on Mac OS X file system) $getip_ext = 1; (use this as 1 if you have a router or modem firewall and want to do an external IP check) $getip_ext_url = "http://www.dnsmadeeasy.com/myip.jsp"; (default)
-- Open dme_update (per this article) and, -- change from:

Code:

        $cmd = "wget -O /proc/self/fd/1 -q \"$getip_ext_url\"";

-- change to:

Code:

        $cmd = "wget -O /dev/fd/1 -q \"$getip_ext_url\"";


-- and -- change from:

Code:

        # call the update servlet at DNS Made Easy
        $url = "http://www.dnsmadeeasy.com/servlet/updateip";
        $cmd = "wget -O /proc/self/fd/1 -q \"$url?username=$username&password=$password&id=$id&ip=$new_ip\"";

-- change to:

Code:

        # call the update servlet at DNS Made Easy
        $url = "https://www.dnsmadeeasy.com/servlet/updateip";
        $cmd = "wget -O /dev/fd/1 -q \"$url?username=$username&password=$password&id=$id&ip=$new_ip\"";

Well, I hope that helps somebody else. Not friendly stuff here. But we're not after your everyday localhost'n dev environment either.

Anyway, you might then check out CronniX to keep a cron job for updating your Dynamic IP with DME regularly.

Almost a side note after that, but now it's a matter of opening up a crack in the firewall to allow the new IP to point to the local Apache2 instance, rather than default Apache1 and "web sharing" stuff. But hey, that's only if I can get through sprint's dsl and an airport extreme. Didn't someone write a tutorial yet for "setup dynamic dns for localhosting on mac os x with sprint dsl and airport extreme with additional apache2 build while still keeping firewall on and security tight -- in a nutshell"? I'd almost pay for one.

Last edited by cameron (2005-01-22 07:25:04)


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#25 2005-01-22 07:25:52

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#26 2005-01-22 07:39:59

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Okay, so "myip" from an external perspective is the IP of my dsl router. This is quite dangerous at the moment because there is a web-based dsl setup thingy available to the world. How do I get to the server itself?


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#27 2005-01-22 08:53:40

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

How does one enable web sharing for a new Apache2 instance, separate from the Apache1 shipped with Panther?

I'm using the Apache2/php5/mysql builds from Server Logistics.


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#28 2005-01-22 09:03:00

Damelon
Member
From: Lyon, France
Registered: 2004-06-01
Posts: 880
Website  Expertise

Re: Local Development (Mac)

Cameron, I don't use the SL packages, I built Apache2 and then sorta hammered on the instructions at the following link to make it work:

http://sean.typepad.com/ditto/2004/09/finks_apache2.html

Every time you bump the system you need to redo the process, I don't know if it's worth the effort or not. I suspect not.

Offline

 

#29 2005-01-23 10:34:43

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Damelon wrote:

Cameron, I don't use the SL packages, I built Apache2 and then sorta hammered on the instructions at the following link to make it work:

http://sean.typepad.com/ditto/2004/09/finks_apache2.html

Every time you bump the system you need to redo the process, I don't know if it's worth the effort or not. I suspect not.


Yeah, I was half way there with this. Thanks for the link. For those using the server logistics builds of apache2, the above link does allow Panther to believe it is "web sharing" from your apache2. But the server logistics pref panel control of apachectl (start/stop) stops working.


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#30 2005-01-23 10:51:04

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

cameron wrote:

Almost a side note after that, but now it's a matter of opening up a crack in the firewall to allow the new IP to point to the local Apache2 instance, rather than default Apache1 and "web sharing" stuff. But hey, that's only if I can get through sprint's dsl and an airport extreme. Didn't someone write a tutorial yet for "setup dynamic dns for localhosting on mac os x with sprint dsl and airport extreme with additional apache2 build while still keeping firewall on and security tight -- in a nutshell"? I'd almost pay for one.


I'm starting to wonder if this is even possible. Or worth it. The goal is to be able to test my dev sites with a win xp machine literally next to my mac dev machine. Without uploading to TextDrive first. Any other suggestions?


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#31 2005-01-23 10:59:36

Damelon
Member
From: Lyon, France
Registered: 2004-06-01
Posts: 880
Website  Expertise

Re: Local Development (Mac)

I'm probably missing something, so I apologize in advance if that's the case, but testing what? The CSS? The XHTML? If that's what you are referring to by development, then uploading to a .textdriven.com domain is probably just as fast as the next thing. If you are talking about building something (say in RoR) then I'm not so sure testing it on XP is needed. All you would be doing then is serving the wrapping to XP which is again the XHTML and CSS, correct? The idea is simply to build it locally and check it's working before uploading it to a production server (in this instance probably TD), correct?

Offline

 

#32 2005-01-23 11:19:25

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Damelon wrote:

I'm probably missing something, so I apologize in advance if that's the case, but testing what? The CSS? The XHTML? If that's what you are referring to by development, then uploading to a .textdriven.com domain is probably just as fast as the next thing. If you are talking about building something (say in RoR) then I'm not so sure testing it on XP is needed. All you would be doing then is serving the wrapping to XP which is again the XHTML and CSS, correct? The idea is simply to build it locally and check it's working before uploading it to a production server (in this instance probably TD), correct?


Maybe you're right. The planned dev environment, now that I've got more than myself developing sites, is keep everything in a repository, build most sites with TextPattern, custom plugins, always test locally first (we've seen here why this is important), then move to TextDrive for production.

You're right, though. I want to test with the windows machine mostly for xhtml and css. It's just nice to be able to test the layout and design as a full-on TextPattern site, with PHP5, custom plugins, etc. dynamically before uploading to TextDrive.


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#33 2005-01-23 11:29:21

Damelon
Member
From: Lyon, France
Registered: 2004-06-01
Posts: 880
Website  Expertise

Re: Local Development (Mac)

This is the crazy thing about setting up the machine for local stuff. If the development is only for XHTML/CSS testing across platforms I don't know if there's any reason to bother with the Apache2 stuff (except as an exercise in geekness, of course). The default OS X setup is more than sufficient for platform compatibility (that is, serving up pages locally you can view on your XP or IE 4.0 or whatever floats the boat).

The Apache2 setup is only really useful if you are trying to write programs of some sort that you want to test before moving to a working and public server. Better to crash a machine with only one user instead of one with 300+

As I've stated though, I could be missing something.

Offline

 

#34 2005-01-23 11:46:20

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Working towards the future, it's ideal to have a development server for any sizable project. My thinking is to have my mac box be the dev server. But maybe I'm better off setting up a second FreeBSD machine? It could also be off-site (and outside my DSL router/network), but far away from TextDrive and it's shared environment.

Unless I can figure out how to allow access to my mac machine safely, I think I start looking for such a dev server.

edit: or until I can afford a dedicated server, right? :)

Last edited by cameron (2005-01-23 11:48:19)


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#35 2005-01-23 11:55:36

Damelon
Member
From: Lyon, France
Registered: 2004-06-01
Posts: 880
Website  Expertise

Re: Local Development (Mac)

cameron wrote:

But maybe I'm better off setting up a second FreeBSD machine?

In my version of geek heaven, yes, I have a dedicated FreeBSD setup mirroring TD in total, just for giggles.

Offline

 

#36 2005-01-23 18:43:07

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Damelon wrote:

cameron wrote:

But maybe I'm better off setting up a second FreeBSD machine?


In my version of geek heaven, yes, I have a dedicated FreeBSD setup mirroring TD in total, just for giggles.


Yeah, what plan is that? :)

At this point I'll settle for being able to test on IE win xp with it directly plugged in to my mac. And it works fine once personal web sharing is turned on. But for anyone trying this with a non-apple apache build on their mac, I could only get this to work with the help of the link D posted above. Email me if you need help with it.


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#37 2005-03-10 05:53:22

kemmott
Casual Lurker
From: Arlington VA USA
Registered: 2004-06-01
Posts: 231
Website  Expertise

Re: Local Development (Mac)

Cameron, are you still having trouble with this? I think all you need is local DNS, or, at the simplest, to edit your hosts file on the windows box.

edit the file at c:\wins\system32\drivers\etc\hosts

add a line for your mac box for each dev site you want to show that you have set up as vhosts in apache:

192.168.1.10 siteone.dev siteone
192.168.1.10 sitetwo.dev sitetwo
...

assuming your mac is at .10

have you set something up like this on the mac so you can view the different vhosts?

you could also set up a local dns. the router I use, m0n0wall, lets you add names for local use in addition to the caching nameserver it provides...


TxD VC87, MG

Offline

 

#38 2005-03-10 06:34:04

cameron
AT Thru-hiker
From: cville, va
Registered: 2004-06-01
Posts: 734
Website  Expertise

Re: Local Development (Mac)

Thanks kemmott -
I didn't need to mess with anything on the windoze side once the mac's web sharing was (tricked) on (thanks Damelon). Can visit www.siteone.dev or localhost of my mac apache2 dev server.

It's working rather nicely -- and sites are less of a crap shoot now with my windoze based clients. :)


"If you build it, they will come."
-VC200, VCII, DMG- Plus, Premier

Offline

 

#39 2005-09-09 20:44:31

rsimplicio
Unapologetic Solopreneur
From: Chicago
Registered: 2005-05-11
Posts: 997
Website  Expertise

Re: Local Development (Mac)

Spam! ^

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson