全部博文(921)
分类:
2006-04-06 01:02:01
General Information
Using FreeBSD, Apache-modSSL, MySQL, PHP, Sendmail and CuCiPop, you can setup an open source solution that will have you serving dynamic web pages and email quickly, reliably, securely, and efficiently without any out-of-pocket expense.
Install CVsup to Stay Current
If you have just installed the ports collection using a CD-ROM, you must upgrade to the latest releases of the ported software you need.
# # # # |
cd /usr/ports/net/cvsup-without-gui As root, copy
Notice the space between ports-supfile and /root/ports-supfile.
Change the ports-supfile (line 50 or so) to look something like the following:
After you've done this, press Escape and then Return to leave editor. Press Enter to save your changes. Now it's time to run CVsup:
This command upgrades all the skeletons in your ports collection. Depending on your Internet connection speed, the upgrade can take an hour or longer. Install Perl5 Enter the following commands one at a time, waiting for the command prompt between each command #cd /usr/ports/lang/perl5
Install MySQL #cd /usr/ports/databases/mysql40-server Add the following two lines, one on top of the other as shown: WITH_BDB_VER=40 Press Escape to exit, and the Enter to save your changes before you leave the editor. Install Apache-mod_ssl
Press Enter to create an [R]SA server key. Enter correct details for each question. The process will then run through a second time. When asked to encrypt this key, choose [Y]es and then type an encryption password. This password must be entered each time the Apache server is restarted.
Add the following line to the end of the file
Press Escape and then Enter to exit and save changes
Remove the “#” comment from the beginning of the ServerName line and change it to suit (ie: ). Find the line that says ServerAdmin and put your postmaster e-mail address there.
Add the server to the list of hosts
Install PHP
When prompted to choose installation preferences, simply choose OK.
Install PHP Extensions
When prompted to choose installation preferences, simply choose OK. Enable Apache to serve PHP
Add the following lines to the bottom of the Apache httpd.conf file
You must now restart the apache server
Test the PHP installation (Optional)
Add the following code to the file you just opened
Press Escape and then Enter to leave the editor and save changes. Using another computer, navigate to your server in Internet Explorer (ie ). If installation was successful you should see the PHP information page. Start and Configure MySQL
Add the following line to the bottom of the file
Press Escape and then Enter to leave the editor and save changes.
The default password is blank so simply press Enter when prompted. For security reasons we should now secure the intial user accounts. Remember that all MySQL commands end with a semicolon.
Next we will set a default password for the root account.
Finally we must add an account for remote access.
You can now exit the MySQL server.
Test MySQL and PHP (Optional)
Add the following code to the editor window (don’t forget the semi-colons)
Press Escape then Enter to exit and save changes. Using another computer, navigate to this page (ie /mysql.php). If installation was successful you should see the PHP information page. Install and Configure Sendmail
Change the file to look like the following:
Press Escape then Enter to exit and save changes.
Change the file to look like the following:
Press Escape then Enter to exit and save changes. Install and Configure CuCiPop
Add the following code to the editor window. The second line should not be split as below.
Press Escape then Enter to exit and save changes.
Final Restart
The server will now restart, after which you should login as root. The above applications must now be started.
You’re finished! Adapted from Gregory L. Magnusson’s “Build a Dynamic Web Serving Platform with FreeBSD”. Updated by Scott Forbes in February 2006. Author: Scott Forbes
|