首先我们打算用源码安装NGINX
1.安装Nginx依赖包
yum-yinstall zlib-devel openssl-devel pcre-develgccgcc-c++lrzsz
2.上传源码包并查看
ls
nginx-1.4.7.tar_(1).gz
3.编译环境并安装
tar zxf nginx-1.4.7.tar_\(1\).gz
cdnginx-1.4.7
./configure
make&&makeinstall
nginx到这安装完毕
4.php安装
yum-yinstall php-mysql php-gd php php-fpm
5.mysql安装
yum -y install mariadb-server
6.配置NGINX
vim /usr/local/nginx/conf/nginx.conf
location / {
root html;
index index.html index.htm index.php;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
7.创建数据库
systemctl start mariadb
systemctl enable mariadb
mysqladmin -uroot password 123456
mysql -uroot -p123456
MariaDB [(none)]> create database lt;
8.配置NGINX网页目录
cd /usr/local/nginx/html/
unzip Discuz_X3.3_SC_UTF8.zip
chmod -R 777 upload/*
9.开启服务
systemctl start php-fpm
/usr/local/nginx/sbin/nginx
网友评论