https://wiki.archlinux.org/api.php?action=feedcontributions&user=Bout10bucks&feedformat=atomArchWiki - User contributions [en]2024-03-28T15:48:43ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Chromium&diff=121810Chromium2010-11-19T18:29:07Z<p>Bout10bucks: </p>
<hr />
<div>[[Category:Internet and Email (English)]]<br />
Chromium is an open source graphical web browser from Google, based on the [[Wikipedia: WebKit|WebKit]] rendering engine.<br />
<br />
== Installation ==<br />
The stable version of chromium can be installed from the official repository by:<br />
# pacman -S chromium<br />
<br />
There are also beta and dev versions, which can be found in [[Arch User Repository]] under the name of [http://aur.archlinux.org/packages.php?ID=40059 chromium-beta] and [http://aur.archlinux.org/packages.php?ID=37244 chromium-dev].<br />
{{Note|Compiling chromium-beta or chromium-dev takes at least as long as compiling the linux kernel.}}<br />
<br />
There are also some packages in the AUR which provide the binary version of Google Chrome.<br />
<br />
See [http://news.softpedia.com/news/Google-Chrome-vs-Chromium-Understanding-Stable-Beta-Dev-Releases-and-Version-No-140060.shtml this article] for an explanation of the differences between the three flavours, Chromium vs. Chrome, and the version numbers.<br />
<br />
== Configuration ==<br />
=== Displaying various non-latin scripts ===<br />
To correctly display Chinese, Japanese, Korean... etc characters, see [[Fonts#Font_packages|here]] for detailed instructions to install various TrueType fonts.<br />
<br />
=== Using chromium with no desktop environment ===<br />
<br />
Unlike [[Firefox]], chromium does not maintain its own database of mimetype-to-application associations. Instead, it relies on {{Filename|xdg-open}} (part of extra/xdg-utils) to open files and, for example, [[Wikipedia: Magnet_URI_scheme|magnet links]].<br />
<br />
Inside a [[Desktop Environment|desktop environment]] (e.g. [[GNOME|Gnome]], or [[KDE|Kde]], or [[Xfce]]), {{Filename|xdg-open}} simply passes the arguments to that desktop environment's file-opener application ({{Filename|gnome-open}}, {{Filename|kde-open}}, or {{Filename|exo-open}}, respectively), which means that the associations are left up to the desktop environment.<br />
<br />
However, when no desktop environment is detected (for example when one runs a standalone [[Window Manager|window manager]], e.g. [[Openbox]]), {{Filename|xdg-open}}'s behaviour becomes rather strange and annoying: many filetypes opened in firefox or chromium itself, no support for magnet links, etc.<br />
<br />
There are a number of possible solutions to this problem, outlined below.<br />
<br />
* Improve xdg-open, make it smarter (aka "patches welcome" :P )<br />
<br />
* Use part of a desktop environment, specifically, the part which includes the file opener; for gnome, that would be 'libgnome' (and its dependencies), for xfce, 'exo'. The $DE environment variable needs to be exported before starting the window manager. For example:<br />
<blockquote>{{File|name=~/.xinitrc|content=<br />
export DE=gnome<br />
exec ck-launch-session openbox<br />
}}</blockquote><br />
<br />
* Use [http://aur.archlinux.org/packages.php?ID=32911 mimeo] (written by an arch (trusted) user) and [http://aur.archlinux.org/packages.php?ID=32912 xdg-utils-mimeo], which replaces extra/xdg-utils and contains a {{Filename|xdg-open}} script patched to make use of {{Filename|mimeo}} the same way {{Filename|gnome-open}} would be used. Mimetype<->application associations can then be customised easily in {{Filename|/etc/mime.types}} or {{Filename|~/.mime.types}}<br />
<br />
* When using openbox and no Desktop Environment (=DE) like KDE, GNOME or XFCE do following:<br />
<blockquote>{{File|name=~/.config/openbox/autostart.sh|content=<br />
export BROWSER=chromium<br />
}}</blockquote><br />
Attention: Do not export any DE environment variable !<br />
Then, you basically have to fill the ~/.local/share/applications/defaults.list file with default associations. As this can be painful, some utilities are available:<br />
* xdg-mime: not that intuitive; e.g. to use xpdf as default pdf viewer:<br />
$ xdg-mime default xpdf.desktop application/pdf<br />
* mimetype (perl-file-mimeinfo package): more intuitive; e.g. to select default application for a given extension (you need a sample file):<br />
$ mimetype -d file.extension<br />
<br />
This should create an entry in your local mime database:<br />
<blockquote>{{File|name=~/.local/share/applications/defaults.list|content=<br />
[Default Applications]<br />
text/html=chromium.desktop<br />
application/pdf=xpdf.desktop<br />
}}</blockquote><br />
Restart chromium and your pdf files should be opened with xpdf now.<br />
For me it only worked as normal user - as root I had problems cause no directories for the local mime times were created.<br />
See also this thread [https://bbs.archlinux.org/viewtopic.php?id=93956].<br />
<br />
You could also try installing perl-file-mimeinfo<br />
<br />
=== Font Rendering ===<br />
Chromium is now supposed to use the settings in {{Filename|~/.fonts.conf}}, though you may have to edit it manually (see [[Font_Configuration#Basic_settings|Font Configuration]]). If the fonts are still rendered badly you can use xft settings [[Xdefaults|as suggested here]]. Just create {{Filename|~/.Xdefaults}} if it doesn't exist and add in:<br />
<pre><br />
! Xft settings ---------------------------------------------------------------<br />
<br />
Xft.dpi: 96<br />
Xft.antialias: true<br />
Xft.rgba: rgb<br />
Xft.hinting: true<br />
Xft.hintstyle: hintslight<br />
</pre><br />
<br />
{{Note|these settings will affect any application that reads {{Filename|~/.Xdefaults}}, not just chromium; one example is [[Rxvt-unicode|rxvt-unicode]].}}<br />
<br />
=== Default browser ===<br />
The simpliest way to make chromium the default browser is to set variable $BROWSER=chromium in ~/.bashrc (depends on your shell, e.g. ~/.zshrc for zsh)<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=chromium<br />
fi<br />
<br />
The other way is to edit the ''xdg-open'' script.<br />
$ sudo $YOUR_EDITOR /usr/bin/xdg-open<br />
At almost the bottom on the file, is a long horizontal list of browsers:<br />
if [ x"$DE" = x"" ]; then<br />
# if BROWSER variable is not set, check some well known browsers instead<br />
if [ x"$BROWSER" = x"" ]; then<br />
BROWSER=links2:links:lynx:w3m<br />
if [ -n "$DISPLAY" ]; then<br />
BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER<br />
fi<br />
fi<br />
DE=generic<br />
fi<br />
Add '''chromium:''' ''(mind the colon which separates the entries)'' before '''firefox:mozilla:''' ... and save. To test if this were conducted successfully, type this into your terminal:<br />
<pre>$ xdg-open http://google.com</pre><br />
If everything went perfect, either a new tab inside Chromium, or a new window would open and display the Google homepage, depending on your settings.<br />
<br />
Another option, when using '''mimeo''', is to associate "http://" links with chromium:<br />
{{File|name=~/.mime.types|content=<nowiki><br />
/usr/bin/chromium<br />
^http://<br />
</nowiki>}}<br />
<br />
=== Flash Player ===<br />
<br />
If running i686 Arch Linux, all one needs to do is to install the flash plugin and restart chromium:<br />
# pacman -S flashplugin<br />
<br />
For x86_64, one [http://www.archlinux.org/news/508/ needs to enable] the new [multilib] repository.<br />
# pacman -S flashplugin<br />
<br />
=== Open PDF files inside Chromium ===<br />
<br />
There are two ways to do this: The first one by using Google Chrome's own PDF rendering plugin, the second by allowing Chromium access to e. g. Adobe Reader via the mozplugger plugin.<br />
<br />
==== libpdf.so ====<br />
<br />
libpdf is Google's own implementation of a PDF renderer. While compatible, it is currently only part of Chrome releases, not Chromium ones. The easiest way to add it to the latter is:<br />
<br />
Download a Google Chrome release that corresponds to the version of Chromium you use.<br />
<br />
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_i386.deb<br />
<br />
$ wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb<br />
<br />
Extract and fetch {{Filename|libpdf.so}} from {{Filename|/opt/google/chrome/}} in {{Filename|data.tar.lzma}}.<br />
<br />
Move the file to {{Filename|/usr/lib/chromium}}. A change of its file permissions may be necessary (the permission of libpdf.so should be 755).<br />
<br />
Start Chromium and open about:plugins. "Chrome PDF Viewer" should now view; it may need to be enabled.<br />
<br />
==== mozplugger ====<br />
<br />
To use mozplugger, a small edit to its sources is required: Grab its [http://aur.archlinux.org/packages.php?ID=9458 PKGBUILD] from AUR and download the sources with: <br />
<br />
$ makepkg -o<br />
<br />
Next open up {{Filename|mozplugger.c}} and search for "NPPVpluginNeedsXEmbed". Change the line directly below from:<br />
<br />
$ *((NPBool *)value) = …;<br />
<br />
to:<br />
<br />
$ *((NPBool *)value) = 1;"<br />
<br />
After the change execute:<br />
<br />
$ makepkg -ei<br />
<br />
to build and install without overwriting the source.<br />
<br />
=== Certificates ===<br />
<br />
Chromium uses [[Nss | NSS]] for the certificate management. Actually there is no graphical user interface for NSS therefore you can use the CLI.<br />
<br />
== Tips and tricks ==<br />
=== Profile in tmpfs ===<br />
The default Chromium profile is typically located in {{filename|$HOME/.config/chromium}}. This profile can be relocated to an available [http://en.wikipedia.org/wiki/Tmpfs tmpfs] filesystem, including <tt>/tmp</tt>, or <tt>/dev/shm</tt> for improvements in application response as the the entire profile is now stored in RAM. Another benefit is a reduction in disk read and write operations, of which SSD drives benefit the most.<br />
<br />
* At system startup, call [http://en.wikipedia.org/wiki/Rsync rsync] to recursively copy the folder {{filename|/home/USER/.config/chromium}} to {{filename|/dev/shm/.chromium}}:<br />
#!/bin/bash<br />
#<br />
# /etc/rc.local<br />
#<br />
rsync -a /home/USER/.config/chromium /dev/shm/.chromium<br />
<br />
* At system shutdown, call [http://en.wikipedia.org/wiki/Rsync rsync] to recursively copy the folder {{filename|/dev/shm/.chromium}} to {{filename|/home/USER/.config/chromium}}:<br />
#!/bin/bash<br />
#<br />
# /etc/rc.local.shutdown<br />
#<br />
rsync -a --delete /dev/shm/.chromium home/USER/.config/chromium<br />
<br />
* To copy only bookmarks and the preferences file back to the disk profile:<br />
<br />
#!/bin/bash<br />
#<br />
# /etc/rc.local.shutdown<br />
#<br />
rsync -a /dev/shm/.chromium/Default/Bookmarks home/USER/.config/chromium/Bookmarks &<br />
rsync -a /dev/shm/.chromium/Default/Preferences home/USER/.config/chromium/Preferences<br />
<br />
* Specify the user data directory where the browser will look for all of its state:<br />
<br />
$ chromium --user-data-dir=/dev/shm/.chromium<br />
<br />
* Any number of command-line options may be included in the string:<br />
<br />
$ chromium --block-nonsandboxed-plugins --incognito --disable-java --safe-plugins --start-maximized --user-data-dir=/dev/shm/.chromium<br />
<br />
== Troubleshooting ==<br />
=== Default profile ===<br />
If you cannot get your default profile when you try to run chromium:<br />
<pre><br />
$ chromium<br />
[2630:2630:485325611:FATAL:chrome/browser/browser_main.cc(755)] Check failed: profile. <br />
Cannot get default profile. Trace/breakpoint trap<br />
</pre><br />
<br />
Just correct the owner of the directory {{Filename|~/.config/chromium}}, and it will work.<br />
<pre><br />
$ chown -R yourusername: ~/.config/chromium<br />
</pre><br />
<br />
== Resources ==<br />
* [http://www.chromium.org/Home Chromium homepage]<br />
* [[Wikipedia: Chromium_(web_browser)#Differences_between_Chromium_and_Google_Chrome|Differences between Chromium and Google Chrome]]<br />
* [http://googlechromereleases.blogspot.com/ Announcements and release notes for the Google Chrome browser]</div>Bout10buckshttps://wiki.archlinux.org/index.php?title=Btrfs&diff=120218Btrfs2010-10-28T21:59:35Z<p>Bout10bucks: </p>
<hr />
<div>Btrfs is a new copy on write filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Initially developed by Oracle, Btrfs is licensed under the GPL and open for contribution from anyone.<br />
Linux has a wealth of filesystems to choose from, but we are facing a number of challenges with scaling to the large storage subsystems that are becoming common in today's data centers. Filesystems need to scale in their ability to address and manage large storage, and also in their ability to detect, repair and tolerate errors in the data stored on disk.<br />
Btrfs is under heavy development, but every effort is being made to keep the filesystem stable and fast. As of 2.6.31, they only plan to make forward compatible disk format changes.<br />
'''Note: Btrfs does not yet have a fsck tool that can fix errors. While Btrfs is stable on a stable machine, it is currently possible to corrupt a filesystem irrecoverably if your machine crashes or loses power on disks that don't handle flush requests correctly. This will be fixed when the fsck tool is ready.'''<br />
<br />
== Installation ==<br />
To install:<br />
<br />
{{Filename|# pacman -S btrfs-progs-unstable}}<br />
<br />
There are helper programs in AUR such as<br />
<br />
If using btrfs as your root filesystem, you may also want to install mkinitcpio-btrfs from AUR http://aur.archlinux.org/packages.php?ID=33376<br />
<br />
This package will install a mkinitcpio hook intended for those who wish to have a single or multi-drive BTRFS file system as their / (root). the hook will ensure that the chosen root device from the kernel command line is intact and safe to boot. If root is not a BTRFS device, the hook is quietly skipped<br />
<br />
== Basic Use ==<br />
<br />
To format a device to btrfs<br />
<br />
{{Filename|mkfs.btrfs [options] dev [dev ...]}}<br />
<br />
You can select multiple devices to create a raid. Supported raids include raid1, raid0, and raid 10. By default, metadata is mirrored and data is striped<br />
<br />
One of the features of btrfs is the use of subvolumes. Subvolumes are basically a named btree that holds files and directories. They have inodes inside the tree of tree roots and can have non-root owners and groups. Subvolumes can be given a quota of blocks, and once this quota is reached no new writes are allowed. All of the blocks and file extents inside of subvolumes are reference counted to allow snapshotting. Similar to the dynamically expanding storage of a virtual machine that will only use as much space on a device as needed. Eliminating several half-filled partitions. You can also mount the subvolumes with different mount options giving more flexibility in security. <br />
<br />
To create a subvolume<br />
<br />
{{Filename|btrfs subvolume create [<dest>/]<name>}}<br />
<br />
For flexibility, you should install your system INTO A DEDICATED SUBVOLUME, and use:<br />
rootflags=subvol=<whatever you called the subvol><br />
on your kernel boot line/menu.lst. It makes system rollbacks possible.<br />
<br />
If using for your root partition you'll want to add crc32c to the modules array in your mkinitcpio.conf ({{Filename|/etc/mkinitcpio.conf}}) as well as add btrfs to the HOOKS array<br />
<br />
To create a snapshot<br />
<br />
{{Filename|btrfs subvolume snapshot <source> [<dest>/]<name>}}<br />
<br />
== Resources ==<br />
Btrfs Wiki https://btrfs.wiki.kernel.org<br />
<br />
Arch Forums "Fresh Install with Btrfs" https://bbs.archlinux.org/viewtopic.php?pid=794046<br />
<br />
Arch Forums "BTRFS mkinitcpio hook" https://bbs.archlinux.org/viewtopic.php?id=88195</div>Bout10buckshttps://wiki.archlinux.org/index.php?title=Btrfs&diff=120217Btrfs2010-10-28T21:24:06Z<p>Bout10bucks: Created page with "Btrfs is a new copy on write filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Initially developed b..."</p>
<hr />
<div>Btrfs is a new copy on write filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Initially developed by Oracle, Btrfs is licensed under the GPL and open for contribution from anyone.<br />
Linux has a wealth of filesystems to choose from, but we are facing a number of challenges with scaling to the large storage subsystems that are becoming common in today's data centers. Filesystems need to scale in their ability to address and manage large storage, and also in their ability to detect, repair and tolerate errors in the data stored on disk.<br />
Btrfs is under heavy development, but every effort is being made to keep the filesystem stable and fast. As of 2.6.31, they only plan to make forward compatible disk format changes.<br />
'''Note: Btrfs does not yet have a fsck tool that can fix errors. While Btrfs is stable on a stable machine, it is currently possible to corrupt a filesystem irrecoverably if your machine crashes or loses power on disks that don't handle flush requests correctly. This will be fixed when the fsck tool is ready.'''<br />
<br />
== Installation ==<br />
To install:<br />
<br />
{{Filename|# pacman -S btrfs-progs-unstable}}<br />
<br />
There are helper programs in AUR such as<br />
<br />
== Basic Use ==<br />
<br />
To format a device to btrfs<br />
<br />
{{Filename|mkfs.btrfs [options] dev [dev ...]}}<br />
<br />
You can select multiple devices to create a raid. Supported raids include raid1, raid0, and raid 10. By default, metadata is mirrored and data is striped<br />
<br />
One of the features of btrfs is the use of subvolumes. Subvolumes are basically a named btree that holds files and directories. They have inodes inside the tree of tree roots and can have non-root owners and groups. Subvolumes can be given a quota of blocks, and once this quota is reached no new writes are allowed. All of the blocks and file extents inside of subvolumes are reference counted to allow snapshotting. Similar to the dynamically expanding storage of a virtual machine that will only use as much space on a device as needed. Eliminating several half-filled partitions. You can also mount the subvolumes with different mount options giving more flexibility in security. <br />
<br />
If using for your root partition you'll want to add crc32c to the modules array in your mkinitcpio.conf ({{Filename|/etc/mkinitcpio.conf}})<br />
<br />
== Resources ==<br />
Btrfs Wiki https://btrfs.wiki.kernel.org<br />
<br />
Arch Forums "Fresh Install with Btrfs" https://bbs.archlinux.org/viewtopic.php?pid=794046</div>Bout10buckshttps://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=107257Apache HTTP Server2010-05-26T04:47:05Z<p>Bout10bucks: how to check apache config</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Web Server (English)]]<br />
{{i18n|LAMP}}<br />
<br />
This article describes how to set up the Apache web server on an Arch Linux system. It also tells how to optionally install PHP and MySQL and integrate these in the Apache server. This combination is commonly referred to as '''LAMP''' (Linux Apache MySQL PHP).<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 />
# pacman -S apache php php-apache mysql<br />
<br />
This document assumes you will install Apache, PHP and MySQL together. If desired however, you may install Apache, PHP, and MySQL separately and simply refer to the relevant sections below.<br />
<br />
{{Note|New default user and group: Instead of group "nobody", apache now runs as user/group "http" by default. You might want to adjust your httpd.conf according to this change, though you may still run httpd as nobody.}}<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 {{filename|/etc/httpd/conf/httpd.conf}}<br />
<br />
* Check for the existence of the http user by looking for ''http'' in the output of the following command:<br />
# cat /etc/passwd<br />
<br />
* Create the system user http if it does not exist already:<br />
# useradd -d /srv/http -r -s /bin/false -U http<br />
:This creates the http user with home directory {{filename|/srv/http/}}, as a system account (-r), with a bogus shell (-s {{filename|/bin/false}}) and creates a group with the same name (-U).<br />
<br />
* Add this line to {{Filename|/etc/hosts}} (If the file does not exist, create it.):<br />
127.0.0.1 localhost.localdomain localhost<br />
:If you want a different hostname, append it to the end:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* Edit {{Filename|/etc/[[rc.conf]]}}: If you set a hostname, the {{Codeline|HOSTNAME}} variable should be the same; otherwise, use {{Codeline|"localhost"}}:<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* Make sure the hostname appears in /etc/hosts or apache will fail to start. Alternatively, you can<br />
edit {{Filename|/etc/httpd/conf/httpd.conf}} and comment the following module:<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
* Run the following in a terminal to start the HTTP server:<br />
# /etc/rc.d/httpd start<br />
<br />
:Apache should now be running. Test by visiting http://localhost/ in a web browser. It should display a simple Apache test page. If you receive a 403 Error, comment out the following line in {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
Include conf/extra/httpd-userdir.conf<br />
<br />
* To start Apache automatically at boot, edit {{Filename|/etc/rc.conf}} and add the '''httpd''' daemon:<br />
DAEMONS=(... '''httpd''' ...)<br />
:Or add this line to {{Filename|/etc/rc.local}}:<br />
/etc/rc.d/httpd start<br />
<br />
* If you want to use user directories (e.g., {{Filename|~/public_html}} on the machine is accessed as http://localhost/~user/) to be available on the web, uncomment the following lines in {{Filename|/etc/httpd/conf/extra/httpd-userdir.conf}}:<br />
UserDir public_html<br />
and<br />
<Directory /home/*/public_html><br />
AllowOverride FileInfo AuthConfig Limit Indexes<br />
Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI<br />
<Limit GET POST OPTIONS PROPFIND><br />
Order allow,deny<br />
Allow from all<br />
</Limit><br />
<LimitExcept GET POST OPTIONS PROPFIND><br />
Order deny,allow<br />
Deny from all<br />
</LimitExcept><br />
</Directory><br />
<br />
* You must make sure that your home directory permissions are set properly so that Apache can get there. Your home directory and {{Filename|~/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 />
There may be some other, more-secure ways of setting the permissions by creating a special group and allowing only Apache and you to enter there.<br />
<br />
====Advanced Options====<br />
These options in {{Filename|/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 />
# ServerAdmin sample@sample.com<br />
This is the admin's email-address which can be found on error-pages e.g.<br />
<br />
# DocumentRoot "/srv/http"<br />
This is the directory where you should put your web pages. Change it, if you want to, but do not forget to change the<br />
<br />
<Directory "/srv/http"><br />
to whatever you changed your DocumentRoot to, 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 Deny from all line, otherwise you will get 403 error too.<br />
<br />
{{Note|If you have issues with your {{Filename|/etc/httpd/conf/httpd.conf}} you can have apache check the file with:<br />
{{Codeline|apachectl -f /etc/httpd/conf/httpd.conf}}}}<br />
<br />
===PHP===<br />
* Install the "php-apache" package from extra using pacman.<br />
<br />
* Add these lines in {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
:Place this in the "LoadModule" list anywhere after {{Codeline|LoadModule dir_module modules/mod_dir.so}}:<br />
LoadModule php5_module modules/libphp5.so<br />
<br />
:Place this at the end of the "Include" list:<br />
Include conf/extra/php5_module.conf<br />
<br />
:In order to load this file you need to enable {{Codeline|Includes}} for your {{Codeline|DocumentRoot}}. In the {{Codeline|<Directory "/srv/http">}} section (or {{Codeline|<Directory "/path/to/documentroot">}}) find the "Options" line and append "Includes" e.g.:<br />
Options Indexes FollowSymLinks Includes<br />
<br />
{{Note|This will enable all Includes listed in {{Filename|httpd.conf}}. You may wish to check for unwanted Includes and comment them out.}}<br />
<br />
{{Note|If you do not see {{Filename|libphp.so}} in the Apache modules directory, you may have forgotten to install the ''php-apache'' package.}}<br />
<br />
* If your {{Codeline|DocumentRoot}} is not {{Codeline|/srv/http}}, add it to {{Codeline|open_basedir}} in {{Filename|/etc/php/php.ini}} as such:<br />
open_basedir=/srv/http/:/home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* Restart the Apache service to make changes take effect:<br />
# /etc/rc.d/httpd restart<br />
<br />
* A test file for PHP is included by default and can be found in {{Codeline|/srv/http}}<br />
<br />
* Remember to copy this file to <tt>~/public_html</tt> if you permitted such a configuration.<!-- Also, remember to make it executable ({{Codeline|chmod o+x test.php}}).--><br />
<br />
* Test PHP: http://localhost/test.php or http://localhost/~myname/test.php<br />
<br />
:If the PHP instruction is not executed (you see : <html>...</html>), check that you have added "Includes" to the "Options" line for your root directory.<br />
<br />
====Advanced options====<br />
* If you don't want to enable Includes for your {{Codeline|DocumentRoot}} you can add this to your {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
<br />
* Remember to add a file handler for .phtml if you need it in {{Filename|/etc/httpd/conf/extra/php5_module.conf}}:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* If you want the libGD module, install php-gd package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
{{Note|php-gd requires libpng, libjpeg, and freetype2}}<br />
;extension=gd.so<br />
to<br />
extension=gd.so<br />
<br />
: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 />
<br />
* If you want to display errors to debug your php code, change this line of {{Filename|/etc/php/php.ini}}:<br />
display_errors=Off<br />
to<br />
display_errors=On<br />
<br />
* If you want the mcrypt module, install php-mcrypt package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=mcrypt.so<br />
:to<br />
extension=mcrypt.so<br />
{{Warning|If you get error like:<br />
<pre><br />
[XXX Debug] PHP Notice: in file /index.php on line 86: date(): It is not safe to rely on the system'XXXX<br />
[XXX Debug] PHP Notice: in file /index.php on line 86: getdate(): It is not safe to rely on the system's timezone settings.XXXX</pre><br />
}}<br />
change this line of {{Filename|/etc/php/php.ini}} <br />
;date.timezone = <br />
to <br />
date.timezone = Europe/Berlin<br />
{{note| more infos about [http://php.net/manual/en/datetime.configuration.php#ini.date.timezone Time Zone in PHP] }}<br />
restart httpd with <br />
# /etc/rc.d/httpd restart<br />
<br />
===MySQL===<br />
* Configure MySQL as described in [[MySQL]].<br />
<br />
* Edit {{Filename|/etc/php/php.ini}} (this is in {{Filename|/usr/etc}} on older systems) to uncomment the following line (''By removing {{Codeline|;}}''):<br />
;extension=mysql.so<br />
<br />
:'''Caution:'''Some users have reported typos on this line. Please make sure that it reads {{Codeline|;extension&#61;mysql.so}} and not {{Codeline|;extension&#61;msql.so}}.<br />
<br />
* You can add minor privileged users for your web scripts by editing the tables found in the <tt>mysql</tt> database. You have to restart MySQL for changes to take effect. Do not forget to check the {{Codeline|mysql/users}} table. If there is a second entry for root and your hostname is left with no password set, everybody from your host probably could gain full access. Perhaps see next section for these jobs.<br />
<br />
* Run in terminal:<br />
# /etc/rc.d/mysqld start<br />
<br />
* You may also need to restart Apache. Run in terminal:<br />
# /etc/rc.d/httpd restart<br />
<br />
* MySQL should now be running. Set the root password and test it by running:<br />
# mysqladmin -u root password ''password''<br />
# mysql -u root -p<br />
<br />
:Type ''exit'' to exit from the CLI MySQL client<br />
<br />
* Edit {{Filename|/etc/rc.conf}} (to start MySQL at boot):<br />
DAEMONS=(... '''mysqld''' ...)<br />
Or add this line to {{Filename|rc.local}}:<br />
/etc/rc.d/mysqld start<br />
<br />
* You can get the {{Codeline|"error no. 2013: Lost Connection to mysql server during query"}} message instantly whenever you try to connect to the MySQL daemon by TCP/IP. This is the TCP wrappers system (tcpd), which uses the <tt>hosts_access(5)</tt> system to allow or disallow connections.<br />
<br />
* If you are running into this problem, be sure to add this to your {{Filename|/etc/hosts.allow}} file:<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* For example, a line like the following would overcome the "2013: Lost Connection" errors:<br />
# mysqld : 127.0.0.1 : ALLOW<br />
<br />
:Note: The examples above are the simplest case, telling tcpd to allow connections from anywhere. You may wish to use a more-appropriate choice of permissible sources instead of 'ALL'. Just make sure that localhost and the IP address (numeric or DNS) of the interface by which you connect are specified.<br />
<br />
* For example, a line like the following would overcome the "2013: Lost Connection" errors:<br />
# mysqld : 127.0.0.1 : ALLOW<br />
<br />
* You might also need to edit {{Filename|/etc/mysql/my.cnf}} and comment out the {{Codeline|skip-networking}} line as such:<br />
skip-networking<br />
to<br />
#skip-networking<br />
<br />
{{Tip|You may want to install [[PhpMyAdmin|phpmyadmin]] to work with your databases.}}<br />
<br />
==See also==<br />
* [[MySQL]] - Article for MySQL<br />
* [[Xampp]] - Self contained web-server that supports PHP, Perl, and MySQL<br />
<br />
==External links==<br />
* http://www.apache.org/<br />
* http://www.php.net/<br />
* http://www.mysql.com/</div>Bout10bucks