美文网首页
安装MathTex服务

安装MathTex服务

作者: pillarji | 来源:发表于2019-12-17 21:24 被阅读0次

    安装LeTax

    apt 或 iso安装

    • iso 文件可以从下下面的地址获取

    http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2015/

    • 挂载iso文件:

    mount -t iso9660 -o ro,loop,noauto /your/texlive2015.iso /mnt

    • 运行安装程序

    编译mathtex

    wget http://www.forkosh.com/mathtex.zip
    mkdir mathtex 
    cd mathtex 
    unzip ../mathtex.zip 
    cc mathtex.c –DLATEX=\\\"$(which latex)\\\" \\\ –DDVIPNG=\\\"$(which dvipng)\\\" –o mathtex.cgi
    cp mathtex.cgi /public_html/xxx.../cgi-bin/
    
    cc mathtex.c -DLATEX=\"$(which latex)\" -DDVIPNG=\"$(which dvipng)\" -o mathtex.cgi
    

    nginx配置

      apt-get install fcgiwrap
      cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf
    
    • 复制mathtex.cgi到cgi-bin目录下

      /usr/local/nginx/cgi-bin

    • 修改fcgiwrap.conf

        # Set the root to /usr/lib (inside this location this means that we are
        # giving access to the files under /usr/lib/cgi-bin)
        root  /usr/local/nginx;
      
        # Fastcgi socket
        fastcgi_pass  unix:/var/run/fcgiwrap.socket;
      
        # Fastcgi parameters, include the standard ones
        include /etc/nginx/fastcgi_params;
      
        # Adjust non standard parameters (SCRIPT_FILENAME)
        fastcgi_param SCRIPT_FILENAME  /usr/local/nginx/$fastcgi_script_name;
      
    • 在site配置文件的server单位添加(/etc/nginx/available-sites/default):

        include /etc/nginx/fcgiwrap.conf;
      

    测试

    在浏览器中访问: http://<your-address>/cgi-bin/mathtex.cgi?x^2+y^2

    相关文章

      网友评论

          本文标题:安装MathTex服务

          本文链接:https://www.haomeiwen.com/subject/sebenctx.html