AdultVideoScript7.0搭建教程

AVS环境要求

  • PHP:建议版本5.6,虽然官方说7.0完全支持PHP7了,但是实际上并不是如此。所以如果不想踩坑,还是老老实实用5.6吧。
  • MYSQL
  • Nginx/Apache
  • 官方文档
    • Linux Server
    • Apache Web Server
      • Support for AcceptPathInfo
      • Support for MultiViews (or mod_rewrite which is slower)
    • MySQL / MySQLi
    • PHP 5.x / 7.x (mod_php/CGI)
      • Support for GD2 Library
      • Support for MySQL / MySQLi
      • Support for Curl
    • Recommended PHP Configuration
      • safe_mode off
      • open_basedir off
      • max_execution_time 7200
      • max_input_time 7200
      • memory_limit (with 1MB more then the maximum video upload size)
      • post_max_size (maximum video upload size)
      • upload_max_size (maximum video upload size)
      • exec() should be allowed
    • PHP CLI 5.x (see above + register_argc_argv ON)
    • FFmpeg (Recommended Version: 3+)

环境配置

  • 一台干净的Ubuntu服务器
  • 安装宝塔

    1
    2
    3
    wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh
    # 完成后打开管理页面:http://ip:8888
    # 安装AVS的环境:PHP5.6、Mysql、Nginx(建议使用)、phpmyadmin
  • 安装视频插件ffmpeg,官方推荐3.x版本

    1
    2
    3
    4
    5
    6
    cd
    wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-3.3.4-64bit-static.tar.xz
    tar -xJf ffmpeg-3.3.4-64bit-static.tar.xz
    cd ffmpeg-3.3.4-64bit-static
    cp ffmpeg /usr/bin
    cp ffprobe /usr/bin
  • 下载好AVS代码,根据AVS环境文档配置

安装网站

  • 在宝塔后台建立一个网站,点击网站=>添加站点,按要求添加,其中建立数据库avs7,记录好相应的账号密码
  • 在此站点下增加伪动态配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    location / {
    if (!-f $request_filename){
    set $rule_1 1$rule_1;
    }
    if (!-d $request_filename){
    set $rule_1 2$rule_1;
    }
    if ($rule_1 = "21"){
    rewrite /.* /loader.php last;
    }
    }
  • 导入avs的sql脚本sql/avs.sql

    1
    2
    3
    mysql -u root -p
    mysql>use avs7
    mysql>source sql/avs.sql
  • 源码修改,源码在upload目录,按以下要求修改

    1. Edit include/config.paths.php and set $config[‘BASE_URL’] to your site’s url.
    2. OPTIONAL: If you use a subdirectory for your installion set $config[‘RELATIVE’] to your subdirectory (eg: $config[‘RELATIVE’] = ‘/subdirectory’)!
    3. OPTIONAL: If you use a subdirectory for your installation edit loader.php and set $relative to your subdirectory (eg: $relative = ‘/subdirectory’)!
    4. Create a database. Edit include/config.db.php and set the database information (name, user and password).
    5. Import the sql dump from sql/avs.sql in your database (most likely using phpMyAdmin).
    6. Upload all files and folders from /upload to your server.
    7. Chmod following files and directories to 0777. You can also fix the file/directory permissions from the admin panel: Settings > General > System Check

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      /include/config.local.php
      /cache/frontend
      /cache/backend
      /images/logo
      /images/notice_images
      /images/notice_images/thumbs
      /media/albums
      /media/categories/game
      /media/categories/album
      /media/categories/video
      /media/csv
      /media/games/swf
      /media/games/tmb
      /media/games/tmb/orig
      /media/photos
      /media/photos/tmb
      /media/player/logo
      /media/users
      /media/users/orig
      /media/videos/tmb
      /media/videos/vid
      /media/videos/h264
      /templates/backend/default/analytics/analytics.tpl
      /templates/emails
      /templates/emails/*.tpl
      /templates/frontend/(your_template)/static/*.tpl
      /tmp/albums
      /tmp/avatars
      /tmp/downloads
      /tmp/logs
      /tmp/sessions
      /tmp/thumbs
      /tmp/uploader
      /aembed.sh
    8. Go to www.domain.com/siteadmin (login using: admin/admin) and start configuring your website.

    9. You can use the Google Video Sitemap generator using the link: http://www.yourdomain.com/sitemap.php
    10. Enable non-www to www redirection (domain.com to www.domain.com) by editing the .htaccess file and replacing “domain.com” with your domain name.
  • 访问站点
    后台地址http://xx.com/siteadmin,用户名和密钥都是admin,进入后咱们访问Settings-General-System Check,检查环境能否满意。

其他