zoukankan      html  css  js  c++  java
  • 网页代码阅读工具

    GNU GLOBAL 是一个源代码标记系统, 能够很方面的进行代码阅读和代码索引. 在你的源代码中,你可以找到不同的对象并能够很轻松的移动它们, 如函数、宏、结构、类等. 这对大型项目非常有用, 特别是那种包含许多子目录, 许多 #ifdef 和很多 main( ) 函数的项目.

    1、编译安装global

    通过如下网址下载源码包

    https://www.gnu.org/software/global/download.html

    安装编译所需的gcc,ncurses-devel 包等。然后解压tar.gz源码包,解压后,进入源码目录,执行如下进行编译。

    ./configure --with-sqlite3 # gtags可以使用Sqlite3作为数据库, 在编译时需要加这个参数
    make
    make install

    2、创建网页文件

    下载要阅读的代码,在代码目录下,执行gtags –v生成tag文件,如果之前已经生成过,可执行gtags -iv实现增量更新。执行htags命令,默认会在当前目录下生成HTML目录,该目录下存放HTML文件以及cgi-bin程序。

    htags -DfFnva -m "指定main函数的名称" -t '这里填入你想要的主页title'
    如:
    htags -DfFnva -m "main" -t 'kernel-4.19'

    3、搭建服务器

    yum 安装httpd,然后配置etc/httpd/conf/具体内容配置可以参考如下链接:

    https://blog.csdn.net/lcl_xiaowugui/article/details/78607093

    httpd的主配置文件为/etc/httpd/conf/httpd.conf,子目录配置文件为/etc/httpd/conf.d,我们现在在这个目录下面增加一个名为*.conf的文件,告诉httpd,html和cgi-bin对应的目录。对于配置文件我们只在conf.d目录下增加了如下内容的kernel.conf.

    <VirtualHost *:80>
        DocumentRoot /mnt/linux-4.19.2/HTML
        ServerName 9.xx.xx.xx:80
        <Directory "/mnt/linux-4.19.2/HTML">
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
        </Directory>
        ScriptAlias /cgi-bin/ "/mnt/linux-4.19.2/HTML/cgi-bin/"
        <Directory "/mnt/linux-4.19.2/HTML/cgi-bin">
            AllowOverride None
            Options None
            Require all granted
        </Directory>
    </VirtualHost>

    配置好后重启httpd服务,systemctl restart httpd。

    在浏览器中输入ip:端口号,就可以直接访问界面了,但是会出现403错误,告知用户无权限访问。我们把/mnt/linux-4.19.2/HTML这个目录的上级目录以及这个目录下面的文件权限都改为other可读就可以了。我改成了755权限,可以访问。

    另外也需要关闭防火墙和selinux。关闭防火墙: systemctl stop firewalld, 关闭selinux:http://blog.51cto.com/itchenyi/1032696

  • 相关阅读:
    LeetCode 965. Univalued Binary Tree
    LeetCode 961. N-Repeated Element in Size 2N Array
    LeetCode 832. Flipping an Image
    语法设计——基于LL(1)文法的预测分析表法
    简单的词法设计——DFA模拟程序
    LeetCode 905. Sort Array By Parity
    LeetCode 804. Unique Morse Code Words
    【原创】用事实说话,Firefox 的性能是 Chrome 的 2 倍,Edge 的 4 倍,IE11 的 6 倍!
    【新特性速递】新增单标签页模式,界面更加清爽!
    【新特性速递】重构表格列锁定代码,只有一个横向滚动条,更加现代化!
  • 原文地址:https://www.cnblogs.com/xingmuxin/p/10019532.html
Copyright © 2011-2022 走看看