在 FreeBSD 11 里安装使用 apache24 + php7.1(php-fpm) + mysql 5.7

开发者论坛 > 云分享> 帖子正文


在 FreeBSD 11 里安装使用 apache24 + php7.1(php-fpm) + mysql 5.7

dongshan8 2017-12-16 回复 2 浏览 2301
环境:FreeBSD 11.1-RELEASE [attachment=138725] 过程: 1. pkg install apache24 # 安装 apache2.4 [attachment=138726] 2. pkg install mysql57-server # 安装 mysql server 5.7 [attachment=138727] 3. pkg install php71 php71-curl  php71-gd  php71-mbstring php71-mcrypt php71-mysqli php71-openssl php71-pdo_mysql php71-xml # 安装 php7.1 和相关模块 [attachment=138728] 4. /usr/local/etc/apache24/httpd.conf # 编辑 httpd 的配置文件,本例,启用了好些模块 rewrite_module, mpm_event_module, http2_module, ssl_module, mod_proxy_fcgi, mod_proxy,引用了 httpd-vhosts.conf 文件,禁用了 mpm_worker_module 模块 [attachment=138729] 5. /usr/local/etc/apache24/extra/httpd-vhosts.conf # 编辑虚拟主机配置文件,如下例,是添加了https站点 portal.anqun.org的配置内容 [code]Listen 443 <VirtualHost *:443>         Protocols h2 http/1.1         ServerName portal.anqun.org         SSLEngine on         SSLCertificateFile "/usr/local/etc/apache24/ssl/214238936730268.pem"         SSLCertificateKeyFile "/usr/local/etc/apache24/ssl/214238936730268.key"              DocumentRoot "/usr/local/www/portal_anqun_org/public_html"         ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/www/portal_anqun_org/public_html/$1         ErrorLog "/usr/local/www/portal_anqun_org/logs/error.log"     <Directory "/usr/local/www/portal_anqun_org/public_html">         AllowOverride All         DirectoryIndex index.php index.html         Require all granted         Allow from all     </Directory> </VirtualHost>[/code] 6. sysrc apache24_enable=yes # 允许 apache24 服务 7. sysrc mysql_enable=yes # 允许 mysql-server 服务 8. sysrc php_fpm_enable=yes # 允许 php-fpm 服务 9. service apache24 start # 启动 apache24 服务 10. service mysql-server start # 启动 mysql-server 服务 11. service php-fpm start # 启动 php-fpm 服务 [attachment=138733] 12. ALTER USER 'root'@'localhost'  IDENTIFIED BY 'niDEpASSWORD' ; # 首次启动mysql5.7后,root的密码会写在/root/.mysql_secret 文件里,需要用 ALTER USER 命令更改密码后使用 [attachment=138730] 13. phpinfo显示信息 [attachment=138732] 14. wordpress安装效果 [attachment=138731] 参考: * [url]https://www.freebsd.org/doc/handbook/pkgng-intro.html[/url] * [url]https://www.garron.me/en/linux/apache-event-php-fpm-mariadb-freebsd.html[/url] * [url]https://www.digitalocean.com/community/tutorials/how-to-install-an-apache-mysql-and-php-famp-stack-on-freebsd-10-1[/url] * [url]https://wiki.apache.org/httpd/PHP-FPM[/url] * [url]https://dev.mysql.com/doc/refman/5.7/en/alter-user.html[/url]
展开全部内容
<上一篇 下一篇>
火星123 1楼 01-25
您的帖子很精彩!希望很快能再分享您的下一帖!
火星123 2楼 01-25
您的帖子很精彩!希望很快能再分享您的下一帖!

相关帖子