Showing posts with label G4. Show all posts
Showing posts with label G4. Show all posts

January 8, 2008

Remember to update xTemplate

I was having the hardest time yesterday getting xtemplate to work on the G4 web server. Every time I would open the php page a white screen would load. No errors, no problems, would not echo anything to the page!

I checked online and no one else seems to have this problem. So I though that maybe the Mac version PHP had something to do with it, but no luck there as well. Regular PHP would work fine, yet even pages I have done in the past and worked would not load. Finally I downloaded a fresh version of xtemplate and checked to see if the tutorial files worked. Low and behold they worked! Apparently a new version of xtemplate has come out and it works with the newer version of php I am running.

So a note for any one having problems with xtemplate running on a mac you might want to get the latest version!

[UPDATE: I had never turned on error reporting in my PHP install so that is why it never gave me any errors.]

December 28, 2007

Samba & Swat on Mac OSX

With PHP and Mysql installed, it was on to setting up file sharing on my G4 Server which now had 4 hard drives in it. A friend of mine already had a server set up a while ago, so I had a little knowledge of Samba configurations, and I figured it was similar to the webDav setup I had done on an eMac a while ago.

There is nothing to install because Samba is already installed in OSX and you can just turn on Windows File sharing in the Sharing preference panel to start it. However beyond that there is not much control over what is shared and who has access to what. To do that you need to edit the smb.conf file in /etc, but I am inexperienced/lazy and would like a better way of doing this. After doing some research found that Samba had a web GUI for it called Swat, and like in the case of PHP it is installed by default, but is not active.

To start the service you must set the Swat service as avalable and using tcp port 901. I used the page here to figure this out. "Configuring xinetd to launch swat requires just a few steps. You first need to check that your /etc/services file contains a port entry for swat. To do this, enter the following command in the Terminal: cat /etc/services | grep swat. This command should return one result, which will list the swat service as running on port 901/tcp. If you do not get a result for this, add such an entry to your /etc/services file by editing it with pico running under sudo or as root. Add an entry that lists the information above and then save your changes." I used VI because that is what I am most comfortable with. There is already a service specified by port 901, but it is not needed so remove the line with UDP and replace with swat.

After that I tried to set up a service in etc/xinetd.d for swat, and that worked, but the swat page at localhost:901 would not let me log on. I found that there was no password file associated to it, and quickly looked for a fix. Not only did I find a fix but an easier way to set it up. Mac os Hints had a good Article on Samba and in the comments is how to get around the problems. These are the steps I finally figured out, using the mix of suggestions on the page here.

1. Edit /etc/hostconfig
2. Change SMBSERVER=-NO- to SMBSERVER=-YES-
3. Save
4. Edit /etc/services
5. Find the line where port 901 is defined
6. delete the line where it says 901/udp
7. Change the 901/tcp line to read: swat 901/tcp
8. Save the file
9. cd to "/etc/pam.d"
10. run "sudo cp ./passwd ./samba"
11. run "/sbin/service swat start"
12. reboot
13. goto http://localhost:901

After this it is all working and I can now use swat to set up my Samba shares.

December 27, 2007

PHP & Mysql on Mac OSX

Now that have a running G4 tower that I can use as a server, all that is left is to set up the required items on it. My main goal is PHP and MYSQL so that I can start development on the next update to the PSU AMS groups website. From what I had learned from previous setups is that PHP is already installed in Mac OS 10.4, however it is not completely active. Luckily the process was very painless and straight forward. It also helped that I was not doing anything more then a simple setup.

I made the PHP setup a lot harder than it had to be and tried to build from the latest source. Sadly I did not have all of the required dependancy files for it and that quickly became a waist. Still it was a good idea to read the Apple developer page on PHP first here. Luckily someone had already made an installer for PHP, and I just had to find it at Entropy. It installed without any problems, just make sure to read the directions.

Mysql was next, just like PHP there was a handy installer for it. Apple's developer site has a great page on installing Mysql on Mac OS X here, that I started with. It boiled down to just get Mac installer from the Mysql site and install it. It also included a control panel for Mysql that I installed, it lets you set Mysql to start up on every time the computer is turned on.

One thing that was missing was the phpMyAdmin page for Mysql. I thought that it would be included, however after trying to get to lazurus.local~efeion/mysql, which is how I get to it from school, it quickly become apparent that was not the case. It is actually a separate project here. To make it similar to what I am use to using, after extracting the directory, I named it mysql and placed it in the sites folder in my directory. This is where apache is set to host websites by default, and is fine for what I am doing. Now if I went to lazurus.local/~efeion/mysql and the phpMyAdmin page would show up, but now complained about not being configured. Easiest way to fix that was to go to the mysql/scrips/setup.php page. This handy script will generate a config file for phpMyAdmin, just grab what it outputs and save it in a file called config.inc.php located in the main mysql folder. There is a sample version in that folder for the more advanced users to set up manually. However I am still new to this and did not want to dig that deep yet.

Now I had a PHP web server with a Mysql back end all set up, which was a lot easier than I expected.

December 9, 2007

Power Supply Fun Part 2




After trying to revive a G4 mirror drive door power-supply by replacing the fuse instead of using a screw driver did not help ether. Same sparks and smoke as last time, just the fuse blew instead of continuing to give off sparks as in my first attempt. So on to plan B... After doing a good deal of research online, there was little evidence that you could take a regular atx power-supply and replace a dead G4 MDD PS with it. After removing the pins from the ATX PS molex connector (thanks Matt) and cutting the entire wire from the MDD PS i just had to put the two together. Please note that you need the original molex connector from the old power supply for this to work, or one that fits, a regular ATX power supply does not have the right number of pins.

If you look online the MDD PS has 24 pins and the ATX PS has 20-24 (mine had 20+4). This is not so bad but the wires in each are a little different, so in all cases some rewiring needs to be done. First thing was to figure out what wires I had and what needed to be modified. ATX and MDD are good places to start. for the pin-outs. My main problem where the two extra white(-10v and +25v) and the gray(PWR-OK) wires. The -10v cant be used so ignore it, and the PWR-OK is also not needed. So the only problem was the +25v used for the video card to drive apple displays. Well you could find some way to add 25v to it, but my friend and I figured that it should be fine with out it, which turns out to be correct. However because of this do not try to use an apple cinema display with this tower!

Connect all of these together matching the same colors together, ignoring the white and gray from the ATX PS. Plug it in and behold the computer turns on. I also connected the MDD power leads as well, because they where longer and the ATX PS did not have enough connector to match the two optical drives and the 4 hard disks. Plus a little wire wrap to make it look less messy and protect the wire splices. The final step was to mount the PS in a good place. Because the original was slim it fit in the pack wall, not so much in this case. The best solution I found was against the side where the white speaker box was. I drilled two holes and zip tied it against the roof of the case. If I had more tools at my disposal I would have found a way to bolt it to the top, which would look a little better.

There you have it, a dead MDD brought back to life. It also has more power now, 400w from the 360w of the original power supply.

Update: After several months the G4 is still cranking away 24/7 as my web development server, and apparently this post has come in handy for some one at http://atxg4.com/forum/read.php?3,8