Difference between pages "Package:Apache" and "Package:Eselect (OpenGL)"

(Difference between pages)
 
 
Line 1: Line 1:
 
{{Ebuild
 
{{Ebuild
|Summary=The Apache Web Server
+
|Summary=A Gentoo/Funtoo utility that allows the active OpenGL implementation on a system to be switched between a variety of installed options.
|CatPkg=www-servers/apache
+
|CatPkg=app-admin/eselect-opengl
|Maintainer=polynomial-c@gentoo.org
+
|Maintainer=
|Homepage=http://httpd.apache.org/
+
 
}}
 
}}
Apache is a powerful web server which serves html/css/cgi/pl out of the box, and can serve other languages/frameworks via extensions.
+
== Introduction ==
  
The [http://httpd.apache.org/ Apache Homepage] says this of Apache:
+
Eselect (OpenGL) (also called <tt>eselect-opengl</tt>) is a module for [[Package:Eselect|Eselect]] that allows the OpenGL implementation on a Funtoo Linux or Gentoo Linux system to be switched between a variety of installed OpenGL implementations. It functions by creating an <tt>env.d</tt> file at <tt>/etc/env.d/03opengl</tt> which contains OpenGL settings, as well as managing symbolic links to OpenGL libraries and headers.
  
<blockquote>
+
=== Sample env.d File ===
The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
+
</blockquote>
+
  
== Install ==
+
A sample <tt>env.d</tt> file for a multilib system with xorg-x11 OpenGL implementation may look like this:
=== USE Flags ===
+
{| class="wikitable" style="margin: 1em auto;" width=80%
+
! width="20%" | Use flag
+
! width="10%" | Default
+
! width="10%" | Recommended
+
! width="60%" | Description
+
|-
+
| style="text-align: center;" | debug
+
| style="text-align: center;" | No
+
| style="text-align: center; background-color: red;" | No
+
| style="text-align: center;" | Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml.
+
|-
+
| style="text-align: center;" | doc
+
| style="text-align: center;" | No
+
| style="text-align: center;" |
+
| style="text-align: center;" |  Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
+
|-
+
| style="text-align: center;" | ldap
+
| style="text-align: center;" | No
+
| style="text-align: center;" |
+
| style="text-align: center;" | Add LDAP support (Lightweight Directory Access Protocol).
+
|-
+
| style="text-align: center;" | selinux
+
| style="text-align: center;" | No
+
| style="text-align: center; background-color: yellow" | No, unless selected by default.
+
| style="text-align: center;" | !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
+
|-
+
| style="text-align: center;" | ssl
+
| style="text-align: center;" | Yes
+
| style="text-align: center;" |
+
| style="text-align: center;" | Add support for Secure Socket Layer connections.
+
|-
+
| style="text-align: center;" | static
+
| style="text-align: center;" | No
+
| style="text-align: center;" |
+
| style="text-align: center;" | !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically.
+
|-
+
| style="text-align: center;" | threads
+
| style="text-align: center;" | No
+
| style="text-align: center;" |
+
| style="text-align: center;" | Add threads support for various packages. Usually pthreads.
+
|}
+
  
If you want to enable any of the above use flags, create a file called <tt>/etc/portage/package.use/apache</tt> and add the options that you want to enable to it. For example:
+
{{file|name=/etc/env.d/03opengl|desc=An example env.d file for eselect-opengl|body=
{{file|name=/etc/portage/package.use/apache|desc= |body=
+
# Configuration file for eselect
www-servers/apache ssl threads
+
# This file has been automatically generated.
 +
LDPATH="/usr/lib32/opengl/xorg-x11/lib:/usr/lib64/opengl/xorg-x11/lib"
 +
OPENGL_PROFILE="xorg-x11"
 
}}
 
}}
  
=== Emerge ===
+
== Implementation ==
After you have configured the USE flags that you want to build Apache with, emerge it:
+
<console>###i## emerge apache</console>
+
  
== Configuration ==
+
Eselect-opengl is implemented as a single bash-based [[Package:Eselect|Eselect]] module approximately 10K in size, installed at <tt>/usr/share/eselect/modules/opengl.eselect</tt>. One interfaces with this module via the main <tt>eselect</tt> command:
=== System ===
+
Many packages have apache2 use flags. These use flags are often required for an application to be supported by Apache. Setting a system wide apache2 use flag is a good idea.
+
  
{{file|name=/etc/portage/make.conf|desc=set system wide apache2 useflag|body=
+
<console>
USE="...,apache2,..."
+
# ##i##eselect opengl help
}}
+
Manage the OpenGL implementation used by your system
 +
Usage: eselect opengl <action> <options>
  
=== Package ===
+
##g##Standard actions:
Apache's configuration files are broken up and located in several spots.
+
  help                      Display help text
*<code>/etc/conf.d/apache2</code>
+
  usage                    Display usage information
*<code>/etc/apache2/httpd.conf</code>
+
  version                  Display version information
*<code>/etc/apache2/modules.d/*</code>
+
*<code>/etc/apache2/vhosts.d/*</code>
+
  
<code>conf.d</code> controls the init script, adding things to it such as -D SECURITY & -D PHP5 will enable web application fire-walling & the php scripting language.
+
##g##Extra actions:
 +
  list                      List the available OpenGL implementations.
 +
  set <target>             Select the OpenGL implementation.
 +
    <target>                  The profile to activate
 +
    --use-old                If an implementation is already set, use that one instead
 +
    --prefix=<val>            Set the source prefix (default: /usr)
 +
    --dst-prefix=<val>       Set the destination prefix (default: /usr)
 +
    --ignore-missing          Ignore missing files when setting a new implementation
 +
  show                      Print the current OpenGL implementation.
 +
</console>
  
<code>httpd.conf</code> controls how the server behaves, at the bottom of the file it has directives to include configuration files ending in .conf in <code>/etc/apache2/modules.d</code> and <code>/etc/apache2/vhosts.d</code>
+
== What is Switched ==
  
== Service ==
+
Using <tt>eselect opengl set</tt> causes the following symbolic links to be updated to point to the files corresponding to the OpenGL implementation that you chose:
  
To start apache immediately:
+
* ''Libraries'' (32-bit and 64-bit):
<console>
+
** <tt>/usr/lib(64)/libGL.so.*</tt>
###i## rc-service apache2 start
+
** <tt>/usr/lib(64)/libEGL.so.*</tt>
</console>
+
** <tt>/usr/lib/(32|64|)/libGLESv1.so.*</tt>
 +
** <tt>/usr/lib/(32|64|)/libGLESv2.so.*</tt>
 +
* ''C Headers'':
 +
** <tt>/usr/include/GL/*</tt>
 +
** <tt>/usr/include/EGL/*</tt>
 +
** <tt>/usr/include/KHR/*</tt>
 +
* <tt>/usr/lib(64|)/xorg/modules/extensions/libglx.so</tt>
  
To start apache upon boot:
+
The symbolic links point to an installed OpenGL implementation, stored inside <tt>/usr/lib(32|64|)/opengl/(implementation-name)</tt>. These files are structured as follows:
<console>
+
###i## rc-update add apache2
+
</console>
+
  
== mod_rewrite ==
+
* <tt>/usr/lib/opengl/(implementation-name)/lib</tt>
=== What is <code>mod_rewrite</code>? ===
+
* <tt>/usr/lib/opengl/(implementation-name)/include/(GL|EGL|KHR)</tt>
The [http://httpd.apache.org/docs/current/mod/mod_rewrite.html Apache documentation] describes <code>mod_rewrite</code> as:
+
* <tt>/usr/lib/opengl/(implementation-name)/extensions/libglx.so</tt>
  
<blockquote>
+
On multilib systems, ebuilds that provide an OpenGL implementation install 32-bit libraries in <tt>/usr/lib32/opengl/(implementation name)/lib</tt> and 64-bit libraries in <tt>/usr/lib64/opengl/(implementation name)/lib</tt>.
The mod_rewrite module uses a rule-based rewriting engine, based on a PCRE regular-expression parser, to rewrite requested URLs on the fly. By default, mod_rewrite maps a URL to a filesystem path. However, it can also be used to redirect one URL to another URL, or to invoke an internal proxy fetch.
+
</blockquote>
+
  
=== Setting it up ===
+
== Criticisms ==
mod_rewrite has a reputation of being difficult to set up.  mod_rewrite requires following symlinks & Order allow,deny (apache 2.2) or Require all granted (apache 2.4) is set.  To test functionality of mod_rewrite we will need to make a few files.
+
  
{{fancynote|If you want to test this for web applications such as mediawiki adjust the path to /var/www/localhost/htdocs/mediawiki/.htaccess & so on}}
+
=== Violation of Build Consistency ===
  
{{file|name=/var/www/localhost/htdocs/.htaccess|desc=enable the rewrite engine|body=
+
As documented in {{Bug|FL-1309}}, sometimes packages fail to merge when the "wrong" eselect opengl implementation is selected. This violates Portage's ability to consistently build a package from source, assuming all its dependencies are satisfied. This could be classified as a design bug -- eselect-opengl is functioning as intended, but its underlying theory of operation is not correct.
RewriteEngine on
+
RewriteRule ^test.html$ rewrite.html
+
}}
+
  
{{file|name=/var/www/localhost/htdocs/test.html|desc=set system wide apache2 useflag|body=
+
== eselect-opengl-1.3* experiment ==
rewrite is not working
+
}}
+
  
{{file|name=/var/www/localhost/htdocs/rewrite.html|desc=set system wide apache2 useflag|body=
+
=== Introduction ===
rewrite is working
+
 
}}
+
As a result of {{Bug|FL-1309}}, an experimental solution was implemented in eselect-opengl-1.3*. With this version, all packages are built unconditionally against xorg-x11 OpenGL implementation and the other implementations are used only in runtime.
 +
 
 +
The rationale for this design change is that:
 +
# There should be a consistent and repeatable build/linking process for all OpenGL applications.
 +
# AMD and NVIDIA implementations of OpenGL are designed to be more of a "drop-in" runtime replacement for xorg-x11, rather than a standalone replacement for xorg-x11, and thus appear to exhibit more build-time bugs.
 +
 
 +
=== Implementation ===
 +
 
 +
The new version of eselect-opengl switched two files:
 +
* an env.d file <tt>000opengl</tt> specifying <tt>LDPATH</tt> for the run-time implementation override,
 +
* an xorg.conf.d file overriding the ModulePath for custom glx xorg modules.
 +
 
 +
The env.d file has the same contents as the original one, except that the name was changed to ensure that the additional linker paths are added before the system paths where xorg-x11 libraries are installed.
 +
 
 +
The xorg.conf.d sets ModulePaths for non-xorg module replacements (such as the nvidia glx module), if necessary.
 +
 
 +
=== Issues ===
 +
 
 +
The widespread testing of eselect-opengl-1.3* has proven some issues with the new design:
  
Then point your browser to http://127.0.0.1/test.html. You should see that the text from rewrite.html has been loaded.
+
# xorg-server is unable to handle multiple occurences of <code>Files</code> section gracefully. Therefore, eselect-opengl's generated xorg.conf.d file collides with many user-defined configurations. This has been patched locally and the patch is awaiting upstream review)
 +
# There are rumors of arm mali's prioprietary OpenGL implementations requiring applications to be built against its own GLES headers.
  
 
{{EbuildFooter}}
 
{{EbuildFooter}}

Latest revision as of 08:00, March 1, 2015

app-admin/eselect-opengl


Source Repository:Repository:Gentoo Portage Tree


Summary: A Gentoo/Funtoo utility that allows the active OpenGL implementation on a system to be switched between a variety of installed options.


News

Drobbins

IP Space Migration Continues

All Funtoo user containers in the 8.28 IP space will be moving into our new IP space (172.97) over the next few days. If you have DNS set up -- be sure to watch your container and update to the new IP! container.host.funtoo.org DNS will be updated after the move.
2015-08-27 by Drobbins
Drobbins

Funtoo Hosting IP Move

Funtoo user containers with IPs in the 72.18.x.x range will be gradually migrating to new IP addresses this week. If you have DNS entries for your containers, please be aware that your DNS will need to be updated.
2015-08-11 by Drobbins
Drobbins

New ARM Stages

New ARM Stages, built with a new toolchain, are now hitting mirrors. Existing ARM users should re-install using these stages (dated Aug 3, 2015 or later,) rather than upgrade using emerge.
2015-08-06 by Drobbins
More...

Eselect (OpenGL)

Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Introduction

Eselect (OpenGL) (also called eselect-opengl) is a module for Eselect that allows the OpenGL implementation on a Funtoo Linux or Gentoo Linux system to be switched between a variety of installed OpenGL implementations. It functions by creating an env.d file at /etc/env.d/03opengl which contains OpenGL settings, as well as managing symbolic links to OpenGL libraries and headers.

Sample env.d File

A sample env.d file for a multilib system with xorg-x11 OpenGL implementation may look like this:

/etc/env.d/03opengl - An example env.d file for eselect-opengl
# Configuration file for eselect
# This file has been automatically generated.
LDPATH="/usr/lib32/opengl/xorg-x11/lib:/usr/lib64/opengl/xorg-x11/lib"
OPENGL_PROFILE="xorg-x11"

Implementation

Eselect-opengl is implemented as a single bash-based Eselect module approximately 10K in size, installed at /usr/share/eselect/modules/opengl.eselect. One interfaces with this module via the main eselect command:

# eselect opengl help
Manage the OpenGL implementation used by your system
Usage: eselect opengl <action> <options>

Standard actions:
  help                      Display help text
  usage                     Display usage information
  version                   Display version information

Extra actions:
  list                      List the available OpenGL implementations.
  set <target>              Select the OpenGL implementation.
    <target>                  The profile to activate
    --use-old                 If an implementation is already set, use that one instead
    --prefix=<val>            Set the source prefix (default: /usr)
    --dst-prefix=<val>        Set the destination prefix (default: /usr)
    --ignore-missing          Ignore missing files when setting a new implementation
  show                      Print the current OpenGL implementation.

What is Switched

Using eselect opengl set causes the following symbolic links to be updated to point to the files corresponding to the OpenGL implementation that you chose:

  • Libraries (32-bit and 64-bit):
    • /usr/lib(64)/libGL.so.*
    • /usr/lib(64)/libEGL.so.*
    • /usr/lib/(32|64|)/libGLESv1.so.*
    • /usr/lib/(32|64|)/libGLESv2.so.*
  • C Headers:
    • /usr/include/GL/*
    • /usr/include/EGL/*
    • /usr/include/KHR/*
  • /usr/lib(64|)/xorg/modules/extensions/libglx.so

The symbolic links point to an installed OpenGL implementation, stored inside /usr/lib(32|64|)/opengl/(implementation-name). These files are structured as follows:

  • /usr/lib/opengl/(implementation-name)/lib
  • /usr/lib/opengl/(implementation-name)/include/(GL|EGL|KHR)
  • /usr/lib/opengl/(implementation-name)/extensions/libglx.so

On multilib systems, ebuilds that provide an OpenGL implementation install 32-bit libraries in /usr/lib32/opengl/(implementation name)/lib and 64-bit libraries in /usr/lib64/opengl/(implementation name)/lib.

Criticisms

Violation of Build Consistency

As documented in FL-1309, sometimes packages fail to merge when the "wrong" eselect opengl implementation is selected. This violates Portage's ability to consistently build a package from source, assuming all its dependencies are satisfied. This could be classified as a design bug -- eselect-opengl is functioning as intended, but its underlying theory of operation is not correct.

eselect-opengl-1.3* experiment

Introduction

As a result of FL-1309, an experimental solution was implemented in eselect-opengl-1.3*. With this version, all packages are built unconditionally against xorg-x11 OpenGL implementation and the other implementations are used only in runtime.

The rationale for this design change is that:

  1. There should be a consistent and repeatable build/linking process for all OpenGL applications.
  2. AMD and NVIDIA implementations of OpenGL are designed to be more of a "drop-in" runtime replacement for xorg-x11, rather than a standalone replacement for xorg-x11, and thus appear to exhibit more build-time bugs.

Implementation

The new version of eselect-opengl switched two files:

  • an env.d file 000opengl specifying LDPATH for the run-time implementation override,
  • an xorg.conf.d file overriding the ModulePath for custom glx xorg modules.

The env.d file has the same contents as the original one, except that the name was changed to ensure that the additional linker paths are added before the system paths where xorg-x11 libraries are installed.

The xorg.conf.d sets ModulePaths for non-xorg module replacements (such as the nvidia glx module), if necessary.

Issues

The widespread testing of eselect-opengl-1.3* has proven some issues with the new design:

  1. xorg-server is unable to handle multiple occurences of Files section gracefully. Therefore, eselect-opengl's generated xorg.conf.d file collides with many user-defined configurations. This has been patched locally and the patch is awaiting upstream review)
  2. There are rumors of arm mali's prioprietary OpenGL implementations requiring applications to be built against its own GLES headers.