Friday, March 14, 2008

Installing FreeBSD 7.0 - Apache 2.2 MySQL 5.1

Installing Apache 2.2 and MySQL
  • See to it that you are root
  • Execute: cd /usr/ports/www/apache22
  • Execute: make install clean
  • Choose any options that you like for Apache
  • Execute: ee /etc/rc.conf
  • Add the following line to rc.conf
  • apache22_enable="YES"
Ok, now you've got Apache 2.2 installed. Let's install MySQL 5.1.
  • Make sure that you're still root
  • Execute: cd /usr/ports/databases/mysql51-server
  • Execute: make install clean
  • Execute: ee /etc/rc.conf
  • Add the following line to rc.conf
  • mysql_enable="YES"
Now reboot!

Ok, so try and access the website by punch in the IP of your server in a browser somewhere. "It works!" Cool!

For MySQL i recommend downloading MySQL GUI Tools. Hook MySQL Administrator to your server. This will probably not work because you haven't set your password yet. Also your MySQL server isn't configured for remote connections.

Make this work was a bit of a problem, and it took it's time. I didn't make notes of what I actually did to make it work :|. However I think that I started out by setting the password and then I logged on to webmin.

Setting password:
  • Fire up the terminal and login as root
  • mysqladmin -u root password newpassword
Apparently there is a "safer way" to do this. Follow this link if you are concerned Installing and configuring mySQL2.

  • Login to webmin
  • Unfold "Servers"
  • Clicked MySQL Database Server (However the module doesn't work)
  • Click the "Module Config" at the top left corner
  • Find "MySQL configuration file" and change the current value to "/var/db/mysql/my.cnf"
  • Click "Save"
I make reservations for the possibility that you may need to change the location to all the commands. If that's the case, they're all placed in "/usr/local/bin/". But if all is correct you should now be able to configure MySQL from webmin. What you need to do is set up the ability for remote connections.
  • Back to the main menu of MySQL in webmin
  • Click "User Permissions"
  • Click "Create new user"
  • Choose username, my choice was developer
  • Set a password
  • Either you can set a fixed IP or you can put wildcards in it I put 192.168.0.% which means that I can access MySQL from any machine on my LAN.
Now you might want to configure the webmin Apache module to work with your FreeBSD installation of Apache22. I actually don't remember the exact variables that i changed but basically it's the paths. Most of them point to something/apache/something which you should change to something/apache22/something.

No comments: