https://wiki.archlinux.org/api.php?action=feedcontributions&user=Jambus85&feedformat=atomArchWiki - User contributions [en]2024-03-29T02:35:07ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Plymouth&diff=126473Plymouth2010-12-31T14:00:46Z<p>Jambus85: /* Power Off */ grammatical correction</p>
<hr />
<div>[[Category: Boot process (English)]]<br />
[[Category: Eye candy (English)]]<br />
{{i18n|Plymouth}}<br />
<br />
[http://fedoraproject.org/wiki/Releases/FeatureBetterStartup Plymouth] is a project from Fedora that provides a flicker-free graphical boot process. It relies on [[kernel mode setting]] to set the native resolution of the display as early as possible, then provides an eye-candy splash screen leading up to the login manager.<br />
<br />
==Installation==<br />
<br />
{{Note|Kernel mode setting is currently only available for Intel and ATI graphics cards (as of Kernel 2.6.32). Plymouth can run without it, but may fall back to its text-mode plugin.}}<br />
<br />
{{Warning|Plymouth is currently under heavy development and may contain bugs}}<br />
<br />
Before you can use Plymouth, you must enable kernel mode setting. Please refer to the instructions [[ATI#AMD.2FAti_cards_and_KernelModeSetting_.28KMS.29|for ATI cards]] and [[Intel#KMS_.28Kernel_Mode_Setting.29|for Intel cards]]. Both of these require you to rebuild your kernel image. You will also have to do that later on in this article, so you may wish to skip that step for now.<br />
<br />
If you don't have KMS you will need to use [[Framebuffer#Framebuffer_Resolution|framebuffer]] instead. <br />
{{Note|This may well not work. Plymouth is designed to work '''with''' KMS, although it can sometimes work with framebuffer.}}<br />
<br />
Grab Plymouth from the [[AUR]]. It is best to use the [http://aur.archlinux.org/packages.php?ID=26117 git version], as this is most up to date and likely to work better.<br />
<br />
Instructions on installing packages from the AUR are available [[AUR_User_Guidelines#Installing_Packages_from_the_AUR|here]].<br />
<br />
==Configuration==<br />
<br />
First of all, set a theme for plymouth. Plymouth comes with a selection of themes:<br />
#Fade-in: "Simple theme that fades in and out with shimmering stars"<br />
#Glow: "Corporate theme with pie chart boot progress followed by a glowing emerging logo"<br />
#Solar: "Space theme with violent flaring blue star" and <br />
#Spinfinty: "Simple theme that shows a rotating infinity sign in the center of the screen"<br />
You can preview the themes without rebooting. Hit Ctrl+Alt+F2 to change to console, log in as root and type<br />
plymouthd<br />
plymouth --show-splash<br />
To quit the preview log into another console as root and type<br />
plymouth --quit<br />
<br />
Set your desired theme with plymouth-set-default-theme utility, eg:<br />
$ su<br />
# plymouth-set-default-theme spinfinity<br />
<br />
Add plymouth to the hooks array in mkinitcpio.conf. It '''must''' be added ''after'' base udev and autodetect for it to work.<br />
# nano /etc/mkinitcpio.conf<br />
<br />
{{Warning|If you use [[System Encryption with LUKS for dm-crypt|hard drive encryption]] using the encrypt hook, you '''must''' replace ''encrypt'' with ''plymouth-encrypt'' in order to get password prompts. You will not be able to boot the machine if you do not.}}<br />
Add plymouth to the hooks array:<br />
HOOKS="base udev autodetect plymouth ..."<br />
<br />
Rebuild your kernel image:<br />
# mkinitcpio -p kernel26<br />
<br />
Grub now needs configuring to work with plymouth:<br />
# nano /boot/grub/menu.lst<br />
<br />
If you have KMS enabled, at the end of your kernel line remove any VGA= statement. If you don't have KMS you will need to use framebuffer and so will need to add a VGA= statement. In either case, add "quiet splash" on the end:<br />
kernel /vmlinuz26 root=/dev/disk/by-uuid/xxxx ro quiet splash<br />
<br />
Finally, the plymouth daemon has to be killed towards the end of the boot process. This can be done with a command in rc.local:<br />
# nano /etc/rc.local<br />
<br />
and add the line<br />
/bin/plymouth quit --retain-splash<br />
<br />
Reboot, and enjoy the eye-candy start-up!<br />
<br />
==Changing the Theme==<br />
<br />
As mentioned above, plymouth comes with several themes. If you wish to try a different one, simply issue<br />
# plymouth-set-default-theme ''themename''<br />
<br />
Rebuild your kernel image:<br />
# mkinitcpio -p kernel26<br />
<br />
And reboot.<br />
<br />
==Troubleshooting==<br />
<br />
===Small black squares===<br />
For some reason on both my computers (a laptop with an ATI graphics card and KMS, and my desktop with an nVidia card and framebuffer) the command to quit plymouth left small black squares around the top of my screen which attached themselves permanently to any window which passed under them. The issue was caused by the --retain-splash option which is required to keep the boot process as seamless as possible. If you are having this problem, the work-around is to kill plymouth ''after'' login, when the --retain-splash option is no longer needed.<br />
{{Note|This requires the use of [sudo] or root privileges.}}<br />
<br />
Edit /etc/rc.local again and remove the "/bin/plymouth quit --retain-splash" line.<br />
<br />
As yourself, edit xinitrc and add a line to kill plymouth. <br />
{{Warning|This must be '''above''' the line which starts your session (eg exec startxfce4) or your desktop session '''will not start'''}}<br />
$ nano ~/.xinitrc<br />
<br />
And add<br />
sudo /bin/plymouth quit &<br />
<br />
Note the lack of --retain-splash and the additional & sign on the end. This is required so that the xinitrc script will go on to start your desktop session.<br />
<br />
You now need to give yourself permission to kill the plymouth daemon without a password, by editing the sudoers file:<br />
$ su<br />
# EDITOR=nano visudo<br />
<br />
And add<br />
''yourusername'' ALL=(ALL) NOPASSWD: /bin/plymouth<br />
<br />
Reboot, and all should be well.<br />
<br />
===Power Off===<br />
<br />
If you have trouble with Power Off, e.g. your computer reboots instead of shutting down, it's maybe due to KMS or Plymouth.<br />
If it's Plymouth, launch "plymouth --mode ..." in case of reboot or halt. It could also be misunderstand by your computer's hardware.<br />
First, edit : <br />
<br />
# nano /etc/rc.d/functions.d/plymouth.functions<br />
<br />
And comment the following block: <br />
<br />
if [ "$0" == "/etc/rc.shutdown" ]; then<br />
...<br />
fi<br />
<br />
==Credits==<br />
<br />
Thanks to drf for his [http://bbs.archlinux.org/viewtopic.php?id=81406 excellent forum post] on which this wiki article is based.</div>Jambus85https://wiki.archlinux.org/index.php?title=Gitweb&diff=125298Gitweb2010-12-14T13:37:33Z<p>Jambus85: /* Installation */ linking (instead of copying) allows updates</p>
<hr />
<div>Gitweb is the default web interface provided with git itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you fitst have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to link the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
ln -s /usr/share/gitweb /srv/http/gitweb<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/srv/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:<br />
setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" )<br />
url.redirect += ( "^/gitweb$" => "/gitweb/" )<br />
alias.url += ( "/gitweb/" => "/usr/share/gitweb/" )<br />
$HTTP["url"] =~ "^/gitweb/" {<br />
cgi.assign = (".cgi" => "")<br />
server.indexfiles = ("gitweb.cgi")<br />
}<br />
<br />
<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
$projectroot = "/path/to/your/repositories";<br />
$git_temp = "/tmp";<br />
$projects_list = $projectroot;<br />
<br />
Be sure to change the "/path/to/your/repositories" to the path you want your repositories in.<br />
<br />
Now the the configuration is done, please restart apache or lighttpd by executing:<br />
/etc/rc.d/httpd restart (apache) or /etc/rc.d/lighttpd restart (lighttpd)<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
Do know that this git:// protocol is read only!<br />
<br />
Edit configuration file for git-dameon /etc/conf.d/git-daemon.conf (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
/etc/rc.d/git-daemon start<br />
<br />
To run the git-daemon every time at boot, just append git-deamon to DAEMONS line in /etc/rc.conf file.<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Jambus85https://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=125288Apache HTTP Server2010-12-14T12:57:58Z<p>Jambus85: /* Virtual Hosts */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Web Server (English)]]<br />
{{i18n|LAMP}}<br />
[[de:LAMP Installation]]<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 />
# grep http /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 />
* Customize your config. At least change {{Filename|httpd.conf}} and {{Filename|extra/httpd-default.conf}} to your liking. For security reasons, you might want to change '''ServerTokens Full''' to '''ServerTokens Prod''' and '''ServerSignature On''' to '''ServerSignature Off''' in {{Filename|extra/httpd-default.conf}}.<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 />
====User dirs====<br />
* If you do not want user directories to be available on the web (e.g., {{Filename|~/public_html}} on the machine is accessed as http://localhost/~user/), comment the following line in {{Filename|/etc/httpd/conf/httpd.conf}} since they are activated by default:<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 {{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 />
====SSL====<br />
Create self-signed certificate (you can change key size and days of validity)<br />
# cd /etc/httpd/conf<br />
# openssl genrsa -des3 -out server.key 1024<br />
# openssl req -new -key server.key -out server.csr<br />
# cp server.key server.key.org<br />
# openssl rsa -in server.key.org -out server.key<br />
# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt<br />
In {{Filename|/etc/httpd/conf/httpd.conf}} uncomment line<br />
Include conf/extra/httpd-ssl.conf<br />
Restart apache<br />
# /etc/rc.d/httpd restart<br />
<br />
====Virtual Hosts====<br />
If you want to have more than one host, make sure you have<br />
<pre><br />
# Virtual hosts<br />
Include conf/extra/httpd-vhosts.conf<br />
</pre><br />
commented out in {{Filename|/etc/httpd/conf/httpd.conf}}.<br />
<br />
In {{Filename|/etc/httpd/conf/extra/httpd-vhosts.conf}} set your virtual hosts according the example, e.g.:<br />
<pre><br />
NameVirtualHost 127.0.0.1<br />
<br />
<VirtualHost 127.0.0.1><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 127.0.0.1><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 />
</pre><br />
<br />
Add your virtual host names to your {{Filename|/etc/hosts}} file:<br />
<pre>127.0.0.1 domainname1.dom<br />
127.0.0.1 domainname2.dom</pre><br />
<br />
Restart Apache:<br />
<pre>sudo /etc/rc.d/httpd restart</pre><br />
<br />
If you setup your virtual hosts to be in your user directory, sometimes it interferes with Apaches 'Userdir' settings. To avoid problems disable 'Userdir' by commenting it out:<br />
<pre><br />
# User home directories<br />
#Include conf/extra/httpd-userdir.conf</pre><br />
<br />
As said above, take care, you have the proper permissions:<br />
<pre>sudo chmod 0775 /home/yourusername/</pre><br />
<br />
If you have a huge amount of virtual hosts you easily want to dis- and enable, its recommended to create one config file per virtualhost and store them all in one folder, eg: {{Filename|/etc/httpd/conf/vhosts}}.<br />
<br />
First create the folder:<br />
<pre>sudo mkdir /etc/httpd/conf/vhosts</pre><br />
<br />
Then place the single config files in them:<br />
<pre>sudo nano /etc/httpd/conf/vhosts/domainname1.dom<br />
sudo nano /etc/httpd/conf/vhosts/domainname2.dom<br />
...</pre><br />
<br />
In the last step, "Include" the single configs in your {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
<pre>#Enabled Vhosts:<br />
Include conf/vhosts/domainname1.dom<br />
#Include conf/vhosts/domainname1.dom</pre><br />
<br />
You can enable and disable single virtual hosts by commenting them out or uncommenting them.<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 />
If you setup Apache for local development you may want it to be only accessable from your computer. So change this line to:<br />
# Listen 127.0.0.1:80<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 />
# AllowOverride None<br />
This directive in <Directory> sections causes apache to completely ignore .htaccess files. If you intend to use rewrite mod or other settings in .htaccess files, you can allow which directives declared in that file can override server configuration. For more info refer to http://httpd.apache.org/docs/current/mod/core.html#allowoverride<br />
<br />
{{Note|If you have issues with your configuration you can have apache check the configuration with:<br />
{{Codeline|apachectl configtest}}}}<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 />
{{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 this file does not exist, just place the following in /srv/http/test.php:<br />
<?php phpinfo(); ?><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 />
* 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 />
: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/<br />
* http://www.akadia.com/services/ssh_test_certificate.html<br />
* http://wiki.apache.org/httpd/CommonMisconfigurations</div>Jambus85https://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=125287Apache HTTP Server2010-12-14T12:57:43Z<p>Jambus85: /* Virtual Hosts */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category:Web Server (English)]]<br />
{{i18n|LAMP}}<br />
[[de:LAMP Installation]]<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 />
# grep http /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 />
* Customize your config. At least change {{Filename|httpd.conf}} and {{Filename|extra/httpd-default.conf}} to your liking. For security reasons, you might want to change '''ServerTokens Full''' to '''ServerTokens Prod''' and '''ServerSignature On''' to '''ServerSignature Off''' in {{Filename|extra/httpd-default.conf}}.<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 />
====User dirs====<br />
* If you do not want user directories to be available on the web (e.g., {{Filename|~/public_html}} on the machine is accessed as http://localhost/~user/), comment the following line in {{Filename|/etc/httpd/conf/httpd.conf}} since they are activated by default:<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 {{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 />
====SSL====<br />
Create self-signed certificate (you can change key size and days of validity)<br />
# cd /etc/httpd/conf<br />
# openssl genrsa -des3 -out server.key 1024<br />
# openssl req -new -key server.key -out server.csr<br />
# cp server.key server.key.org<br />
# openssl rsa -in server.key.org -out server.key<br />
# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt<br />
In {{Filename|/etc/httpd/conf/httpd.conf}} uncomment line<br />
Include conf/extra/httpd-ssl.conf<br />
Restart apache<br />
# /etc/rc.d/httpd restart<br />
<br />
====Virtual Hosts====<br />
If you want to have more than one host, get sure you have<br />
<pre><br />
# Virtual hosts<br />
Include conf/extra/httpd-vhosts.conf<br />
</pre><br />
commented out in {{Filename|/etc/httpd/conf/httpd.conf}}.<br />
<br />
In {{Filename|/etc/httpd/conf/extra/httpd-vhosts.conf}} set your virtual hosts according the example, e.g.:<br />
<pre><br />
NameVirtualHost 127.0.0.1<br />
<br />
<VirtualHost 127.0.0.1><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 127.0.0.1><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 />
</pre><br />
<br />
Add your virtual host names to your {{Filename|/etc/hosts}} file:<br />
<pre>127.0.0.1 domainname1.dom<br />
127.0.0.1 domainname2.dom</pre><br />
<br />
Restart Apache:<br />
<pre>sudo /etc/rc.d/httpd restart</pre><br />
<br />
If you setup your virtual hosts to be in your user directory, sometimes it interferes with Apaches 'Userdir' settings. To avoid problems disable 'Userdir' by commenting it out:<br />
<pre><br />
# User home directories<br />
#Include conf/extra/httpd-userdir.conf</pre><br />
<br />
As said above, take care, you have the proper permissions:<br />
<pre>sudo chmod 0775 /home/yourusername/</pre><br />
<br />
If you have a huge amount of virtual hosts you easily want to dis- and enable, its recommended to create one config file per virtualhost and store them all in one folder, eg: {{Filename|/etc/httpd/conf/vhosts}}.<br />
<br />
First create the folder:<br />
<pre>sudo mkdir /etc/httpd/conf/vhosts</pre><br />
<br />
Then place the single config files in them:<br />
<pre>sudo nano /etc/httpd/conf/vhosts/domainname1.dom<br />
sudo nano /etc/httpd/conf/vhosts/domainname2.dom<br />
...</pre><br />
<br />
In the last step, "Include" the single configs in your {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
<pre>#Enabled Vhosts:<br />
Include conf/vhosts/domainname1.dom<br />
#Include conf/vhosts/domainname1.dom</pre><br />
<br />
You can enable and disable single virtual hosts by commenting them out or uncommenting them.<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 />
If you setup Apache for local development you may want it to be only accessable from your computer. So change this line to:<br />
# Listen 127.0.0.1:80<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 />
# AllowOverride None<br />
This directive in <Directory> sections causes apache to completely ignore .htaccess files. If you intend to use rewrite mod or other settings in .htaccess files, you can allow which directives declared in that file can override server configuration. For more info refer to http://httpd.apache.org/docs/current/mod/core.html#allowoverride<br />
<br />
{{Note|If you have issues with your configuration you can have apache check the configuration with:<br />
{{Codeline|apachectl configtest}}}}<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 />
{{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 this file does not exist, just place the following in /srv/http/test.php:<br />
<?php phpinfo(); ?><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 />
* 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 />
: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/<br />
* http://www.akadia.com/services/ssh_test_certificate.html<br />
* http://wiki.apache.org/httpd/CommonMisconfigurations</div>Jambus85https://wiki.archlinux.org/index.php?title=WMFS&diff=92845WMFS2010-01-20T10:36:57Z<p>Jambus85: </p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{stub}}<br />
<br />
== Introduction ==<br />
[http://wmfs.info/ WMFS] (Window Manager From Scratch) is a lightweight and highly configurable tiling window manager for X. It can be configured with a configuration file, supports Xft ([http://www.freetype.org/ Freetype]) fonts and is compliant with the Extended Window Manager Hints ([http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html EWMH]) specifications. It's still under heavy development <br />
<br />
== Installation ==<br />
wmfs is available from the '''unsupported''' [AUR] . Due the high development rate its recommended to use the [http://aur.archlinux.org/packages.php?ID=26924 git] version.<br />
<br />
First you must install GIT if you don't have it.<br />
pacman -S git<br />
<br />
Go to your $BUILD directory and get the PKGBUILD files, unpack it and head into it.<br />
wget http://aur.archlinux.org/packages/wmfs-git/wmfs-git.tar.gztar <br />
xvvfz wmfs-git.tar.gz<br />
cd wmfs-git<br />
<br />
Lets make the package and install it.<br />
makepkg -s<br />
pacman -U wmfs-git-$VERSION-i686.pkg.tar.gz<br />
<br />
Create a folder for the config file and put a copy of the example config file there<br />
mkdir -p ~/.config/wmfs<br />
cp $BUILD/wmfs-git/src/wmfs-build/wmfsrc ~/config/wmfs<br />
<br />
To use wmfs as windowmanager<br />
echo "exec wmfs" > ~/.xinitrc<br />
<br />
== Configuration ==<br />
The config file is quite self-explanatory. More detailed informations will follow soon.<br />
<br />
If you want to use the win-key instead of the Alt you have to replace Alt trough Super or Mod4 in the config file e.g<br />
<br />
[key] mod = { "Super" } key = "p" func = "launcher" cmd = "launcher_exec" [/key]<br />
<br />
If you press win + p the launcher in the titlebar(similar to dmenu) will be startet. It also supports tab-completition.</div>Jambus85