Difference between pages "Package:Varnish" and "Xfce"

(Difference between pages)
m (add homepage link)
 
m (update table to responsive)
 
Line 1: Line 1:
{{Ebuild
+
== About Xfce ==
|Summary=Varnish is a state-of-the-art, high-performance HTTP accelerator
+
|CatPkg=www-servers/varnish
+
|Maintainer=
+
|Homepage=https://www.varnish-cache.org/
+
}}
+
'''Varnish''' is a webcache & http accelerator.  Varnish will either serve cached content, or retireve content from the server, and cache it.  Varnish cache will reduce I/O pressure from webservers.
+
  
==Install==
+
Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.
===Emerge===
+
  
Install {{Package|www-servers/varnish}}:
+
Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.
<console>###i## emerge www-servers/varnish</console>
+
  
==Configuration==
+
Another priority of Xfce is adhereance to standards, specifically those defined at [http://freedesktop.org/ freedesktop.org]. [http://www.xfce.org/about/ About XFCE]
  
{{note|as your varnish is local to your server, your server needs to be aware that it is behind a proxy, and configured for [http://en.wikipedia.org/wiki/X-Forwarded-For x-forwarded-for] or similar to fetch real users ip addresses instead of displaying 127.0.0.1 or localhost.}}
+
== Installation ==
  
Configuration is controlled by /etc/varnish/default.vcl & /etc/conf.d/varnishd
+
Before emerging Xfce you need to:
  
{{file|name=/etc/varnish/default.vcl|desc=varnish configuration file|body=
+
* Check that you have enabled the USE flags necessary for a XFCE desktop environment. [[Funtoo_Linux_First_Steps#Changing_profile|Set your profile to "xfce" via mix-ins]], as follows:
vcl 4.0;
+
backend default {
+
    .host = "127.0.0.1";
+
    .port = "8080";
+
}
+
}}
+
  
{{file|name=/etc/conf.d/varnishd|desc=varnish configuration file|body=
+
{{console|body=###i## eselect profile add funtoo/1.0/linux-gnu/mix-ins/xfce}}
VARNISHD="/usr/sbin/varnishd"
+
VARNISHADM="/usr/bin/varnishadm"
+
CONFIGFILE="/etc/varnish/default.vcl"
+
VARNISHD_OPTS="-a 127.0.0.1:80"
+
VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
+
}}
+
  
Varnish will fetch data from localhost:8080 and serve accelerated proxy data on localhost:80
+
* Verify that you have [[Funtoo_Linux_First_Steps#X.Org|X.Org Server]] configured properly.
  
=== c10k ===
+
We are now ready to install Xfce. Install the meta-package, which pulls in all of the components you need for a minimal Xfce installation:
For 10,000 concurrent connections (or not) a few configuration settings control the power of varnish.  If you're having varnish directly serve to the outside world, dial back concurrency to say 50 or 100 connections per ip. You must take into account corporations, and universities hammering several connections from a singular ip.  c10k is useful information for if varnish is behind a load balancer such as pound, nginx, or tengine, and all requests are internal and local.
+
  
{{file|name=/etc/conf.d/varnishd|desc=varnish concurrency settings|body=
+
{{console|body=###i## emerge xfce4-meta}}
VARNISHD_OPTS="-a 127.0.0.1:80 -p thread_pool_min=20 -p thread_pool_max=1000 -p thread_pool_add_delay=2 -s malloc,700M"
+
}}
+
  
{{file|name=/etc/varnish/default.vcl|desc=varnish concurrency settings|body=
+
== Running Xfce ==
backend default {
+
 
    .host = "127.0.0.1";
+
There are several different ways to start Xfce:
    .port = "8080";
+
 
    .connect_timeout = 600s;
+
* Editing the {{c|.xinitrc}} file in your user's home directory and using {{c|startx}} from a text console.
    .first_byte_timeout = 600s;
+
* Using a display manager (e.g. SLiM, GDM, and KDM).
    .between_bytes_timeout = 600s;
+
* Configuring your shell profile to automatically start Xfce upon a successful login.
    .max_connections = 10000;
+
 
    # .port = "80" led to issues with competing for the port with apache.
+
=== .xinitrc ===
}
+
 
 +
The most common way to start the environment is to configure {{c|~/.xinitrc}} to launch an Xfce session. The proper way to launch Xfce from the terminal is by using {{c|startxfce4}} combined with {{c|ck-launch-session}}.
 +
 
 +
{{console|body=$##i## echo "exec startxfce4 --with-ck-launch" > ~/.xinitrc}}
 +
 
 +
Note that {{c|--with-ck-launch}} (from ConsoleKit) is required by Xfce for important tasks such as shutting down, suspending, and automatically mounting removable storage media. Some applications will not work properly without it. Therefore we need to add ConsoleKit to the {{c|default}} runlevel, executing the following command as root:
 +
 
 +
{{console|body=
 +
###i## rc-update add consolekit default
 +
###i## rc
 
}}
 
}}
  
== BootService ==
+
Finally, to start the graphical environment, run {{c|startx}} from a login shell:
 +
{{console|body=$##i## startx}}
  
To start varnish immediately:
+
== Display Manager ==
<console>###i## rc-service varnishd start</console>
+
  
To start varnish at boot:
+
A display manager is a program that manages sessions and acts as a login screen. Here's a short list of a few of the display managers available in Funtoo:
<console>###i## rc-update add varnishd default</console>
+
  
== Verification ==
+
* XDM ({{c|x11-apps/xdm}}): X.Org's standard display manager.
To verify that your traffic is going through varnish, and see if you're getting hits or misses:
+
<console>$##i## curl -I http://www.funtoo.org/Welcome</console>
+
  
== Benchmarking ==
+
* LightDM ({{c|x11-misc/lightdm}}): A lightweight, but highly configurable display manager.
{{package|app-admin/apache-tools}} apache benchmark can show the power of varnish.  The examples shown are running 500 requests with concurrency of 100 hits.
+
  
 +
* SLiM ({{c|x11-misc/slim}}): Simple Login Manager -- a lightweight display manager. Not very configurable.
  
ab against a 3 worker cluster mode puma server
+
Any of these would make a fine choice. After you've chosen which display manager to use, install it:
<console>###i## ab -n 500 -c 100 http://127.0.0.1:3000/index.html | grep Request</console>
+
 
Requests per second:    110.92 [#/sec] (mean)
+
{{console|body=###i## emerge lightdm}}
 +
 
 +
All that's left to do now is to add the name of the display manager to {{c|/etc/conf.d/xdm}}, add the {{c|xdm}} service to the {{c|default}} runlevel, and start the service:
 +
 
 +
<pre>
 +
DISPLAYMANAGER="lightdm"
 +
</pre>
 +
 
 +
{{console|body=
 +
###i## rc-update add xdm default
 +
###i## /etc/init.d/xdm start}}
 +
 
 +
==Power Group==
 +
 
 +
If you wish to be able to shutdown/reboot/suspend/hibernate using xfce4-logout-session then you will need to add yourself or the user to the power group by:
 +
 
 +
{{console|body=
 +
###i## gpasswd -a <username> power
 +
}}
  
 +
If the group does not exist then execute the following and try again:
  
ab against the same server served through varnish
+
{{console|body=
<console>###i## ab -n 500 -c 100 http://127.0.0.1/index.html | grep Request</console>
+
###i## groupadd power}}
Requests per second:    10268.42 [#/sec] (mean)
+
  
== SSL support ==
+
== Plugins for Thunar and XFCE ==
Varnish does not support ssl. There are packages to get around this limitation:
+
There are a lot of plugins available for Thunar and XFCE. Here is a table that contains the name of the plugin and a description of what it does. To install one of the plugins, run
* {{package|net-misc/stunnel}}
+
{{console|body=###i## emerge [name of plugin]}}
* {{package|www-servers/pound}}
+
  
== Media ==
+
{{TableStart}}
{{#widget:YouTube16x9|id=JEF6_XC-2ZU}}
+
<tr class="info"><th>Name</th><th>Description</th></tr>
 +
<tr><td>xfce-extra/thunar-volman</td><td>Daemon that enforces volume-related policies</td></tr>
 +
<tr><td>xfce-extra/thunar-vcs-plugin </td><td>Adds Subversion and GIT actions to the context menu of thunar </td></tr>
 +
<tr><td>xfce-extra/thunar-shares-plugin</td><td>Thunar plugin to share files using Samba </td></tr>
 +
<tr><td>xfce-extra/thunar-archive-plugin</td><td>Archive plug-in for the Thunar filemanager</td></tr>
 +
<tr><td>xfce-extra/xfce4-volumed</td><td>Daemon to control volume up/down and mute keys</td></tr>
 +
<tr><td>xfce-extra/xfce4-screenshooter</td><td>Xfce4 screenshooter application and panel plugin</td></tr>
 +
<tr><td>xfce-extra/xfce4-notifyd</td><td>Notification daemon for the Xfce desktop environment</td></tr>
 +
<tr><td>xfce-extra/xfce4-mixer</td><td>A volume control application (and panel plug-in) for the Xfce desktop environment</td></tr>
 +
<tr><td>xfce-extra/xfce4-mount-plugin</td><td>A mount plug-in for the Xfce panel</td></tr>
 +
<tr><td>xfce-extra/xfce4-clipman-plugin</td><td>A clipboard manager plug-in for the Xfce panel</td></tr>
 +
<tr><td>xfce-extra/xfce4-battery-plugin</td><td>A battery monitor panel plugin for the Xfce desktop environment</td></tr>
 +
{{TableEnd}}
  
{{EbuildFooter}}
+
[[Category:Desktop]]
 +
[[Category:First Steps]]
 +
[[Category:Official Documentation]]

Revision as of 21:22, January 21, 2015

About Xfce

Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.

Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.

Another priority of Xfce is adhereance to standards, specifically those defined at freedesktop.org. About XFCE

Installation

Before emerging Xfce you need to:

# eselect profile add funtoo/1.0/linux-gnu/mix-ins/xfce


We are now ready to install Xfce. Install the meta-package, which pulls in all of the components you need for a minimal Xfce installation:

# emerge xfce4-meta


Running Xfce

There are several different ways to start Xfce:

  • Editing the .xinitrc file in your user's home directory and using startx from a text console.
  • Using a display manager (e.g. SLiM, GDM, and KDM).
  • Configuring your shell profile to automatically start Xfce upon a successful login.

.xinitrc

The most common way to start the environment is to configure ~/.xinitrc to launch an Xfce session. The proper way to launch Xfce from the terminal is by using startxfce4 combined with ck-launch-session.

$ echo "exec startxfce4 --with-ck-launch" > ~/.xinitrc


Note that --with-ck-launch (from ConsoleKit) is required by Xfce for important tasks such as shutting down, suspending, and automatically mounting removable storage media. Some applications will not work properly without it. Therefore we need to add ConsoleKit to the default runlevel, executing the following command as root:

# rc-update add consolekit default
# rc


Finally, to start the graphical environment, run startx from a login shell:

$ startx


Display Manager

A display manager is a program that manages sessions and acts as a login screen. Here's a short list of a few of the display managers available in Funtoo:

  • XDM (x11-apps/xdm): X.Org's standard display manager.
  • LightDM (x11-misc/lightdm): A lightweight, but highly configurable display manager.
  • SLiM (x11-misc/slim): Simple Login Manager -- a lightweight display manager. Not very configurable.

Any of these would make a fine choice. After you've chosen which display manager to use, install it:

# emerge lightdm


All that's left to do now is to add the name of the display manager to /etc/conf.d/xdm, add the xdm service to the default runlevel, and start the service:

DISPLAYMANAGER="lightdm"
# rc-update add xdm default
# /etc/init.d/xdm start


Power Group

If you wish to be able to shutdown/reboot/suspend/hibernate using xfce4-logout-session then you will need to add yourself or the user to the power group by:

# gpasswd -a <username> power


If the group does not exist then execute the following and try again:

# groupadd power


Plugins for Thunar and XFCE

There are a lot of plugins available for Thunar and XFCE. Here is a table that contains the name of the plugin and a description of what it does. To install one of the plugins, run

# emerge [name of plugin]


NameDescription
xfce-extra/thunar-volmanDaemon that enforces volume-related policies
xfce-extra/thunar-vcs-plugin Adds Subversion and GIT actions to the context menu of thunar
xfce-extra/thunar-shares-pluginThunar plugin to share files using Samba
xfce-extra/thunar-archive-pluginArchive plug-in for the Thunar filemanager
xfce-extra/xfce4-volumedDaemon to control volume up/down and mute keys
xfce-extra/xfce4-screenshooterXfce4 screenshooter application and panel plugin
xfce-extra/xfce4-notifydNotification daemon for the Xfce desktop environment
xfce-extra/xfce4-mixerA volume control application (and panel plug-in) for the Xfce desktop environment
xfce-extra/xfce4-mount-pluginA mount plug-in for the Xfce panel
xfce-extra/xfce4-clipman-pluginA clipboard manager plug-in for the Xfce panel
xfce-extra/xfce4-battery-pluginA battery monitor panel plugin for the Xfce desktop environment