編號 | 軟件 | 版本 |
1 | Centos | 7 |
2 | nginx | 1.175 |
3 | mysql | 5.7 |
4 | php | 7.5 |
PS:操做系統屬於最小化安裝,全部操做均屬於在線操做,但也能夠用離線操做進行替換;全部的部署操做皆按照下述操做實施。而且我在機器上面部署了ss,用來作http及https的代理請求,由於我家裏的網絡皆這些開源官網實在太卡了php
sed -i 's/enforcing/disabled/' /etc/selinux/config rpm -qa | grep "firewall" | xargs rpm -e --nodeps rpm -qa | grep "iptables" | xargs rpm -e --nodeps sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config systemctl restart sshd reboot
https://www.cnblogs.com/guge-94/p/11363303.html
https://www.cnblogs.com/guge-94/p/10552374.html
yum -y install libxml2 libxml2-devel openssl openssl-devel zlib zlib-devel pcre pcre-devel wget https://www.php.net/distributions/php-7.3.11.tar.gz -P /opt/ tar -zxf /opt/php-7.3.11.tar.gz -C /opt/ cd /opt/php-7.3.11 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-bcmath --enable-shmop --enable-ftp --with-openssl make -j8 && make install make test # 這個測試過程格外的漫長,可選擇執行;主要用來測試編譯的結果 # 生成配置文件 PS:源碼編譯安裝中包含fpm的代碼,可是yum安裝或者在線安裝是須要單獨指定 cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp /opt/php-7.3.11/php.ini-production /usr/local/php/etc/php.ini cp /opt/php-7.3.11/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf # 基本配置 chmod a+x /etc/init.d/php-fpm groupadd www useradd -s /sbin/nologin -g www -M www /etc/init.d/php-fpm start ln -s /usr/local/php/bin/* /usr/bin/ ln -s /usr/local/php/sbin/* /usr/sbin/
PS:我這裏並無像網上那樣,安裝lnmp或者lamp環境的時候,搞上一大堆插件;其一通常人並不知道全部插件的功能,依賴插件或者擴展庫的功能得根據相應的業務場景來定,其二我這裏只是實驗,若是後續你想添加任何插件,請在文章的基礎之上作添加html
https://www.cnblogs.com/guge-94/p/11758498.html
mkdir -p /data/www cat /data/www/index.php
# 寫一個簡單的php檢測一下整個lnmp環境 <html> <head> <title>PHP 測試</title> </head> <body> <?php echo '<p>Hello World!</p>'; ?> </body> </html> cat /etc/nginx/nginx.conf
# 這是一份關於nginx的基礎配置,如需自行優化可在這個基礎上進行優化 user www www; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; index index.php index.html index.htm; root /data/www; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } } chown -R www.www /data/www nginx -t nginx -s reload
上面的操做完成以後經過瀏覽器或curl請求一下主機地址便可java