OpenGL的官方文档可以在线看,不过有时我们可能需要离线,尤其是当网络不稳定的时候。
文档的下载地址在这里,
https://github.com/KhronosGroup/OpenGL-Refpages
git clone https://github.com/KhronosGroup/OpenGL-Refpages.git
down下来之后,进入文件夹,发现目录下面index.php,也就意味着文档都是php格式的。因此我们需要一个Php服务器才能阅读这些文档。
当然你可以直接下载配置php;不过我更习惯使用xampp,到这里去下载,
Download XAMPPDownload XAMPP for Windows, Linux, and OS X. Older versions of Solaris are also available.https://www.apachefriends.org/download.html现在最新版是8.1.6,下载完后直接找个地方安装即可。
我的安装目录是D:/xampp
然后启动xampp control panel,找到Apache的config,httpd.conf,如下,
然后在<Directory "D:/xampp/htdocs">后面添加下面的文字,就是
<Directory "E:/dev_programming/openGL/khronos_GLSL/OpenGL-Refpages">
这一段,如下,
DocumentRoot "D:/xampp/htdocs"
<Directory "D:/xampp/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
<Directory "E:/dev_programming/openGL/khronos_GLSL/OpenGL-Refpages">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
接下来,还在添加下面这个配置,
Alias /opengldocs "E:/dev_programming/openGL/khronos_GLSL/OpenGL-Refpages"
其中opengldocs是你要访问的名称,可以随便取,后面会用到,如下,
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "D:/xampp/cgi-bin/"
Alias /opengldocs "E:/dev_programming/openGL/khronos_GLSL/OpenGL-Refpages"
</IfModule>
配置好后,启动服务器就可以了,如下,
然后,启动浏览器,在地址栏输入:
http://localhost/opengldocs/
然后,你就可以看到opengl的官方文档了,如下图所示,
本文结束。
参考资料附录:
来源:https://blog.csdn.net/tsyccnh/article/details/51188925
XAMPP环境下,如何将项目目录设置在任意位置且不影响htdocs内的文件访问
xampp默认的网站目录为/xampp/htdocs,访问localhost就可以访问这给文件夹下的文件。但有时为了项目管理方便,不可能所有文件都放在这里。下面是一个简单的利用别名(Alias)的方法来实现其他目录下项目访问。
1. 首先打开Apache的设置文件httpd.conf 位置在 E:\xampp\apache\conf
2. 搜索 <Directory “E:/xampp/htdocs”> 定位到这个位置,大约在245行
3. 复制<Directory “E:/xampp/htdocs”>到</Directory>的所有文本,包括这两个标记
粘贴到下面,然后将标记改为你的目录,如<Directory “C:/myapp”>
4. 定位到<IfModule alias_module>位置,大约363行,在这里面添加Alias /myapp "C:/myapp"
5. 重启Apache,访问http://localhost/myapp 就可以了
参考
http://stackoverflow.com/questions/1408/make-xampp-apache-serve-file-outside-of-htdocs#2471