https://wiki.archlinux.org/api.php?action=feedcontributions&user=Secret2008&feedformat=atomArchWiki - User contributions [en]2024-03-28T23:01:18ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=GNOME_tips&diff=330059GNOME tips2014-08-13T01:44:11Z<p>Secret2008: /* GNOME menu tips */ fix broken link</p>
<hr />
<div>[[Category:GNOME]]<br />
[[it:GNOME Tips]]<br />
[[nl:GNOME Tips]]<br />
[[ru:GNOME Tips]]<br />
[[zh-CN:GNOME Tips]]<br />
{{out of date}}<br />
{{Merge|GNOME}}<br />
<br />
== Configuration tips ==<br />
{{Merge|GDM|Merge GDM related info there.}}<br />
=== Add/edit GDM eessions ===<br />
<br />
Each session is a {{ic|.desktop}} file located at {{ic|/usr/share/xsessions/}}.<br />
<br />
'''To add a new session:'''<br />
<br />
1. Copy an existing {{ic|.desktop}} file to use as a template for a new session:<br />
$ cd /usr/share/xsessions<br />
# cp gnome.desktop other.desktop<br />
2. Modify the template {{ic|*.desktop}} file to open the required window manager:<br />
# nano other.desktop<br />
<br />
Alternatively, you can open the new session in KDM which will create the *.desktop file. Then return to using GDM and the new session will be available.<br />
<br />
=== GDM appearance ===<br />
<br />
You can use {{AUR|gdm3setup}} from the [[Arch User Repository|AUR]].<br />
<br />
==== GDM wallpaper ====<br />
<br />
{{Accuracy|1=these scripts were recovered from [https://wiki.archlinux.org/index.php?title=GNOME&diff=161398&oldid=prev] and may require testing.}}<br />
<br />
These scripts assist in setting up the GDM wallpaper and are an addition to [[GNOME#Login screen]]. Place these files in a suitable location and make them executable. An example of running these scripts appears below.<br />
<br />
{{hc|/usr/local/bin/prep-gdm-vars|<nowiki><br />
# This script must be run using '.' or 'source'<br />
$(dbus-launch | sed "s/^/export /")<br />
</nowiki>}}<br />
<br />
{{hc|/usr/local/bin/show-avail-gdm-bkgd|2=<br />
#!/bin/bash<br />
# Usage: show-avail-gdm-bkgd [folder]<br />
# Specify any folder within /usr/share/backgrounds.<br />
# If you omit the folder, you'll be shown available choices.<br />
file_part="/usr/share/backgrounds/"<br />
if ! [ $1 ]; then<br />
echo -en \\n Please specify one of these directories:\\n\\n\\040<br />
ls $file_part; echo; exit 1; fi<br />
ls ${file_part}/$1<br />
}}<br />
<br />
{{hc|/usr/local/bin/revise-gdm-bkgd|<nowiki><br />
#!/bin/bash<br />
# Usage: revise-gdm-bkgd gnome/filename.jpg<br />
# Specify any file path within /usr/share/backgrounds.<br />
org_part="org.gnome.desktop.background picture-uri"<br />
file_full="/usr/share/backgrounds/$1"<br />
# Trap when argument is: missing, a mere directory, a bad filename.<br />
if ( ! [ $1 ] || [ -d $file_full ] ); then<br />
echo -en \\n Specify a file. Use this example:<br />
echo -e \ \ revise-gdm-bkgd \ gnome/TwoWings.jpg\\n; exit 1; fi<br />
if ! [ -r $file_full ]; then<br />
echo -e \\n Specifed file does not exist or is not readable.\\n; exit 2; fi<br />
GSETTINGS_BACKEND=dconf gsettings set $org_part "file://${file_full}"<br />
</nowiki>}}<br />
<br />
Here is a session showing how a user might change the GDM wallpaper using the scripts listed above. It starts with a normal user's terminal and assumes he is able to open a bash session as root. The root user then opens a session as "gdm" and changes the wallpaper.<br />
<br />
# xhost +<br />
access control disabled, clients can connect from any host<br />
# su - gdm -s /bin/bash<br />
<br />
'''-bash-4.2$''' . prep-gdm-vars # Must use . to execute this script!<br />
access control disabled, clients can connect from any host<br />
<br />
'''-bash-4.2$''' show-avail-gdm-bkgd gnome<br />
Aqua.jpg FreshFlower.jpg Spaceflare-nova.jpg Terraform-green.jpg YellowFlower.jpg<br />
Blinds.jpg Garden.jpg Spaceflare-supernova.jpg Terraform-orange.jpg<br />
BlueMarbleWest.jpg GreenMeadow.jpg SundownDunes.jpg TwoWings.jpg<br />
FootFall.png Spaceflare.jpg Terraform-blue.jpg Wood.jpg<br />
<br />
'''-bash-4.2$''' revise-gdm-bkgd gnome/GreenMeadow.jpg<br />
<br />
'''-bash-4.2$''' logout<br />
<br />
# logout<br />
<br />
Script {{ic|revise-gdm-bkgd}} may also be used to change your normal user background from the command prompt. Admittedly, the script name does not quite fit when used for that purpose.<br />
<br />
=== Default applications ===<br />
<br />
You may want to configure system-wide default applications and file associations. This is extremely useful when you have some KDE applications installed, but still prefer a GNOME ones to be launched by default.<br />
<br />
To do that you can install {{AUR|gnome-defaults-list}} from the [[Arch User Repository|AUR]]. It will place your configuration file at {{ic|/etc/gnome/defaults.list}}.<br />
<br />
If you want to do everything manually, create {{ic|/usr/share/applications/defaults.list}} with the following format:<br />
{{bc|1=<br />
[Default Applications]<br />
application/pdf=evince.desktop<br />
image/jpeg=eog.desktop<br />
...<br />
}}<br />
<br />
=== Fonts seem skewed ===<br />
<br />
You can alter the DPI of your fonts in GNOME with right-click on the desktop > ''Change desktop background > Fonts > Details > Resolution''.<br />
<br />
=== Change the default background color, opacity, etc. ===<br />
<br />
The default background color is green. You might want to change it if you're using a transparent PNG as background.<br />
$ sudo gconf-editor<br />
Go to ''File > New Defaults Window'' and edit the keys<br />
/desktop/gnome/background/primary_color<br />
and<br />
/desktop/gnome/background/secondary_color<br />
You can also find keys for opacity, shading style, etc.<br />
<br />
=== Disable confirmation window when closing gnome-terminal ===<br />
<br />
The terminal always prompts a confirmation window when trying to close the window while one is logged in as root. To avoid this confirmation start '''gconf-editor''' and disable '''confirmation_window_close''' variable in '''/apps/gnome-terminal/global'''. Please note that although this setting is not set via dconf-editor it also works in the GNOME Shell.<br />
<br />
=== Start application with another language ===<br />
<br />
If you want to start an application with another language as the system's default one, you can change the application's desktop file in ''~/.local/share/applications'''' for yourself or in '''/usr/share/applications''' for everyone like shown below. <br />
<br />
Find the desktop file of the application which you want to start with another language. Go to the'''Exec''' row: (here for Empathy):<br />
<br />
Exec=empathy %f<br />
<br />
and change it to:<br />
<br />
Exec='''env LANG=de_DE.UTF-8''' empathy %f<br />
<br />
From now on that application will start with the chosen language.<br />
<br />
== Miscellaneous tips ==<br />
<br />
=== Nautilus tips ===<br />
<br />
Get a certain path in spatial view? Just press {{ic|Ctrl+l}}.<br />
<br />
==== Change browser mode (spatial view) ====<br />
<br />
# Start gconf-editor<br />
# Browse to ''apps/nautilus/preferences''<br />
# Change the value of "always_use_browser" (it's a yes/no value and should be visible as a checkbox or say "false", for the later change the value to "true")<br />
Or you can do this through the preferences:<br />
# In a Nautilus window go to ''Edit > Preferences''<br />
# Change to the Behaviour tab<br />
# Check (or uncheck) ''Always Open in Browser Windows''<br />
<br />
==== Music information columns in list view (bit rate, etc.) ====<br />
<br />
Nautilus lacks the ability to display metadata for music files in list view mode. A Python script was written to add columns for:<br />
* Artist<br />
* Album<br />
* Track Title<br />
* Bit Rate<br />
<br />
First, [[pacman|install]] the {{Pkg|mutagen}} and {{AUR|python-nautilus-git}}.<br />
<br />
Now, create a directory called ''python-extensions'' in {{ic|~/.nautilus}}. Place the following script, named {{ic|bsc.py}}, in this newly created folder. You may download the script here: [[http://stefanwilkens.eu/bsc.py bsc.py]] (please drop --[[User:Stefanwilkens|stefanwilkens]] a line if this goes down)<br />
<br />
Mirror: [[http://kclkcl.webege.com/files/bsc.py bsc.py]]<br />
<br />
[http://ubuntuforums.org/showthread.php?t=878683 bas-v2.py] adds fixes and more media support (link at bottom of 4th post).<br />
<br />
Mirror: [http://www.rnstech.com/mirror/bsc-v2.py bsc-v2.py]<br />
<br />
Restart nautilus. You can now configure this new functionallity in Edit -> Preferences -> List Columns<br />
<br />
==== Thumbnails ====<br />
<br />
You will need a tool for creating thumbnails, such as ffmpegthumbnailer. Make sure the necessary codecs are installed.<br />
<br />
In a command line, enter these two lines:<br />
gconftool-2 -s "/desktop/gnome/thumbnailers/video@mpeg/enable" -t boolean "true"<br />
gconftool-2 -s "/desktop/gnome/thumbnailers/video@mpeg/command" -t string "/usr/bin/ffmpegthumbnailer -s %s -i %i -o %o -c png -f -t 10"<br />
<br />
You can replace 'video@mpeg' in that line with any filetype that ffmpeg can open - just right-click > Properties on a file in Nautilus and look at the bit in brackets in the 'Type:' field (don't forget to replace the forward slash with an @ symbol). Some common filetypes are video@mpeg, video@x-matroska, video@x-ms-wmv, video@x-flv, video@x-msvideo, video@mp4; which are usually .mpg, .mkv, .wmv, .flv, .avi, .mp4 respectively.<br />
<br />
==== Turn off Authentication needed to mount internal drive in Nautilus ====<br />
<br />
In Ubuntu and other distros you are allowed to mount internal drives by clicking on them without the need for entering a password.<br />
To get this behaviour in stock GNOME, just create the following JavaScript rule:<br />
{{hc|/etc/polkit-1/rules.d/10-auth.rules|2=<br />
polkit.addRule(function(action, subject) {<br />
if (action.id="org.freedesktop.udisks2.filesystem-mount-system" && subject.isInGroup("storage")) {<br />
return polkit.Result.YES;<br />
}<br />
}<br />
);<br />
}}<br />
Note: this adds very broad permissions. To only add the same permissions for internal filesystems as for external filesystems, use https://gist.github.com/grawity/3886114#file-udisks2-allow-mount-internal-js<br />
<br />
Older Polkit versions will require the following file in [[PolicyKit]] Local Authority instead:<br />
{{hc|/etc/polkit-1/localauthority/50-local.d/50-filesystem-mount-system-internal.pkla|2=<br />
[Mount a system-internal device]<br />
Identity=*<br />
Action=org.freedesktop.udisks2.filesystem-mount-system<br />
ResultActive=yes<br />
}}<br />
<br />
=== Speed up panel autohide ===<br />
<br />
==== panel_show_delay / panel_hide_delay ====<br />
<br />
If you find that your panels are taking too long to appear/disappear when using the Panel Autohide feature, try this;<br />
# Start gconf-editor<br />
# Browse to ''/apps/panel/global''<br />
# Set ''panel_hide_delay'' and ''panel_show_delay'' to more sensible (integer) values. Note that these values represent milliseconds!<br />
<br />
The default panel_hide_delay of 500 works well in most cases, but the panel_show_delay default of 500 is horribly slow. After experimenting, a panel_show_delay between 100-200 seems much better.<br />
<br />
==== Panel animation_speed ====<br />
<br />
Now that the panel show/hide delay has the panels beginning to appear in a reasonable length of time, why does it take the panel so long to actually pop up? There is one more setting you need to add/change to make the panel behavior crisp. The setting {{ic|animation_speed}}: ihis setting can be applied globally or on a per-panel basis just like the {{ic|panel_show_delay}} and {{ic|panel_hide_delay}}. The official description is:<br />
<br />
The speed in which panel animations should occur. Possible values are slow, medium and fast. This key is only relevant if the enable_animations key is true. <br />
<br />
To apply globally, just add or change the animation_speed key as a (string) value in:<br />
<br />
* ''/apps/panel/global''<br />
<br />
To apply the setting on a per-panel basis, just add/change the key in, for example:<br />
<br />
* ''/apps/panel/toplevels/bottom_panel_screen0/'' (usually the default name for the bottom panel)<br />
* ''/apps/panel/toplevels/panel_0/'' (usually the default name for the first additional panel)<br />
<br />
{Note|The key {{ic|panel_amination_speed}} is deprecated, use: {{ic|animation_speed}}.}}<br />
<br />
=== GNOME menu tips ===<br />
<br />
==== Speed tweak ====<br />
<br />
You can remove the delay in GNOME menus by appending "{{ic|1=gtk-menu-popup-delay = 0}}" to {{ic|~/.gtkrc-2.0}}.<br />
<br />
However, this setting is reported to crash Banshee, and possibly other programs.<br />
<br />
==== Menu editing ====<br />
<br />
Most GNOME users complain about the menu. Changing menu entries system-wide or for one or several users alone is poorly documented.<br />
<br />
===== Application folders in Gnome 3.12 =====<br />
<br />
Until [https://wiki.gnome.org/Apps/Software Gnome Software] becomes available for Arch, the only built-in way to manage folders is to set a list of folder names using gsettings or dconf-editor, then set a list of applications for each folder using the name of their respective desktop files like the following:<br />
<br />
{{bc|<br />
gsettings set org.gnome.desktop.app-folders folder-children "['folder1', 'folder2']"<br />
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/folder1/ apps "['app1.desktop', 'app2.desktop', 'app3.desktop']"<br />
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/folder2/ apps "['app4.desktop', 'app5.desktop', 'app6.desktop']"<br />
}}<br />
<br />
The [https://github.com/prurigro/gnome-catgen gnome-catgen] ({{AUR|gnome-catgen-git}} in [[AUR]]) script allows you to manage folders through the creation of files in {{ic|~/.local/share/applications-categories}} named after each category and containing a list of the desktop files belonging to apps you'd like to have inside. Optionally, you can have it cycle through each app without a folder and input the desired category until you ctrl-c or run out of apps.<br />
<br />
===== User menus =====<br />
<br />
Older versions of GNOME (i.e. 2.22 or earlier) have a menu editor in which you can de-select menu entires, but not add new menu entries. Right-click on the menu panel and select Edit Menus. Unchecking the box next to a entry will prevent it from displaying.<br />
<br />
To add new menu entries, create a .desktop file in the $XDG_DATA_HOME/applications directory (most likely {{ic|$HOME/.local/share}}). A sample .desktop file can be seen below, or take a look at [http://library.gnome.org/admin/system-admin-guide/stable/menustructure-desktopentry.html.en the GNOME documentation].<br />
<br />
Or install [https://www.archlinux.org/packages/?sort=&q=alacarte&maintainer=&last_update=&flagged=&limit=50 Alacarte], which makes it easy to create, change and remove menu entries with a GUI.<br />
<br />
===== Group menus, System menus =====<br />
<br />
You will find common GNOME menu entries as 'appname.desktop' objects inside one of the {{ic|$XDG_DATA_DIRS/applications}} directories (most likely {{ic|/usr/share/applications}}). To add new menu items for all users, create an 'appname.desktop' file in one of those directories.<br />
* Edit one of them to fit your needs for a new application, then save it.<br />
* Save it as a menu entry for all users <br> Most often, you will set this files permissions to 644 (root: rw group: r others: r), so all users can see it.<br />
* Save it as a menu entry for a group or user alone <br> You may also have different user permissions; for example, some menu entries should only be available for a group or for one user.<br />
<br />
Here is an example how a Scite menu entry definition file could look:<br />
<br />
{{bc|1=<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Name=SciTE<br />
Comment=SciTE editor<br />
Type=Application<br />
Exec=/usr/bin/scite<br />
Icon=/usr/share/pixmaps/scite_48x48.png<br />
Terminal=false<br />
Categories=GNOME;Application;Development;<br />
StartupNotify=true<br />
}}<br />
<br />
==== Change the GNOME foot icon to an Arch icon ====<br />
<br />
{{Note|1=Thanks to arkham who posted this method in [https://bbs.archlinux.org/viewtopic.php?id=74881 this forum post].}}<br />
<br />
* Download [http://i.imgur.com/vBpJDs7.png this Arch icon] (filename is {{ic|starthere.png}})<br />
* Alternatively get the artwork package by installing {{AUR|archlinux-artwork}}, this puts all artwork in the {{ic|/usr/share/archlinux}} directory, and resize your desired logo to 24x24px<br />
* Figure out which icon set you are using (right-click desktop > ''Change Background Image > Theme > Customize > Icon''). For example, Crux, *GNOME, High Contrast, High Contrast Inverse, Mist, etc.)<br />
* Now make a backup of your current GNOME icon in the correct directory. In the example below, I am using the GNOME icons but adjust the directory structure accordingly for your icon set:<br />
# mv /usr/share/icons/gnome/24x24/places/start-here.png /usr/share/icons/gnome/24x24/places/start-here.png-virgin<br />
* Copy {{ic|starthere.png}} you just downloaded to the same directory renaming it start-here.png<br />
# cp /path/to/starthere.png /usr/share/icons/gnome/24x24/places/start-here.png<br />
* Restart your gnome-panels and the new Arch logo should be displayed<br />
$ pkill gnome-panel<br />
<br />
==== Change the GNOME foot icon to an Arch icon (without root access) ====<br />
<br />
* Figure out which icon set you're using (right-click on desktop > ''Change Background Image > Theme > Customize > Icon''). For example, Crux, *GNOME, High Contrast, High Contrast Inverse, Mist, etc.)<br />
* Duplicate that icon set's directory structure for {{ic|24x24/places}} in your home directory under .icons<br />
$ mkdir -p ~/.icons/''your_icon_set''/24x24/places<br />
* Download [http://i.imgur.com/vBpJDs7.png this Arch icon] into that directory as 'start-here.png'<br />
$ wget -O ~/.icons/''your_icon_set''/24x24/places/start-here.png http://i.imgur.com/vBpJDs7.png<br />
* Alternatively get the artwork package using {{AUR|archlinux-artwork}} package, this puts all artwork in the /usr/share/archlinux directory, and resize your desired logo to 24x24px and copy it into that directory as 'start-here.png'<br />
* Restart your gnome-panels and the new Arch logo should be displayed<br />
$ pkill gnome-panel<br />
<br />
==== Custom icon using gconf-editor ====<br />
<br />
# Open the configuration editor in GNOME (it should be in System Tools of your main menu) or run {{ic|gconf-editor}}<br />
# In the configuration editor go to ''apps > panel > objects'' > find the object for your menu (an easy way to spot the correct object is that it will have "Main Menu" in the tool tip section).<br />
# Set the path to your icon in the "Custom_Icon" field.<br />
# Check "Use_Custom_Icon" a little ways down.<br />
# The panel should reload momemtarily, if not, open a terminal window and type:<br />
$ killall gnome-panel<br />
<br />
==== Removing default icons from desktop ====<br />
<br />
I like to keep my desktop clean, and perhaps someone else too. So here is how to remove home folder, computer and trash from desktop:<br />
<br />
# Open terminal<br />
# On terminal type: gconf-editor<br />
# Configuration Editor opens. From there navigate to: ''apps > nautilus > desktop''<br />
# Untick all the icons you dont want to see<br />
# You are done, the icons should disappear immediately<br />
<br />
=== Disabling scroll in taskbar ===<br />
<br />
For years there is a "bug" in the GNOME taskbar: the mouse scroll switches the windows. The annoying feature if you have a good mice turns to be a real pain if you have the touchpad. It is impossible to scroll precisely using touchpad, so if you accidentally touch it when your mouse is on the taskbar, then all the windows will flash/switch wildly. There is no setting in gconf/preferences, that can disable this functionality. This is true for [[KDE]] 3, I do not know if problem persist in KDE 4. The solution was to install xfce4-panel, which hasn't scrolling at all and looks like default GNOME panel. The bug is better described here [https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/39328].<br />
<br />
This bug will be probably never fixed, but we have the [[Arch Build System]], so we can build custom software. Install {{Pkg|abs}} (+70Mb), then<br />
<br />
cp -r /var/abs/extra/libwnck ~/Desktop/somewhere<br />
<br />
Navigate to that directory, then<br />
makepkg --nobuild<br />
<br />
This will download and extract the sources. Go to {{ic|src/libwnck-{version}/libwnck}}. Edit {{ic|tasklist.c}}, search for "scroll-event". You will see somethign like<br />
<br />
g_signal_connect(obj, "scroll-event", G_CALLBACK(wnck_tasklist_scroll_cb), NULL);<br />
<br />
This line enables scroll-event handler, comment the line out (place /* before and */ after the line). Now go back to {{ic|~/Desktop/somewhere}} and<br />
makepkg --noextract --syncdeps<br />
<br />
You will need [[sudo]] to be able to install missing dependencies (intltool), but you can always install them separately if you do not want --syncdeps automatically. The --noextract option tells makepkg to not extract sources and use existing src/<br />
<br />
pacman -U libwnck-{version}.pkg.tar.gz<br />
<br />
Then log out, log back in, and enjoy. Delete dir with the sources from you desktop, you may also uninstall abs if you want. Next step will be to add gconf option, but I will leave this for GNOME gurus. I just do not need this "feature", not even if I use the mouse ({{ic|Alt+Tab}} is better anyway).<br />
<br />
=== Custom transitioning background===<br />
<br />
This will create a transitioning background similiar to the "cosmos" background found in the [[GNOME#Installation|gnome-backgrounds]] package. There are three ways to do this.<br />
{{Note|The image filenames must not have spaces in them.}}<br />
<br />
==== Manual ====<br />
<br />
You can create an XML file similiar to the one created by {{pkg|gnome-backgrounds}} in {{ic|/usr/share/backgrounds/cosmos/}}.<br />
{{bc|<br />
<background><br />
<starttime><br />
<hour>00</hour><br />
<minute>00</minute><br />
<second>01</second><br />
</starttime><br />
<nowiki><!-- The first section set an arbitrary start time. --></nowiki><br />
<static><br />
<duration>1795.0</duration><br />
<file>/path/to/background1.jpg</file><br />
</static><br />
<transition><br />
<duration>5.0</duration><br />
<from>/path/to/background1.jpg</from><br />
<to>/path/to/background2.jpg</to><br />
</transition><br />
<static><br />
<duration>1795.0</duration><br />
<file>/path/to/background2.jpg</file><br />
</static><br />
<transition><br />
<duration>5.0</duration><br />
<from>/path/to/background2.jpg</from><br />
<to>/path/to/background1.jpg</to><br />
</transition><br />
</background><br />
}}<br />
<br />
Note that the <duration> tag sets each image as the background for 1795 seconds, or 29 minutes and 55 seconds, and the <transition> then takes 5 seconds. You can add any number of images as long as the last one transitions back to the first (if you want a full loop). Once completed, the XML file can be added to GNOME under ''System > Preferences > Appearance > Background tab > Add''.<br />
<br />
==== Automatic ====<br />
<br />
There is also a script which automates this process:<br />
{{bc|1=<br />
#!/bin/sh<br />
#This script creates XML files that can act as dynamic wallpapers for GNOME by referring to multiple wallpapers<br />
#Coded by David J Krajnik<br />
<br />
if [ "$*" = "" ]; then<br />
echo "This script creates XML files that can act as dynamic backgrounds for GNOME by referring to multiple wallpapers"<br />
echo "Usage: mkwlppr target-file.xml [duration] pic1 pic2 [pic3 .. picN]"<br />
else<br />
files=$*<br />
#Grab the name of the target xml file<br />
xmlfile=$(echo $files | cut -d " " -f 1)<br />
#remove the first item from $files<br />
files=$(echo $files | sed 's/^\<[^ ]*\>//')<br />
if [ "$(echo $xmlfile | grep '\.xml$')" = "" ]; then<br />
echo "Your target file must be an XML file"<br />
else<br />
inputIsValid="true";<br />
firstItem=$(echo $files | cut -d " " -f 1)<br />
duration="1795.0";#set the default duration<br />
if [ "$(echo $firstItem | grep '^[0-9]\+\.[0-9]\+$')" != "" ]; then<br />
echo "The duration must be an integer"<br />
files=$(echo $files | sed 's/^\<[^ ]*\>//')<br />
inputIsValid=""<br />
elif [ "$(echo $firstItem | grep '^[0-9]\+$')" != "" ]; then<br />
#If the item is a number, then use it as the duration for each wallpaper image<br />
duration="$(expr $firstItem - 5).0"<br />
#remove the duration from the list of files<br />
files=$(echo $files | sed 's/^\<[^ ]*\>//')<br />
fi<br />
if [ "$files" = "" ]; then<br />
echo "You must enter image files to associate with the XML file"<br />
else<br />
for file in $files<br />
do<br />
if [ ! -f $file ]; then<br />
echo "\"$file\" does not exist"<br />
inputIsValid="";<br />
elif [ "$(echo $file | sed 's/^.*\.\(jpg\|jpeg\|bmp\|png\|gif\|tif\|tiff\|jif\|jfif\|jp2\|jpx\|j2k\|j2c\)$//')" != "" ]; then<br />
echo "\"$file\" is not an image file"<br />
inputIsValid=""<br />
fi<br />
done<br />
if [ $inputIsValid ]; then<br />
currDir=$(pwd)<br />
echo "<background>" >> $xmlfile<br />
echo " <starttime>\n <year>2009</year>\n <month>08</month>\n <day>04</day>" >> $xmlfile;<br />
echo " <hour>00</hour>\n <minute>00</minute>\n <second>00</second>\n </starttime>" >> $xmlfile;<br />
echo " <!-- This animation will start at midnight. -->" >> $xmlfile<br />
firstFile=$(echo $files | cut -d " " -f 1) # grab the first item<br />
if [ "$(echo $firstFile | sed 's/\(.\).*/\1/')" != "/" ]; then<br />
#If the first character in the filename is not '/', then it is a relative path and must have the current directory's path appended<br />
firstFile="$currDir/$firstFile"<br />
fi<br />
firstFile=$(echo $firstFile | sed 's/[^/]\+\/\.\.\/\?//g');#Remove occurrences of ".." from the filepath<br />
files=$(echo $files | sed 's/^\<[^ ]*\>//') # remove the first item<br />
prevFile=$firstFile<br />
currFile=""<br />
#TODO add absolute path to the filenames<br />
#if $currFile =~ "^/.*" then the file needs to path appended<br />
echo " <static>\n <duration>$duration</duration>\n <file>$firstFile</file>\n </static>" >> $xmlfile<br />
for currFile in $files; do<br />
if [ "$(echo $currFile | sed 's/\(.\).*/\1/')" != "/" ]; then<br />
#If the first character in the filename is not '/', then it is a relative path and must have the current directory's path appended<br />
currFile="$currDir/$currFile"<br />
fi<br />
currFile=$(echo $currFile | sed 's/[^/]\+\/\.\.\/\?//g') # Remove occurrences of ".." from the filepath<br />
echo " <transition>\n <duration>5.0</duration>\n <from>$prevFile</from>\n <to>$currFile</to>\n </transition>" >> $xmlfile;<br />
echo " <static>\n <duration>$duration</duration>\n <file>$currFile</file>\n </static>" >> $xmlfile;<br />
prevFile=$currFile<br />
done<br />
echo " <transition>\n <duration>5.0</duration>\n <from>$currFile</from>\n <to>$firstFile</to>\n </transition>" >> $xmlfile;<br />
echo "</background>" >> $xmlfile;<br />
fi<br />
fi<br />
fi<br />
fi<br />
}}<br />
Copy the code for the script above into a file called {{ic|mkwlppr}} (short for "make wallpaper"). Make the script executable by typing:<br />
sudo chmod 711 mkwlppr<br />
Move the file so that you can run it from any directory by just using its name: <br />
sudo mv mkwlppr /usr/local/bin<br />
Execute the script; it will tell you what input it requires from you. Use the script with input to create as many wallpaper XML files as you want.<br />
<br />
{{Note|<br />
Since this script is not interactive, you can use Unix's wildcards with it if you want to use all files in a directory and/or if you do not care about the order of the images.<br />
You can specify paths relative to your current directory, and the script will put the files' absolute paths into the XML file for you; so you can create the XML file anywhere you want and move it afterward without rendering it useless.<br />
If you want to run the script inside the {{ic|/usr/share/backgrounds/}} directory, you might have problems with permissions unless you run the command with sudo like this:<br />
{{ic|sudo mkwlppr -parameters}}<br />
If you do not know what duration to specify for the images, simply do not provide a number in the input, and the progam will use the default values of 29 minutes and 55 seconds per image and a 5 second transition.<br />
For more information, please see [http://www.linuxjournal.com/content/create-custom-transitioning-background-your-gnome-228-desktop this page].<br />
}}<br />
<br />
==== GUI ====<br />
<br />
If you prefer using a GUI, you can use [[Wallpapoz]] or install {{AUR|crebs}} from the AUR, which are apps for creating background slideshows for GNOME.<br />
<br />
=== Change default size of gnome-terminal ===<br />
<br />
==== Method 1 ====<br />
<br />
The terminal emulator {{Pkg|gnome-terminal}} does neither allow the set a default size nor does remember the last size. In order to set the default size consider the following steps:<br />
# Change the following line in {{ic|/usr/share/vte/termcap/xterm}} accordingly:<br />
:co#80:it#8:li#24:<br />
Here 80 stands for the number of '''co'''lumns (i.e. width in characters) and 24 for the number of '''li'''nes (i.e. height in characters).<br />
'''2.''' To prevent pacman from overwriting this file when upgrading the package {{ic|vte}}, make enter the following in {{ic|/etc/pacman.conf}}:<br />
NoUpgrade = usr/share/vte/termcap/xterm<br />
'''3.''' Terminate all gnome-terminal processes to let the changes take effect.<br />
<br />
==== Method 2 ====<br />
<br />
Another option is to simply use the --geometry switch when starting {{pkg|gnome-terminal}} (can be done via a right-click/properties on the launcher, then enter the following in the "Command" field: gnome-terminal --geometry 105x25+100+20).<br />
<br />
=== Install a cursor theme ===<br />
<br />
The default cursor theme of Xorg looks pretty outdated. See [[X11 Cursors]] for easy instructions on installing new cursor themes. Then go to to the ''desktop > right click > Change background > Theme tab > customise > cursor'' to apply them.<br />
<br />
=== Autostart programs ===<br />
<br />
You can place {{ic|.desktop}} files in the {{ic|~/.config/autostart}} directory (which you might need to create) to have them started automatically after starting a GNOME session.<br />
<br />
== gnome-screensaver ==<br />
<br />
=== Leave message feature in gnome-screensaver ===<br />
<br />
This is a cool feature provided by {{Pkg|gnome-screensaver}} 2.20, somebody can leave a message for you when you are not at your desk.<br />
Please install notification-daemon to make this work.<br />
<br />
=== Change gnome-screensaver background ===<br />
<br />
There is no option to change the screensaver's default background. The only way is do as root:<br />
<br />
# cd /usr/share/pixmaps/backgrounds/gnome<br />
# rm background-default.jpg<br />
# ln -s /home/user/my_background.jpg background-default.jpg<br />
<br />
{{Note|You can save your wallpaper to a ''static'' path like {{ic|/home/user/wall.jpg}} and configure gdm, gnome-desktop and gnome-screensaver to point at it. This way you can have the same wallpaper on each of them. }}<br />
<br />
== Toolbar style in GTK+ applications ==<br />
<br />
The default setting in GNOME 2.30 displays text next to icons in the toolbar of GTK+ applications. This means labels will only appear near buttons that the developer marks as "important". To have labels always show under the buttons in the toolbar:<br />
gconftool-2 --set --type string /desktop/gnome/interface/toolbar_style both<br />
Possible values are:<br />
* both (text is always displayed below the button's icon)<br />
* both-horiz (default, text is only displayed next to "important" buttons)<br />
* text (only labels on buttons, no icons)<br />
* icons (only icons on buttons, no labels)<br />
<br />
== Missing icons in System Menu ==<br />
<br />
The default setting under 2.30 does not display the usual icons under the System menu. In the 2.28 version, they could be enabled from ''System > Preferences > Appearance > Interface''. This case is not possible anymore. Now this can be enabled from:<br />
gconftool-2 --set --type boolean /desktop/gnome/interface/menus_have_icons true<br />
<br />
== Nautilus location entry ==<br />
<br />
Since GNOME 2.30, Nautilus does not have an icon to switch the location type between using a text input entry and of a pathbar. Since pathbar is enabled by default, to change to text input entry do:<br />
gconftool-2 --set --type boolean /apps/nautilus/preferences/always_use_location_entry true<br />
<br />
== See also ==<br />
<br />
* [[GNOME]]</div>Secret2008https://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=303513Apache HTTP Server2014-03-07T19:20:10Z<p>Secret2008: Added troubleshooting for mpm error with apache 2.4 and php</p>
<hr />
<div>[[Category:Web Server]]<br />
[[cs:LAMP]]<br />
[[de:LAMP Installation]]<br />
[[el:LAMP]]<br />
[[es:LAMP]]<br />
[[fr:Lamp]]<br />
[[it:LAMP]]<br />
[[pl:LAMP]]<br />
[[ru:LAMP]]<br />
[[sr:LAMP]]<br />
[[tr:LAMP]]<br />
[[zh-CN:LAMP]]<br />
{{Related articles start}}<br />
{{Related|MariaDB}}<br />
{{Related|PhpMyAdmin}}<br />
{{Related|Adminer}}<br />
{{Related|Xampp}}<br />
{{Related|mod_perl}}<br />
{{Related articles end}}<br />
{{Out of date|This article needs to be updated to Apache 2.4.}}<br />
[[Wikipedia:LAMP (software bundle)|LAMP]] refers to a common combination of software used in many web servers: '''L'''inux, '''A'''pache, '''M'''ySQL/'''M'''ariaDB, and '''P'''HP. This article describes how to set up the [http://httpd.apache.org Apache HTTP Server] on an Arch Linux system. It also tells you how to optionally install [[PHP]] and [[MariaDB]] and integrate these in the Apache server.<br />
<br />
If you only need a web server for development and testing, [[Xampp]] might be a better and easier option.<br />
<br />
== Installation ==<br />
This document assumes you will install Apache, PHP and MariaDB together. If desired however, you may install Apache, PHP, and MariaDB separately and simply refer to the relevant sections below.<br />
<br />
You can [[pacman|install]] {{Pkg|apache}}, {{Pkg|php}}, {{Pkg|php-apache}} and {{Pkg|mariadb}} from the [[official repositories]].<br />
<br />
== Configuration ==<br />
<br />
=== Apache ===<br />
For security reasons, as soon as Apache is started by the root user (directly or via startup scripts) it switches to the UID/GID specified in {{ic|/etc/httpd/conf/httpd.conf}}. The default is user '''http''' and it is created automatically during installation.<br />
<br />
Change {{ic|httpd.conf}} and optionally {{ic|extra/httpd-default.conf}} to your liking and start the {{ic|httpd}} daemon using [[systemd]].<br />
<br />
Apache should now be running. Test by visiting http://localhost/ in a web browser. It should display a simple Apache test page.<br />
<br />
==== User directories ====<br />
* User directories are available by default through http://localhost/~yourusername/ and show the contents of {{ic|~/public_html}} (this can be changed in {{ic|/etc/httpd/conf/extra/httpd-userdir.conf}}).<br />
<br />
* If you do not want user directories to be available on the web, comment out the following line in {{ic|/etc/httpd/conf/httpd.conf}}:<br />
Include conf/extra/httpd-userdir.conf<br />
<br />
* You must make sure that your home directory permissions are set properly so that Apache can get there. Your home directory and {{ic|~/public_html/}} must be executable for others ("rest of the world"). This seems to be enough:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
* A more secure way to share your home folder with Apache is to add the '''http''' user to the group that owns your home folder. For example, if your home folder and other sub-folders in your home folder belong to group '''piter''', all you have to do is following:<br />
# usermod -aG piter http<br />
or<br />
# gpasswd -a http piter<br />
<br />
* Of course, you have to give ''read'' and ''execute'' permissions on {{ic|~/}}, {{ic|~/public_html}}, and all other sub-folders in {{ic|~/public_html}} to the group members (group '''piter''' in our case). Do something like the following ('''modify the commands for your specific case'''):<br />
$ chmod g+xr-w /home/''yourusername''<br />
$ chmod -R g+xr-w /home/''yourusername''/public_html<br />
<br />
{{Note|This way you do not have to give access to your folder to every single user in order to give access to '''http''' user. Only the '''http''' user and other potential users that are in the '''piter''' group will have access to your home folder.}}<br />
<br />
Restart {{ic|httpd}} to apply any changes.<br />
<br />
==== SSL ====<br />
* Create a self-signed certificate (you can change the key size and the number of days of validity):<br />
# cd /etc/httpd/conf<br />
# openssl genrsa -out server.key 2048<br />
# chmod 600 server.key<br />
# openssl req -new -key server.key -out server.csr<br />
# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt<br />
<br />
* Then, in {{ic|/etc/httpd/conf/httpd.conf}}, uncomment the line containing:<br />
Include conf/extra/httpd-ssl.conf<br />
<br />
Restart {{ic|httpd}} to apply any changes.<br />
<br />
==== Virtual Hosts ====<br />
* If you want to have more than one host, uncomment the following line in {{ic|/etc/httpd/conf/httpd.conf}}:<br />
Include conf/extra/httpd-vhosts.conf<br />
<br />
* In {{ic|/etc/httpd/conf/extra/httpd-vhosts.conf}} set your virtual hosts according the example, e.g.:<br />
{{hc|/etc/httpd/conf/extra/httpd-vhosts.conf|<br />
'''NameVirtualHost *:80 ''' #this allows name based virtual hosts<br />
<br />
#this first virtualhost enables: http://127.0.0.1, or: http://localhost, <br />
#to still go to /srv/http/*index.html(otherwise it will 404_error).<br />
#the reason for this: once you tell httpd.conf to include extra/httpd-vhosts.conf, <br />
#ALL vhosts are handled in httpd-vhosts.conf(including the default one),<br />
# E.G. the default virtualhost in httpd.conf is not used and must be included here, <br />
#otherwise, only domainname1.dom & domainname2.dom will be accessible<br />
#from your web browser and NOT http://127.0.0.1, or: http://localhost, etc.<br />
#<br />
<br />
<VirtualHost *:80><br />
DocumentRoot "/srv/http"<br />
ServerAdmin root@localhost<br />
ErrorLog "/var/log/httpd/127.0.0.1-error_log"<br />
CustomLog "/var/log/httpd/127.0.0.1-access_log" common<br />
<Directory /srv/http/><br />
DirectoryIndex index.htm index.html<br />
AddHandler cgi-script .cgi .pl<br />
Options ExecCGI Indexes FollowSymLinks MultiViews +Includes<br />
AllowOverride None<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</VirtualHost><br />
<br />
<VirtualHost *:80><br />
ServerAdmin your@domainname1.dom<br />
DocumentRoot "/home/username/yoursites/domainname1.dom/www"<br />
ServerName domainname1.dom<br />
ServerAlias domainname1.dom<br />
<Directory /home/username/yoursites/domainname1.dom/www/><br />
DirectoryIndex index.htm index.html<br />
AddHandler cgi-script .cgi .pl<br />
Options ExecCGI Indexes FollowSymLinks MultiViews +Includes<br />
AllowOverride None<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</VirtualHost><br />
<br />
<VirtualHost *:80><br />
ServerAdmin your@domainname2.dom<br />
DocumentRoot "/home/username/yoursites/domainname2.dom/www"<br />
ServerName domainname2.dom<br />
ServerAlias domainname2.dom<br />
<Directory /home/username/yoursites/domainname2.dom/www/><br />
DirectoryIndex index.htm index.html<br />
AddHandler cgi-script .cgi .pl<br />
Options ExecCGI Indexes FollowSymLinks MultiViews +Includes<br />
AllowOverride None<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</VirtualHost><br />
}}<br />
<br />
* Add your virtual host names to your {{ic|/etc/hosts}} file (not necessary if a DNS server is serving these domains already, but will not hurt to do it anyway):<br />
127.0.0.1 domainname1.dom <br />
127.0.0.1 domainname2.dom<br />
<br />
Restart {{ic|httpd}} to apply any changes.<br />
<br />
* If you setup your virtual hosts to be in your user directory, sometimes it interferes with Apache's {{ic|Userdir}} settings. To avoid problems disable {{ic|Userdir}} by comment the following line in:<br />
#Include conf/extra/httpd-userdir.conf<br />
<br />
* As said above, ensure that you have the proper permissions:<br />
# chmod 0775 /home/''yourusername''/<br />
<br />
* If you have a huge amount of virtual hosts, you may want to easily disable and enable them. It is recommended to create one configuration file per virtual host and store them all in one folder, eg: {{ic|/etc/httpd/conf/vhosts}}.<br />
<br />
* First create the folder:<br />
# mkdir /etc/httpd/conf/vhosts<br />
<br />
* Then place the single configuration files in it:<br />
# nano /etc/httpd/conf/vhosts/domainname1.dom<br />
# nano /etc/httpd/conf/vhosts/domainname2.dom<br />
...<br />
<br />
* In the last step, {{ic|Include}} the single configurations in your {{ic|/etc/httpd/conf/httpd.conf}}:<br />
#Enabled Vhosts:<br />
Include conf/vhosts/domainname1.dom<br />
Include conf/vhosts/domainname2.dom<br />
<br />
* You can enable and disable single virtual hosts by commenting or uncommenting them.<br />
<br />
==== Advanced Options ====<br />
These options in {{ic|/etc/httpd/conf/httpd.conf}} might be interesting for you.<br />
<br />
# Listen 80<br />
* This is the port Apache will listen to. For Internet-access with router, you have to forward the port.<br />
<br />
If you setup Apache for local development you may want it to be only accessible from your computer. Then change this line to:<br />
# Listen 127.0.0.1:80<br />
<br />
* This is the admin's email address which can be found on e.g. error pages:<br />
# ServerAdmin you@example.com<br />
<br />
* This is the directory where you should put your web pages:<br />
# DocumentRoot "/srv/http"<br />
<br />
Change it, if you want to, but do not forget to also change<br />
<Directory "/srv/http"><br />
to whatever you changed your {{ic|DocumentRoot}} too, or you will likely get a '''403 Error''' (lack of privileges) when you try to access the new document root. Do not forget to change the {{ic|Deny from all}} line, otherwise you will get a '''403 Error'''.<br />
<br />
# AllowOverride None<br />
* This directive in {{ic|<Directory>}} sections causes Apache to completely ignore {{ic|.htaccess}} files. If you intend to use {{ic|mod_rewrite}} or other settings in {{ic|.htaccess}} files, you can allow which directives declared in that file can override server configuration. For more info refer to the [http://httpd.apache.org/docs/current/mod/core.html#allowoverride Apache documentation].<br />
<br />
{{Note|If you have issues with your configuration you can have Apache check the configuration with: {{ic|apachectl configtest}}}}<br />
<br />
* More settings in {{ic|/etc/httpd/conf/extra/httpd-default.conf}}:<br />
<br />
* To turn off your server's signature:<br />
ServerSignature Off<br />
<br />
* To hide server information like Apache and PHP versions:<br />
ServerTokens Prod<br />
<br />
==== Troubleshooting ====<br />
* If you encounter '''Error: PID file /run/httpd/httpd.pid not readable (yet?) after start.'''<br />
:Comment out the unique_id_module:<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
* If you encounter<br />
Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.<br />
AH00013: Pre-configuration failed<br />
httpd.service: control process exited, code=exited status=1<br />
after updating to apache 2.4, open /etc/httpd/conf/httpd.conf and replace<br />
LoadModule mpm_event_module modules/mod_mpm_event.so<br />
with<br />
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so<br />
See https://bbs.archlinux.org/viewtopic.php?pid=1389601#p1389601 for details.<br />
<br />
=== PHP ===<br />
* To enable PHP, add these lines to {{ic|/etc/httpd/conf/httpd.conf}}:<br />
:Place this in the {{ic|LoadModule}} list anywhere after {{ic|LoadModule dir_module modules/mod_dir.so}}:<br />
LoadModule php5_module modules/libphp5.so<br />
<br />
:Place this at the end of the {{ic|Include}} list:<br />
Include conf/extra/php5_module.conf<br />
<br />
:Uncomment the following line (optional):<br />
MIMEMagicFile conf/magic<br />
<br />
* Add this line in {{ic|/etc/httpd/conf/mime.types}}:<br />
application/x-httpd-php php php5<br />
<br />
{{Note|If you do not see {{ic|libphp5.so}} in the Apache modules directory ({{ic|/etc/httpd/modules}}), you may have forgotten to install {{Pkg|php-apache}}.}}<br />
<br />
* If your {{ic|DocumentRoot}} is not {{ic|/srv/http}}, add it to {{ic|open_basedir}} in {{ic|/etc/php/php.ini}} as such:<br />
open_basedir=/srv/http/:/home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* [[Daemons|Restart]] the '''httpd''' daemon.<br />
<br />
* To test whether PHP was correctly configured: create a file called {{ic|test.php}} in your Apache {{ic|DocumentRoot}} directory (e.g. {{ic|/srv/http/}} or {{ic|~/public_html}}) and inside it put:<br />
<?php phpinfo(); ?><br />
:To see if it works go to: http://localhost/test.php or http://localhost/~myname/test.php<br />
<br />
:If the PHP code is not executed (you see plain text in {{ic|test.php}}), check that you have added {{ic|Includes}} to the {{ic|Options}} line for your root directory in {{ic|/etc/httpd/conf/httpd.conf}}. Moreover, check that {{ic|TypesConfig conf/mime.types}} is uncommented in the <IfModule mime_module> section, you may also try adding the following to the {{ic|<IfModule mime_module>}} in {{ic|httpd.conf}}:<br />
AddHandler application/x-httpd-php .php<br />
<br />
==== Advanced options ====<br />
* It is recommended to set your timezone ([http://www.php.net/manual/en/timezones.php list of timezones]) in {{ic|/etc/php/php.ini}} like so:<br />
{{bc|1=date.timezone = Europe/Berlin}}<br />
<br />
* If you want to display errors to debug your PHP code, change {{ic|display_errors}} to {{ic|On}} in {{ic|/etc/php/php.ini}}:<br />
display_errors=On<br />
<br />
* If you want the {{ic|libGD}} module, install {{Pkg|php-gd}} and uncomment {{ic|1=extension=gd.so}} in {{ic|/etc/php/php.ini}}:<br />
{{Note|{{Pkg|php-gd}} requires {{Pkg|libpng}}, {{Pkg|libjpeg-turbo}}, and {{Pkg|freetype2}}.}}<br />
extension=gd.so<br />
<br />
{{Note|Pay attention to which extension you uncomment, as this extension is sometimes mentioned in an explanatory comment before the actual line you want to uncomment.}}<br />
<br />
* If you want the {{ic|mcrypt}} module, install {{Pkg|php-mcrypt}} and uncomment {{ic|1=extension=mcrypt.so}} in {{ic|/etc/php/php.ini}}:<br />
extension=mcrypt.so<br />
<br />
* Remember to add a file handler for {{ic|.phtml}}, if you need it, in {{ic|/etc/httpd/conf/extra/php5_module.conf}}:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
==== Using php5 with apache2-mpm-worker and mod_fcgid ====<br />
* Uncomment following in {{ic|/etc/conf.d/apache}}:<br />
HTTPD=/usr/bin/httpd.worker<br />
<br />
* Uncomment following in {{ic|/etc/httpd/conf/httpd.conf}}:<br />
Include conf/extra/httpd-mpm.conf<br />
<br />
* [[Pacman|Install]] the {{pkg|mod_fcgid}} and {{Pkg|php-cgi}} packages from the [[official repositories]].<br />
<br />
* Create {{ic|/etc/httpd/conf/extra/php5_fcgid.conf}} with following content:<br />
{{hc|/etc/httpd/conf/extra/php5_fcgid.conf|<nowiki><br />
# Required modules: fcgid_module<br />
<br />
<IfModule fcgid_module><br />
AddHandler php-fcgid .php<br />
AddType application/x-httpd-php .php<br />
Action php-fcgid /fcgid-bin/php-fcgid-wrapper<br />
ScriptAlias /fcgid-bin/ /srv/http/fcgid-bin/<br />
SocketPath /var/run/httpd/fcgidsock<br />
SharememPath /var/run/httpd/fcgid_shm<br />
# If you don't allow bigger requests many applications may fail (such as WordPress login)<br />
FcgidMaxRequestLen 536870912<br />
PHP_Fix_Pathinfo_Enable 1<br />
# Path to php.ini – defaults to /etc/phpX/cgi<br />
DefaultInitEnv PHPRC=/etc/php/<br />
# Number of PHP childs that will be launched. Leave undefined to let PHP decide.<br />
#DefaultInitEnv PHP_FCGI_CHILDREN 3<br />
# Maximum requests before a process is stopped and a new one is launched<br />
#DefaultInitEnv PHP_FCGI_MAX_REQUESTS 5000<br />
<Location /fcgid-bin/><br />
SetHandler fcgid-script<br />
Options +ExecCGI<br />
</Location><br />
</IfModule></nowiki><br />
}}<br />
<br />
* Create the needed directory and symlink it for the PHP wrapper:<br />
# mkdir /srv/http/fcgid-bin<br />
# ln -s /usr/bin/php-cgi /srv/http/fcgid-bin/php-fcgid-wrapper<br />
<br />
* Edit {{ic|/etc/httpd/conf/httpd.conf}}:<br />
#LoadModule php5_module modules/libphp5.so<br />
LoadModule fcgid_module modules/mod_fcgid.so<br />
Include conf/extra/php5_fcgid.conf<br />
<br />
* Make sure {{ic|/etc/php/php.ini}} has the directive enabled:<br />
cgi.fix_pathinfo=1<br />
and [[Daemons|restart]] '''httpd'''.<br />
<br />
{{Note|1=As of Apache 2.4 you can now use [http://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html mod_proxy_fcgi] (part of the official distribution) with PHP-FPM (and the new event MPM). See this [http://wiki.apache.org/httpd/PHP-FPM configuration example].}}<br />
<br />
=== MariaDB ===<br />
* Configure MySQL/MariaDB as described in [[MariaDB]].<br />
<br />
* Uncomment [http://www.php.net/manual/en/mysqlinfo.api.choosing.php at least one] of the following lines in {{ic|/etc/php/php.ini}}:<br />
extension=pdo_mysql.so<br />
extension=mysqli.so<br />
{{Warning|As of PHP 5.5, mysql.so is [http://www.php.net/manual/de/migration55.deprecated.php deprecated] and will fill up your log files.}}<br />
<br />
* You can add minor privileged MySQL users for your web scripts. You might also want to edit {{ic|/etc/mysql/my.cnf}} and uncomment the {{ic|skip-networking}} line so the MySQL server is only accessible by the localhost. You have to restart MySQL for changes to take effect. <br />
<br />
* [[Daemons|Restart]] the '''httpd''' daemon.<br />
<br />
{{Tip|You may want to install a tool like [[phpMyAdmin]], [[Adminer]] or {{AUR|mysql-workbench}} to work with your databases.}}<br />
<br />
== External links ==<br />
* [http://www.apache.org/ Apache Official Website]<br />
* [http://www.php.net/ PHP Official Website]<br />
* [https://mariadb.org/ MariaDB Official Website]<br />
* [http://www.akadia.com/services/ssh_test_certificate.html Tutorial for creating self-signed certificates]<br />
* [http://wiki.apache.org/httpd/CommonMisconfigurations Apache Wiki Troubleshooting]</div>Secret2008