使用Ubuntu16.04搭建CMS服务器

以此为笔记,方便后面查阅。

以下是正文。

注:使用root帐号或每条shell命令前加sudo.

1. 安装Ubuntu16.04版本。

2. 安装后,进入系统,打开终端,开始使用以下shell命令进行搭建。

3. apt-get update

4. apt-get upgrade -y

5. 添加ppa软件源:
  
    1).apt-get install -y python-software-properties
  
    2).apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 4F4EA0AAE5267A6C
  
    3).add-apt-repository -y ppa:ondrej/php
  
    4).apt-get update

6. 安装nginx:
  apt-get install -y nginx-full

7. 安装apt-get install -y mysql-server(默认版本为5.7):
  
    apt-get install -y mysql-server
  
    然后设置mysql root密码

8. 安装php5.6及依赖
  apt-get install -y php5.6-fpm php5.6-cli php5.6-phar php5.6-soap php5.6-gd php5.6-dom php5.6-mcrypt php5.6-zip php5.6-mysql php5.6-curl

9. 安装php zeromq
  apt-get install -y php-zmq 

10. 将git cms源版复制到/var/wwww
   cp -r /home/xxx/cms/delta/shared/cms/* /var/www
   chown -R www-data:www-data /var/www

11. 配置cms环境
   
    1).备份ngnix.conf
      mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old
   
    2).将当前目录conf文件夹中的nginx.conf覆盖到/etc/nginx/nginx.conf
      cp -f confs/nginx.conf /etc/nginx/nginx.conf
   
    3).将当前目录conf文件夹中的xibo_vhost_conf覆盖到/etc/nginx/sites-available/xibo_vhost_conf
      cp -f confs/xibo_vhost_conf /etc/nginx/sites-available/xibo_vhost_conf
   
    4). rm /etc/nginx/sites-enabled/*
   
    5). 链接该配置文件,使其真正生效
       ln -s /etc/nginx/sites-available/xibo_vhost_conf /etc/nginx/sites-enabled/xibo_vhost_conf
   
    6).nginx -t
   
    7).systemctl reload nginx
   
    8).备份php.ini文件
      mv /etc/php/5.6/fpm/php.ini /etc/php/5.6/fpm/php.ini.old
   
    9).将当前目录conf文件夹中的php.ini覆盖到/etc/php/5.6/fpm/php.ini
      cp -f confs/php.ini /etc/php/5.6/fpm/php.ini
   
    10).systemctl reload php5.6-fpm

14.输入http://localhost或http://ip进入cms,首次进入将出现安装界面


以下附上配置文件内容nginx.config

user www-data;
worker_processes auto;
pid /run/nginx.pid;
 
events {
      worker_connections 768;
      # multi_accept on;
}
 
http {
 
      ##
      # Basic Settings
      ##
 
      sendfile on;
      tcp_nopush on;
      tcp_nodelay on;
      keepalive_timeout 65;
      types_hash_max_size 2048;
      # server_tokens off;
 
      # server_names_hash_bucket_size 64;
      # server_name_in_redirect off;
 
      include /etc/nginx/mime.types;
      default_type application/octet-stream;
      client_max_body_size 256m;
 
      # fastcgi settings
      fastcgi_connect_timeout 300s;
      fastcgi_send_timeout 300s;
      fastcgi_read_timeout 300s;
      fastcgi_buffer_size 128k;
      fastcgi_buffers 8 128k;
 
 
      ##
      # SSL Settings
      ##
 
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
      ssl_prefer_server_ciphers on;
 
      ##
      # Logging Settings
      ##
 
      access_log /var/log/nginx/access.log;
      error_log /var/log/nginx/error.log;
 
      ##
      # Gzip Settings
      ##
 
      gzip on;
      gzip_disable "msie6";
 
      ##
      # Virtual Host Configs
      ##
 
      include /etc/nginx/conf.d/*.conf;
      include /etc/nginx/sites-enabled/*;
}
xibo_vhost_conf

server {
      listen 80 default_server;
      listen [::]:80 default_server;
 
      root /var/www/web;
 
      index index.php index.html index.htm;
 
      server_name _;
 
      location / {
        try_files $uri /index.php?$args;
      }
 
      location /api/authorize {
        try_files $uri /api/authorize/index.php?args;
      }
 
      location /api {
        try_files $uri /api/index.php?$args;
      }
 
      location /install {
        try_files $uri /install/index.php?$args;
      }
 
      location /maint {
        try_files $uri /maint/index.php?$args;
      }
 
      location /maintenance {
        try_files $uri /index.php?$args;
      }
 
      location ~ \.php$ {
        include snippets/fastcgi-php.conf;
 
        fastcgi_pass unix:/run/php/php5.6-fpm.sock;
      }
}

————————————————
版权声明:本文为CSDN博主「奔跑草-」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010690311/article/details/84819114

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值