vim /usr/local/nginx/conf/nginx.conf
mkdir -p /usr/local/nginx/conf/vhosts
cd /usr/local/nginx/conf/vhosts/
vim test.conf
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
server { listen 80 default; index index.html index.htm index.php; root /discuz; location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/tmp/php-fcgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /discuz$fastcgi_script_name; } }
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -s reload
cat /usr/local/nginx/logs/nginx_error.log
不存在/tmp.www.sock,换一个存在的
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
server { listen 80; server_name www.hyit.com; index index.html index.htm index.php; root /data/www; location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/tmp/php-fcgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name; } }
![](https://i-blog.csdnimg.cn/blog_migrate/3afb1b496e4cd401bb57300662945e0d.png)
vim /usr/local/php/etc/php-fpm.conf
cd /discuz
chown -R php-fpm data uc_server/data/ uc_client/data config
vim /etc/profile.d/path.sh
source /etc/profile
create database discuz;
grant all on discuz.* to 'hy'@'localhost' identified by '062417';