首页 > 代码库 > LNMP之DISCUZ安装
LNMP之DISCUZ安装
LNMP 搭建起来后,安装DISUZ 操作记录
[root@LNMP ~]# mkdir /data/dis
[root@LNMP dis]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
[root@LNMP ~]# vim /usr/local/nginx/conf/nginx.conf #清空nginx.conf ,写入以下内容
user nobody nobody;
worker_processes 2;
error_log /usr/local/nginx/logs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 6000;
}
http
{
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 3526;
server_names_hash_max_size 4096;
log_format combined_realip ‘$remote_addr $http_x_forwarded_for [$time_local]‘
‘$host "$request_uri" $status‘
‘"$http_referer" "$http_user_agent"‘;
sendfile on;
tcp_nopush on;
keepalive_timeout 30;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
connection_pool_size 256;
client_header_buffer_size 1k;
large_client_header_buffers 8 4k;
request_pool_size 4k;
output_buffers 4 32k;
postpone_output 1460;
client_max_body_size 10m;
client_body_buffer_size 256k;
client_body_temp_path /usr/local/nginx/client_body_temp;
proxy_temp_path /usr/local/nginx/proxy_temp;
fastcgi_temp_path /usr/local/nginx/fastcgi_temp;
fastcgi_intercept_errors on;
tcp_nodelay on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 8k;
gzip_comp_level 5;
gzip_http_version 1.1;
gzip_types text/plain application/x-javascript text/css text/htm application/xml;
server
{
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /usr/local/nginx/html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
}
}
}
--------------------------------分割线----------------------------------------
将discuz 的安装到 /usr/local/nginx/html 目录下
[root@LNMP ~]# vim /usr/local/nginx/conf/vhosts/linux.com
server
{
listen 80;
server_name www.linux.com;
index index.html index.htm index.php;
root /data/dis;
location ~ \.php$ {
include fastcgi_params;
#fastcgi_pass unix:/tmp/dis.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/dis$fastcgi_script_name;
}
}
————————分割线---------------------------------------
在 c:\Windows\System32\drivers\etc 绑定 IP & 网址
192.168.31.165 www.linux.com
同意安装后我们看多好多都是不可写,这时我们就要给他们赋予php-fpm用户权限。
---------------------------------------------
[root@LNMP ~]# cd /usr/local/nginx/html/ #进入到目录下
[root@LNMP html]# chown -R php-fpm config data uc_client uc_server #赋权
赋权后状状查看
drwxr-xr-x 2 php-fpm root 4096 Nov 18 07:34 config
drwxr-xr-x 13 php-fpm root 4096 Nov 18 07:34 data
drwxr-xr-x 6 php-fpm root 4096 Nov 17 22:34 uc_client
drwxr-xr-x 13 php-fpm root 4096 Nov 17 22:34 uc_server
----------------------------------------------
再新刷新网页,状态全部变成可写。接着进行下一步打操作。
选择全新安装
接下来是设置 mysql,我们每次用自已安装的myqls
需要输入 /usr/local/mysql/bin/mysql,而不能直接输入mysql ,
那么我们就需更改 PATH
下来是设置 mysql,我们每次用自已安装的myqls
需要输入 /usr/local/mysql/bin/mysql,而不能直接输入mysql ,
那么我们就需更改 PATH
[root@OBird www]# which mysql (mysql不是/usr/local/mysql/bin/mysql,注意区分)
/usr/bin/mysql (系统自带的mysql)
用以下命令查找到系统自带的mysql,然后卸载,如果不卸载会和安装的mysql冲突。因为楼主已经卸载过,所以没有截图。
[root@OBird www]# rpm -qf /usr/local/mysql
file /usr/local/mysql is not owned by any package
编写一个path.sh 的脚本,创建mysql 快捷使用方式
[root@OBird www]# vim /etc/profile.d/path.sh
#!/bin/bash
export PATH=$PATH:/usr/local/mysql/bin
[root@OBird www]# source /etc/profile.d/path.sh
然后就可以使用了。
首先创建一个库
[root@OBird ~]# mysql
mysql> create database discuz;
Query OK, 1 row affected (0.20 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
mysql> grant all on discuz.* to ‘linux‘@‘localhost‘ identified by ‘linux‘;
Query OK, 0 rows affected (0.16 sec)
数据库名:discuz ;数据库名:linux PS:linux
管理员admin ps :123456
以下是访问界面:
本文出自 “CBO#Boy_Linux之路” 博客,请务必保留此出处http://20151213start.blog.51cto.com/9472657/1874094
LNMP之DISCUZ安装