| Installing PHP/MySql/Mod_SSL/Apache 2.x on BSD |
|
|
|
| Written by Administrator |
| Thursday, 28 February 2008 07:52 |
|
To set up/Install PHP, MySQL, Apache, Mod_SSL on a FreeBSD box. 1. Install Mysql 1. Install Mysql # cd /usr/ports/databases/mysql323-server/ Optional: # cd /usr/ports/databases/mysql323-client/ 2. Configure MySQL and launch it (still working on this part for docs). If you wish to limit MySQL to localhost connections, copy /usr/local/share/mysql/my-large.cnf to /etc/my.cnf then edit /etc/my.cnf and add the following line under [mysqld]: bind-address = 127.0.0.1 Start My SQL: # cd /usr/local ; /usr/local/bin/safe_mysqld & [for 3.2.3] # /usr/local/bin/mysqladmin -u root password <new-password> Add the following if you plan to allow external connections Notes: # /usr/local/bin/mysqladmin -u root -h zone -p shutdown To create a database (You will be prompted for a password): # /usr/local/bin/mysqladmin -u root -p create <database name> To create a user for a database (You will be prompted for a password): # /usr/local/bin/mysqlaccess -u <username> -p <password> -d <database> -U root -P <Root's MySql Password> To check rights to a database: # /usr/local/bin/mysqlaccess <user> <database> -U root -P <Root's MySql Password>
# cd /usr/local/src 4. Make OpenSSL # cd /usr/local/src/openssl-0.9.7e 5. Compile/Configure Apache # cd /usr/local/src/httpd-2.0.55 Continue with install 6. Install LIBMCRYPT # cd /usr/local/src/libmcrypt-2.5.7 7. Install LIBMHASH # cd /usr/local/src/mhash-0.9.2 8. Install Aspell # cd /usr/local/src/aspell-0.60.2 If this fails, install the port: # cd /usr/ports/textproc/aspell 9. Install PCRE # cd /usr/local/src/pcre-6.3 10. Install cURL # cd /usr/local/src/curl-7.15.1 11. Compile Mod_PHP Note: You'll want to add/remove any additional options to your php configure command before continuing. In this case, I had already added the necessary libraries for zlib, jpeg, and gd before running the configure command below. 12. Configure PHP in Apache # vi /usr/local/apache/conf/httpd.conf Add/verify the following line under the LoadModule section: LoadModule php4_module libexec/libphp4.so or AddModule mod_php4.c Add/verify the following line under the AddType section: AddType application/x-httpd-php .php .phtml Find the following line: DirectoryIndex index.html And change it to: DirectoryIndex index.html index.htm index.php |
![]() |
|