Please register login
Cross-border dating, Leading business, The sweet love story begins here return homepage

adminpersonal space https://admin.pclub.cc [favorite] [copy] [RSS]

log

FreeBSD13.1+Apache24+PHP74+MySQL57 Installation Notes

have read 186 times2022-8-27 19:57

1. Make a bootable U disk
 Download and install the source program from FreeBSD official website (https://www.freebsd.org/): FreeBSD-13.1-RELEASE-amd64-dvd1.iso
Download rufus.exe from the rufus official website (https://rufus.akeo.ie/).
Use rufur to make FreeBSD installation boot disk.
 
Second, install FreeBSD13.1
Set the computer to boot from a USB drive.
After startup, it is basically installed automatically. If you encounter options, select Y for all;
Add users (omitted).
 
3. Open SSH service
After the installation is complete, reboot.
Root login, modify the remote login configuration.
Command: ee /etc/inetd.conf
Open the inetd.conf file, remove the "#" before the SSH service, save the file and restart.
You can use Putty to log in remotely.
 
Four, Port installation preparation
Modify DNS command: ee /etc/resolv.conf
Add DNS server address nameserver x.x.x.x Save and restart (x.x.x.x is replaced with the actual ip address)
Download the Port installation directory file Command: portsnap fetch
Update the Port installation directory file Command: portsnap extract update
Five, install Apache24
Go to the /usr/ports/www/apache24/ directory
Install, command: make install clean
Set server address Command: ee /usr/local/etc/apache24/httpd.conf
Modify the www server address ServerName x.x.x.x:80 (x.x.x.x is replaced by the actual ip address or www like this)
Modify the boot file, set Apache24 to start with boot, command: ee /etc/rc.conf
Add apache24_enable="YES" to save and start.
After installation, the default web directory: /usr/local/www/apache24/data/
Apache related commands start apachectl start stop apachectl stop restart apachectl restart
Six, install MySQL57
It is recommended to install MySQL before PHP and enter /usr/ports/databases/mysql57-server
Installation command: make install clean
Modify the startup file and set MySQL to start with the startup, command: ee /etc/rc.conf
Add mysql_enable="YES" to save to start.
Seven, install php74
Enter /usr/ports/lang/php74
Installation command: make install clean
Eight, configure Apache24 and PHP74
Go to /usr/ports/www/mod_php74
Installation command: make install clean
Modify the configuration file ee /usr/local/etc/apache24/httpd.conf
Add to
DirectoryIndex index.html index.php
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
<⁄FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
<⁄FilesMatch>
Write the entry file index.php with the content <?php phpinfo(); ?> Save and restart
Access index.php through the server address
 Copy the configuration file /usr/local/etc/php.ini-development to /usr/local/etc/php.ini
Nine, configure PHP74 and MySQL57
Go to /usr/ports/lang/php74-extensions
Installation command: make install clean
When the selection menu appears, select mysqli
Access index.php, if mysqli is loaded successfully, the installation is complete.

10. freebsd-update -r 13.1-RELEASE upgrade
If an error occurs in the upgrade, execute the following two lines before continuing with the final main program of MySQL installation.
user 'mysql' disappeared during update
/usr/sbin/pwd_mkdb -p /etc/master.passwd

一、制作启动U盘
 从FreeBSD官网(https://www.freebsd.org/)下载安装源程序: FreeBSD-13.1-RELEASE-amd64-dvd1.iso
从rufus官网(https://rufus.akeo.ie/)下载rufus.exe。
用rufur制作FreeBSD安装启动盘。
 
二、安装FreeBSD13.1
将电脑设置成U盘启动。
启动后,基本自动安装,如遇选择项,全选Y;
添加用户(略)。
 
三、开通SSH服务
安装完毕后,重启。
root登录,修改远程登录配置。
命令:ee /etc/inetd.conf
打开inetd.conf文件,将SSH服务前的“#”去掉,存盘重启。
可以使用Putty远程登录了。
 
四、Port安装准备
修改DNS 命令:ee /etc/resolv.conf
添加DNS服务器地址 nameserver x.x.x.x  存盘重启(x.x.x.x用实际的ip地址代替)
下载Port安装目录文件 命令:portsnap fetch
更新Port安装目录文件 命令:portsnap extract update
五、安装Apache24
进入 /usr/ports/www/apache24/目录
安装,命令:make install clean
设置服务器地址 命令:ee /usr/local/etc/apache24/httpd.conf
修改www服务器地址 ServerName x.x.x.x:80(x.x.x.x用实际的ip地址代替 也可以像这样www)
修改开机启动文件,设置Apache24随开机启动,命令:ee /etc/rc.conf 
添加 apache24_enable="YES" 存盘启动。
安装完毕,默认网页目录: /usr/local/www/apache24/data/
Apache相关命令 启动 apachectl start 停止 apachectl stop 重启 apachectl restart
六、安装MySQL57
建议先于PHP安装MySQL,进入/usr/ports/databases/mysql57-server
安装 命令:make install clean
修改开机启动文件,设置MySQL随开机启动,命令:ee /etc/rc.conf
添加 mysql_enable="YES" 存盘启动。
七、安装php74
进入/usr/ports/lang/php74
安装 命令:make install clean
八、配置 Apache24和PHP74
进入/usr/ports/www/mod_php74
安装 命令:make install clean
修改配置文件 ee /usr/local/etc/apache24/httpd.conf
添加
DrectoryIndex index.html index.php
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
<⁄FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
<⁄FilesMatch>
编写入口文件index.php 内容为<?php phpinfo(); ?> 存盘重启 
通过服务器地址访问index.php
 复制配置文件 /usr/local/etc/php.ini-development 到 /usr/local/etc/php.ini 
九、配置PHP74和MySQL57
进入/usr/ports/lang/php74-extensions
安装 命令:make install clean
出现选择菜单时,选mysqli
访问index.php,如mysqli加载成功,即安装完成。

十. freebsd-update -r 13.1-RELEASE upgrade
假如升级发生错误,先执行如下两行再继续MySQL安装最终主程序。
user 'mysql' disappeared during update
/usr/sbin/pwd_mkdb -p /etc/master.passwd

allthe author other latest blog

comment (0 comments)

Website statistics|Archiver|Mobile|Show darkroom|Playmate Club

GMT+8, 2023-1-28 08:34 , Processed in 0.025763 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

return to top