作者:溟尛樂_840 | 来源:互联网 | 2014-05-29 08:43
因为各种原因这里没有mysql而是用mariadb开始首先是更新portsportsnapfetchextract#第一次更新时用,直接下载ports并且解压portsnapfetchupdate#以后更新时使用1.#安装nginxcd/usr/ports/www/nginxmakeconfig-recursivema
因为各种原因 这里没有
mysql 而是用mariadb
开始
首先是更新ports
portsnap fetch extract #第一次更新时用,直接下载ports并且解压
portsnap fetch update #以后更新时使用
1.#安装
nginx
cd /usr/ports/www/nginx
make config-recursive
make install clean
2.#安装php
cd /usr/ports/lang/php5
#在php5-extensions的config页面中,需要勾选PHP-FPM项。
make config-recursive
make install clean
cd /usr/ports/lang/php5-extensions/
#您的PHP似乎没有安装运行WordPress所必需的MySQL扩展
#这个有些要选择一下下 支持mysql gd什么 MYSQL PDO_MYSQL
make config
make install clean
3.#安装mariadb
http://www.freshports.org/databases/mariadb-server
cd /usr/ports/databases/mariadb-server/ && make install
clean
cp /usr/local/share/mysql/my-medium.cnf /var/db/mysql/my.cnf
echo 'mysql_enable="YES"' >> /etc/rc.conf
cat /etc/rc.conf
/usr/local/etc/rc.d/mysql-server start
mysql -uroot -p
4.#配置php
vi /usr/local/etc/php-fpm.conf
-; events.mechanism = epoll
+events.mechanism = kqueue
...
-listen = 127.0.0.1:9000
+listen = /var/run/php-fpm.sock
...
-;listen.owner = www
-;listen.group = www
-;listen.mode = 0666
+listen.owner = www
+listen.group = www
+listen.mode = 0666
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
echo 'php_fpm_enable="YES"' >> /etc/rc.conf
Start PHP-FPM:
Code:
# /usr/local/etc/rc.d/php-fpm start
Configure nginx
/usr/local/etc/rc.d/nginx restart
其它
添加root密码:
MariaDB [(none)]> set password for
root@localhost=password('password');
Query OK, 0 rows affected (0.00 sec)
# set root password
MariaDB [(none)]> set password for
root@'127.0.0.1'=password('password');
Query OK, 0 rows affected (0.00 sec)
mysqladmin -u root password yourpassword
8、安装eaccelertor
cd /usr/ports/www/eaccelerator
make install clean
vi /usr/local/etc/php/extensions.ini
添加
extension=eaccelerator.so
安装Memcache扩展
cd /usr/ports/databases/pecl-memca
mkdir -p /usr/local/etc/nginx/logs
echo 'nginx_enable="YES"' >> /etc/rc.conf
echo 'php_fpm_enable="YES"' >> /etc/rc.conf