在Arch Linux上使用Makepkg
在Arch Linux上使用Makepkg可以避免系统污染,确保仅安装必要的依赖关系。
OpenBSD主要用于防火墙实现中,但是,世界各地许多人都在使用OpenBSD作为Web服务器。这包括程序员和系统管理员。我们假定一般具有OpenBSD,Nginx和Unix的知识。
Nginx(引擎x)是由Igor Sysoev编写的HTTP和反向代理服务器以及邮件代理服务器。长期以来,它已在许多负载较重的俄罗斯站点上运行。(从他们的网站)
PHP-FPM(FastCGI流程管理器)是另一种PHP FastCGI实现,具有一些其他功能,可用于各种规模的站点,尤其是繁忙的站点。(从他们的网站)
PKG_PATH = ftp://ftp.openbsd.org/pub/OpenBSD/5.6/packages/\`arch -s\`
$ sudo pkg_add -v nginx
Ambiguous: choose package for nginx
a 0: <None>
1: nginx-1.4.7p0
2: nginx-1.4.7p0-lua
3: nginx-1.4.7p0-naxsi
4: nginx-1.4.7p0-passenger
5: nginx-1.5.7p3
6: nginx-1.5.7p3-lua
7: nginx-1.5.7p3-naxsi
8: nginx-1.5.7p3-passenger
Your choice:
就本文档而言,我们安装“ 5”选项。
$ sudo pkg_add -v php-fpm-5.5.14.tgz
在/etc/rc.conf.local必须包含以下内容:
nginx_flags=""
并且/etc/rc.conf必须包含以下内容,这些服务才能在每次重新启动后自动启动。
# rc.d(8) packages scripts
# started in the specified order and stopped in reverse order
pkg_scripts=nginx
为基本要求/etc/nginx/nginx.conf的服务器部分。
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
在中更新以下内容/etc/php-fpm.conf:
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's
; group will be used.
user = www
group = www
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
$ sudo pkg_add -v mysql-server-5.1.73p0v0.tgz
Update candidates: quirks-2.9 -> quirks-2.9 (ok)
quirks-2.9 signed on 2014-07-31T22:37:55Z
mysql-server-5.1.73p0v0:p5-Net-Daemon-0.48: ok
mysql-server-5.1.73p0v0:p5-PlRPC-0.2018p1: ok
mysql-server-5.1.73p0v0:p5-Clone-0.36p0: ok
mysql-server-5.1.73p0v0:p5-Params-Util-1.07p0: ok
mysql-server-5.1.73p0v0:p5-SQL-Statement-1.405: ok
mysql-server-5.1.73p0v0:p5-FreezeThaw-0.5001: ok
mysql-server-5.1.73p0v0:p5-MLDBM-2.05: ok
mysql-server-5.1.73p0v0:p5-DBI-1.631p0: ok
mysql-server-5.1.73p0v0:mysql-client-5.1.73v0: ok
mysql-server-5.1.73p0v0:p5-DBD-mysql-4.027: ok
mysql-server-5.1.73p0v0: ok
The following new rcscripts were installed: /etc/rc.d/mysqld
See rc.d(8) for details.
Look in /usr/local/share/doc/pkg-readmes for extra documentation.
Extracted 39040357 from 39044890
创建初始数据库:
$ sudo /usr/local/bin/mysql_install_db
您可以运行/usr/local/bin/mysql_secure_installation脚本来优化MySQL安装。否则,直接设置root密码。
$ sudo /usr/local/bin/mysqladmin -u root password 'password'
要访问MySQL以执行管理任务-例如创建数据库和用户,可以使用以下命令:
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 5.1.73-log OpenBSD port: mysql-server-5.1.73p0v0
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
$ sudo pkg_add -v php-pdo_mysql-5.5.14.tgz
$ sudo /etc/rc.d/nginx start
$ sudo /etc/rc.d/php-fpm start
$ sudo /etc/rc.d/mysqld start
通过将基本info.php文件写入文档根目录来测试安装/var/www/htdocs/example.com。
<?php
phpinfo();
?>
成功后,您将能够查看PHP信息网页。
基本日志文件位于/var/log/nginx目录中。
请享用。
在Arch Linux上使用Makepkg可以避免系统污染,确保仅安装必要的依赖关系。
快速学习如何在Ubuntu 16.04上安装OpenSIPS控制面板,为VoIP提供商提供支持的功能。
学习如何在Fedora 28上安装Akaunting,一款适合小型企业和自由职业者的开源会计软件。
使用其他系统?Mailtrain是一个基于Node.js和MySQL / MariaDB构建的开源自托管新闻通讯应用程序。
了解導致Minecraft延遲的原因和解決方案,包括優化伺服器性能和減少滯後的步驟。
勒索軟件攻擊呈上升趨勢,但人工智能能否幫助應對最新的計算機病毒?AI 是答案嗎?在這裡閱讀知道是 AI 布恩還是禍根
ReactOS,一個開源和免費的操作系統,這裡有最新版本。它能否滿足現代 Windows 用戶的需求並打倒微軟?讓我們更多地了解這種老式但更新的操作系統體驗。
Whatsapp 終於為 Mac 和 Windows 用戶推出了桌面應用程序。現在您可以輕鬆地從 Windows 或 Mac 訪問 Whatsapp。適用於 Windows 8+ 和 Mac OS 10.9+
閱讀本文以了解人工智能如何在小型公司中變得流行,以及它如何增加使它們成長並為競爭對手提供優勢的可能性。
最近,Apple 發布了 macOS Catalina 10.15.4 補充更新以修復問題,但似乎該更新引起了更多問題,導致 mac 機器變磚。閱讀這篇文章以了解更多信息