lnmp网站

防火墙

sed -i '/SELINUX/s/enforcing/permissive/' /etc/selinux/config

setenforce 0

firewalld-cmd --set-default-zone=trusted

******************************************************************************

安装软件环境

yum install -y gcc openssl-devel  pcre-devel

tar -xvf nginx-1.12.2.tar.gz

cd nginx-1.21.2

,/configure --with-http_ssl_module  --with-http_stub_status_module

make && make install

yum install -y mariadb mariadb-server mariadb-devel

yum install -y php php-fpm php-mysql

******************************************************************************

开机启动

/usr/loacal/nginx/sbin/nginx 

echo "/usr/local/nginx/sbin/nginx" >> /etc/rc.local

chmod +x  /etc/rc.local

ss -anpt | grep :80

******************************************************************************

启动软件

systemctl enable --now mariadb

systemctl enable --now php-fpm

******************************************************************************

设置动静分离

vim /usr/local/nginx/conf/nginx.conf

location / {

                     root   html;

                     index  index.php  index.html   index.htm;

}

location / {

                root html;

                fastcgi_pass 127.0.0.1:9000;

                fastcgi_index index.php;

                include fastcgi.conf; 

}

/usr/local/nginx/sbin/nginx -s reload

*****************************************************************************

创建数据库和数据库用户

mysql

create database wordpress character set utf8mb4;

grant all  on wordpress.* to wordpress@"%" identified by "wordpress";

flush privileges;

exit

mysql -uwordpress -pwordpress -h 192.168.2.11 wordpress

*******************************************************************************

复制网站源码

yum install -y unzip

unizp wordpress.zip

cd wordpress

tar -xvf wordpress-5.0.3-zh_CN.tar.gz

cp -r wordpress/*  /usr/local/nginx/html/

chown -R apache.apache /usr/local/nginx/html/

 

posted @   蔷薇花盛开  阅读(49)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
点击右上角即可分享
微信分享提示