https://wiki.archlinux.org/api.php?action=feedcontributions&user=Fwalch&feedformat=atomArchWiki - User contributions [en]2024-03-28T13:30:42ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=ROS&diff=303586ROS2014-03-08T10:47:47Z<p>Fwalch: Added link to ROS wiki installation instructions (hydro AUR packages are available)</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
[http://www.ros.org ROS] is an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management.<br />
<br />
== Setup Notes - Hydro ==<br />
<br />
For ROS Hydro, see [http://wiki.ros.org/hydro/Installation/Arch Installation Instructions for Hydro in Arch Linux].<br />
<br />
== Setup Notes - Groovy ==<br />
<br />
ROS Groovy core, comm, and robot variants have meta-packages that should install all the necessary packages: {{AUR|ros-groovy-ros}}, {{AUR|ros-groovy-ros-comm}}, (TODO: robot metapackage). In addition, {{AUR|ros-groovy-rviz}} (along with its dependencies) has a package. Beware, the dependency tree goes at least five levels deep at times. {{AUR|yaourt}} handles it (somewhat), {{AUR|packer}} falls flat. It is strongly recommended that you install {{AUR|ros-groovy-ros}} first to prevent yaourt's ridiculous dependency thrashing.<br />
<br />
The packages are all available in the maintainer's github: [https://github.com/zootboy/arch-ros-stacks arch-ros-stacks]. Not all packages there are in a working state, so use with caution. Please, report any issues with the packages on their respective AUR pages.<br />
<br />
== Usage Notes - Groovy ==<br />
<br />
Due to the fact that Ubuntu and Arch handle the python2/3 binary split differently, catkin_make[_isolated] will not work on its own. To use these commands, create the following aliases in your ~/.bashrc (or equivalent):<br />
alias catkin_make='catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so'<br />
alias catkin_make_isolated='catkin_make_isolated -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so'<br />
<br />
Without these lines, cmake will default to python 3, which you don't want. It is also possible to simply add the defines into any call of catkin_make[_isolated] (which you have to do if you want to call those commands within a script).<br />
<br />
For further information on how to use ROS, see the [http://www.ros.org/wiki/ROS/Tutorials ROS Tutorials].</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Cron&diff=245731Cron2013-01-31T08:48:00Z<p>Fwalch: /* Installation */ dcron package was moved to AUR</p>
<hr />
<div>[[Category:Daemons and system services]]<br />
[[de:Cron]]<br />
[[fr:Cron]]<br />
[[sk:Cron]]<br />
[[zh-CN:Cron]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the standard task scheduling daemon on GNU/Linux systems.}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|Gentoo Linux Cron Guide|http://www.gentoo.org/doc/en/cron-guide.xml}}<br />
{{Article summary end}}<br />
{{Lowercase_title}}<br />
<br />
From [https://en.wikipedia.org/wiki/Cron Wikipedia]:<br />
<br />
'''''cron''' is the time-based job scheduler in Unix-like computer operating systems. cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration [...]''<br />
<br />
== Installation ==<br />
<br />
{{Pkg|cronie}} is installed by default as part of the '''base''' group. Other cron implementations exist if preferred, Gentoo's [http://www.gentoo.org/doc/en/cron-guide.xml Cron Guide] offers comparisons. For example, {{Pkg|fcron}}, {{AUR|dcron}} (Arch Linux's default cron implementation until May 2011), {{AUR|bcron}} or {{AUR|vixie-cron}} are other alternatives.<br />
<br />
== Configuration ==<br />
<br />
=== Users & autostart ===<br />
<br />
cron should be working upon login on a new system to run root scripts. This can be check by looking at the log in {{ic|/var/log/}}. In order to use crontab application (editor for job entries), users must be members of a designated group {{ic|users}} or {{ic|root}}, of which all users should already be members. To ensure cron starts on boot, add the {{ic|crond}} daemon to the [[Daemon#Starting_on_Boot|daemons]] array of [[rc.conf]], or if using [[systemd]] enable {{ic|cronie.service}} or {{ic|dcron.service}} depending on which cron implementation you use.<br />
<br />
=== Handling errors of jobs ===<br />
<br />
Errors can occur during execution of jobs. When this happens, cron registers the '''stderr''' output and attempts to send it as email to the user's spools via the {{ic|sendmail}} command.<br />
<br />
To log these messages use the {{ic|-M}} option in {{ic|/etc/conf.d/crond}} and write a script or install a rudimentary SMTP subsystem (e.g. {{Pkg|esmtp}}):<br />
<br />
# pacman -S esmtp procmail<br />
<br />
After installation configure the routing:<br />
{{hc|/etc/esmtprc|<br />
identity ''myself''@myisp.com<br />
hostname mail.myisp.com:25<br />
username ''"myself"''<br />
password ''"secret"''<br />
starttls enabled<br />
default<br />
mda "/usr/bin/procmail -d %T"<br />
}}<br />
<br />
Procmail needs root privileges to work in delivery mode but it is not an issue if you are running the cronjobs as root anyway.<br />
<br />
To test that everything works correctly, create a file {{ic|message.txt}} with {{ic|"test message"}} in it. <br />
<br />
From the same directory run:<br />
<br />
$ sendmail ''user_name'' < message.txt <br />
<br />
then:<br />
<br />
$ cat /var/spool/mail/''user_name''<br />
<br />
You should now see the test message and the time and date it was sent.<br />
<br />
The error output of all jobs will now be redirected to {{ic|/var/spool/mail/''user_name''}}.<br />
<br />
Due to the privileged issue, it is hard to create and send emails to root (e.g. {{ic|su -c ""}}). You can ask {{ic|esmtp}} to forward all root's email to an ordinary user with:<br />
{{hc|/etc/esmtprc|<br />
2=force_mda="''user-name''"<br />
}}<br />
<br />
{{Note|If the above test didn't work, you may try creating a local configuration in {{ic|~/.esmtprc}} with the same content.<br />
<br />
Run the following command to make sure it has the correct permission: <br />
<br />
$ chmod 710 ~/.esmtprc<br />
<br />
Then repeat the test with {{ic|message.txt}} exactly as before.}}<br />
<br />
==== Long cron job ====<br />
<br />
Suppose this program is invoked by cron :<br />
<br />
#!/bin/sh<br />
echo "I had a recoverable error!"<br />
sleep 1h<br />
<br />
What happens is this:<br />
# cron runs the script<br />
# as soon as cron sees some output, it runs your MTA, and provides it with the headers. It leaves the pipe open, because the job hasn't finished and there might be more output.<br />
# the MTA opens the connection to postfix and leaves that connection open while it waits for the rest of the body.<br />
# postfix closes the idle connection after less than an hour and you get an error like this :<br />
smtpmsg='421 … Error: timeout exceeded' errormsg='the server did not accept the mail'<br />
<br />
To solve this problem you can use the command chronic or sponge from {{Pkg|moreutils}}.<br />
From they respective man page :<br />
; chronic: chronic runs a command, and arranges for its standard out and standard error to only be displayed if the command fails (exits nonzero or crashes). If the command succeeds, any extraneous output will be hidden.<br />
; sponge: sponge reads standard input and writes it out to the specified file. Unlike a shell redirect, sponge soaks up all its input before opening the output file… If no output file is specified, sponge outputs to stdout.<br />
<br />
Even if it's not said chronic buffer the command output before opening its standard output (like sponge does).<br />
<br />
== Crontab format ==<br />
<br />
The basic format for a crontab is:<br />
<br />
<minute> <hour> <day_of_month> <month> <day_of_week> <command><br />
<br />
* ''minute'' values can be from 0 to 59.<br />
* ''hour'' values can be from 0 to 23.<br />
* ''day_of_month'' values can be from 1 to 31.<br />
* ''month'' values can be from 1 to 12.<br />
* ''day_of_week'' values can be from 0 to 6, with 0 denoting Sunday.<br />
<br />
Multiple times may be specified with a comma, a range can be given with a hyphen, and the asterisk symbol is a wildcard character. Spaces are used to separate fields. For example, the line:<br />
<br />
*0,*5 9-16 * 1-5,9-12 1-5 ~/bin/i_love_cron.sh<br />
<br />
Will execute the script {{Ic|i_love_cron.sh}} at five minute intervals from 9 AM to 4:55 PM on weekdays except during the summer months (June, July, and August). More examples and advanced configuration techniques can be found below.<br />
<br />
== Basic commands ==<br />
<br />
Crontabs should never be edited directly; instead, users should use the {{ic|crontab}} program to work with their crontabs. To be granted access to this command, user must be a member of the users group (see the {{ic|gpasswd}} command).<br />
<br />
To view their crontabs, users should issue the command:<br />
<br />
$ crontab -l<br />
<br />
To edit their crontabs, they may use:<br />
<br />
$ crontab -e<br />
<br />
To remove their crontabs, they should use:<br />
<br />
$ crontab -r<br />
<br />
If a user has a saved crontab and would like to completely overwrite their old crontab, he or she should use:<br />
<br />
$ crontab ''saved_crontab_filename''<br />
<br />
To overwrite a crontab from the command line ([[Wikipedia:stdin]]), use<br />
<br />
$ crontab - <br />
<br />
To edit somebody else's crontab, issue the following command as root:<br />
<br />
# crontab -u ''username'' -e<br />
<br />
This same format (appending {{ic|-u ''username''}} to a command) works for listing and deleting crontabs as well.<br />
<br />
To use [[nano]] rather than [[vi]] as crontab editor, add the following lines to your shell's initialization file (eg. {{ic|/etc/profile}} or {{ic|/etc/bash.bashrc}}):<br />
<br />
export EDITOR="/usr/bin/nano"<br />
<br />
And restart open shells.<br />
<br />
== Examples ==<br />
<br />
The entry:<br />
<br />
01 * * * * /bin/echo Hello, world!<br />
<br />
runs the command {{Ic|/bin/echo Hello, world!}} on the first minute of every hour of every day of every month (i.e. at 12:01, 1:01, 2:01, etc.)<br />
<br />
Similarly,<br />
<br />
*/5 * * jan mon-fri /bin/echo Hello, world!<br />
<br />
runs the same job every five minutes on weekdays during the month of January (i.e. at 12:00, 12:05, 12:10, etc.)<br />
<br />
As noted in the ''Crontab Format'' section, the line:<br />
<br />
*0,*5 9-16 * 1-5,9-12 1-5 /home/user/bin/i_love_cron.sh<br />
<br />
Will execute the script {{Ic|i_love_cron.sh}} at five minute intervals from 9 AM to 5 PM (excluding 5 PM itself) every weekday (Mon-Fri) of every month except during the summer (June, July, and August).<br />
<br />
== More information ==<br />
<br />
The cron daemon parses a configuration file known as {{ic|crontab}}. Each user on the system can maintain a separate crontab file to schedule commands individually. The root user's crontab is used to schedule system-wide tasks (though users may opt to use {{ic|/etc/crontab}} or the {{ic|/etc/cron.d}} directory, depending on which cron implementation they choose).<br />
<br />
There are slight differences between the crontab formats of the different cron daemons. The default root crontab for dcron looks like this:<br />
<br />
{{hc|/var/spool/cron/root<br />
|2=<nowiki><br />
# root crontab<br />
# DO NOT EDIT THIS FILE MANUALLY! USE crontab -e INSTEAD<br />
<br />
# man 1 crontab for acceptable formats:<br />
# <minute> <hour> <day> <month> <dow> <tags and command><br />
# <@freq> <tags and command><br />
<br />
# SYSTEM DAILY/WEEKLY/... FOLDERS<br />
@hourly ID=sys-hourly /usr/sbin/run-cron /etc/cron.hourly<br />
@daily ID=sys-daily /usr/sbin/run-cron /etc/cron.daily<br />
@weekly ID=sys-weekly /usr/sbin/run-cron /etc/cron.weekly<br />
@monthly ID=sys-monthly /usr/sbin/run-cron /etc/cron.monthly<br />
</nowiki>}}<br />
<br />
These lines exemplify one of the formats that crontab entries can have, namely whitespace-separated fields specifying:<br />
<br />
# @period<br />
# ID=jobname (this tag is specific to dcron)<br />
# command<br />
<br />
The other standard format for crontab entries is:<br />
<br />
# minute<br />
# hour<br />
# day<br />
# month<br />
# day of week<br />
# command<br />
<br />
The crontab files themselves are usually stored as {{ic|/var/spool/cron/username}}. For example, root's crontab is found at {{ic|/var/spool/cron/root}}<br />
<br />
See the crontab [[man page]] for further information and configuration examples.<br />
<br />
== run-parts issue ==<br />
<br />
cronie uses {{ic|run-parts}} to carry out script in {{ic|cron.daily}}/{{ic|cron.weekly}}/{{ic|cron.monthly}}. Be careful that the script name in these won't include a dot (.), e.g. {{ic|backup.sh}}, since {{ic|run-parts}} without options will ignore them (see: {{ic|man run-parts}}).<br />
<br />
== Running Xorg server based applications ==<br />
<br />
If you find that you can't run X apps from cron jobs then use this prefix:<br />
<br />
export DISPLAY=:0.0 ;<br />
<br />
This sets the {{ic|DISPLAY}} variable to the first display, which is usually right<br />
unless you run multiple X servers on your machine.<br />
<br />
If it still doesn't work, then you need to use {{ic|xhost}} to give your user control<br />
over X:<br />
<br />
# xhost +si:localuser:$(whoami)<br />
<br />
== Asynchronous job processing ==<br />
<br />
If you regularly turn off your computer but do not want to miss jobs, there are some solutions available (easiest to hardest):<br />
<br />
===Dcron===<br />
Vanilla dcron supports asynchronous job processing. Just put it with @hourly, @daily, @weekly or @monthly with a jobname, like this:<br />
<br />
@hourly ID=greatest_ever_job echo This job is very useful.<br />
<br />
===Cronwhip===<br />
([https://aur.archlinux.org/packages.php?ID=21079 AUR], [https://bbs.archlinux.org/viewtopic.php?id=57973 forum thread]): Script to automatically run missed cron jobs; works with the default cron implementation, dcron.<br />
<br />
===Anacron===<br />
([https://aur.archlinux.org/packages.php?ID=5196 AUR]): Full replacement for dcron, processes jobs asynchronously.<br />
<br />
===Fcron===<br />
([https://www.archlinux.org/packages/community/i686/fcron/ Community], [https://bbs.archlinux.org/viewtopic.php?id=140497 forum thread]): Like anacron, fcron assumes the computer is not always running and, unlike anacron, it can schedule events at intervals shorter than a single day. Like cronwhip, it can run jobs that should have been run during the computer's downtime.<br />
<br />
== Ensuring exclusivity ==<br />
<br />
If you run potentially long-running jobs (e.g., a backup might all of a sudden run for a long time, because of many changes or a particular slow network connection), then {{AUR|lockrun}} can ensure that the cron job won't start a second time.<br />
<br />
5,35 * * * * /usr/bin/lockrun -n /tmp/lock.backup /root/make-backup.sh</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Apache_HTTP_Server_(Italiano)&diff=40512Apache HTTP Server (Italiano)2008-04-30T15:56:00Z<p>Fwalch: Merged with "Apache and PHP Configuration"</p>
<hr />
<div>[[Category:Networking (Italiano)]]<br />
[[Category:HOWTOs (Italiano)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|LAMP}}<br />
{{i18n_entry|Italiano|LAMP (Italiano)}}<br />
{{i18n_entry|Русский|LAMP (russian)}}<br />
{{i18n_entry|Česky|LAMP_(Česky)}}<br />
{{i18n_entry|简体中文|LAMP(简体中文)}}<br />
{{i18n_entry|Español|LAMP (Español)}}<br />
{{i18n_links_end}}<br />
<br />
===Apache, PHP, and MySQL===<br />
<br />
Questo documento descrive i passi per creare un Server Web basato su Apache su Arch Linux. Spiega inoltre come installare PHP e MySQL ed integrarlo con il server Apache<br />
<br />
====Installare i Pacchetti====<br />
<br />
# pacman -Sy<br />
# pacman -S apache<br />
# pacman -S php<br />
# pacman -S mysql<br />
# pacman -S libxml2<br />
<br />
Se volete potete installare solo apache, apache e php, o tutti e tre. Questa guida assume che voi li abbiate installati tutti e tre, ma se volete potete fermarvi dopo ogni sezione.<br />
<br />
====Configurare Apache====<br />
<br />
* Aggiungete questa linea in <code>/etc/hosts</code> (se il file non esiste, createlo):<br />
127.0.0.1 localhost.localdomain localhost<br />
'''Nota:''' Se volete un hostname differente, mettetelo alla fine:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* Editate <code>/etc/rc.conf</code>: Se nel primo step avete messo un hostname, la variabile HOSTNAME deve avere lo stesso valore; altrimenti, usate "localhost":<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* Commentate un modulo nella configurazione di Apache<br />
# nano /etc/httpd/conf/httpd.conf<br />
<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
a<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
* Lanciate dal terminale (come root):<br />
# /etc/rc.d/httpd start<br />
<br />
* Apache ora dovrebbe essere attivo. Testatelo visitando <code>http://localhost/</code> nel nostro browser. Dovreste vedere una semplice pagina di test di Apache.<br />
<br />
* Editate <code>/etc/rc.conf</code> (per lanciare Apache durante il boot):<br />
DAEMONS=(''... some daemons ...'' httpd)<br />
'''Oppure''' aggiungete questa linea in <code>rc.local</code>:<br />
/etc/rc.d/httpd start<br />
<br />
* Se volete che le directory degli utenti siano accessibili dal web (es.<code>~/public_html</code> nella macchina sarà accessibile come <code>http://localhost/~user/</code> , decommentate le seguenti linee in <code>/etc/httpd/conf/extra/httpd-userdir.conf</code>:<br />
UserDir public_html<br />
e<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 />
Dovrete essere sicuri che i permessi delle vostre home directory siano settati nella maniera corretta in modo che Apache possa usarle. La vostra directory e <code>~/public_html/</code> devono essere eseguibili per Others ("il resto del mondo"). Questo può essere fatto con:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
Ci sono modi più sicuri per settare i permessi, magari creando un gruppo speciale e permettendo solo a voi e ad Apache di farne parte... dipende da quanto siete attenti alla sicurezza.<br />
<br />
=====Opzioni addizionali per Apache=====<br />
Decommentare per utilizzare.<br />
<br />
Questa opzione presente in /etc/httpd/conf/httpd.conf potrebbe interessarvi:<br />
<br />
# Listen 80<br />
<br />
Questa è la porta in ascolto di Apache. Per una connessione con un router, dovete aprire la porta.<br />
<br />
# ServerAdmin sample@sample.com<br />
<br />
Questo è l'indirizzo e-mail che troverete nelle pagine d'errore.<br />
<br />
# DocumentRoot "/home/httpd/html"<br />
<br />
Questa è la directory dove potete mettere le vostre pagine web. Cambiatela, se volete.<br />
<br />
====Configurare PHP====<br />
<br />
PHP è praticamente avviabile "out of the box" ora.<br />
<br />
* Decommentiamo la seguente riga in <code>/etc/httpd/conf/httpd.conf</code><br />
#LoadModule php5_module modules/libphp5.so<br />
<br />
* Per PHP5 la riga è già impostata:<br />
#<br />
# DirectoryIndex: sets the file that Apache will serve if a directory<br />
# is requested.<br />
#<br />
<IfModule dir_module><br />
<IfModule mod_php5.c><br />
DirectoryIndex index.php index.html<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
</IfModule><br />
DirectoryIndex index.html<br />
</IfModule><br />
<br />
* Ricordate di aggiungere il riferimento al file .phtml se necessario:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* Se volete il modulo libGD , decommentate in <code>/etc/php/php.ini</code>:<br />
;extension=gd.so<br />
a<br />
extension=gd.so<br />
<br />
* Se la vostra <code>DocumentRoot</code> è fuori da <code>/home/</code>, aggiungetela a <code>open_basedir</code> nel file <code>/etc/php/php.ini</code> come:<br />
open_basedir = /home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* Riavviate il servizio Apache perché i cambiamenti facciano effetto (da root):<br />
# /etc/rc.d/httpd restart<br />
<br />
* Testate PHP questocon un semplice script:<br />
<html><br />
<head><br />
<title>Pagina di test per PHP</title><br />
</head><br />
<br />
<body><br />
Questa è Arch Linux, con attivo PHP.<br />
<br />
<?php<br />
phpinfo();<br />
?><br />
</p><br />
</body><br />
</html><br />
<br />
Salvete questo file come <code>test.php</code> e copiatelo in <code>/home/httpd/html/</code> o in <code>~/public_html</code> secondo la configurazione adottata. Inoltre, ricordate di renderlo eseguibile (<code>chmod o+x test.php</code>).<br />
<br />
* Testiamo PHP: http://localhost/test.php o http://localhost/~myname/test.php<br />
<br />
<br />
<br />
====Setup MySQL====<br />
<br />
Seguite questi passi solo se necessitate del supporto MySQL. Configurate MySQL come descritto qui: [[MySQL (Italiano)]]<br />
<br />
* Editate <code>/etc/php/php.ini</code> (questo si trova in <code>/usr/etc</code> nei sistemi vecchi) Per decommentare le seguenti righe (<i>Rimuovendo i <code>;</code></i>):<br />
;extension=mysql.so<br />
a<br />
extension=mysql.so<br />
<br />
* Potete aggiungere degli utenti con privilegi minori per i vostri script web editando le tabelle che si trovano nel database di <code>mysql</code>. Dovete riavviare MySQL perché i cambiamenti abbiano effetto. Non dimenticate di verificare la tabella <code>mysql/users</code>. Se c'è un secondo record per root e il vostro hostname è senza alcuna password settata, chiunque dal vostro host potrà ottenere un pieno accesso. Guardate la prossima sezione per questo.<br />
<br />
* Potreste ottenere il messaggio "<code>error no. 2013: Lost Connection to mysql server during query</code>" quanto andrete a connettervi al demone MySQL da TCP/IP. Questo è il sistema di wrapping TCP (tcpd), che usa il sistema di <code>hosts_access(5)</code> per permettere o non permettere le connessioni.<br />
<br />
* Se avete questo problema, assicuratevi di aver aggiunto questa linea nel vostro file /etc/hosts.allow:<br />
<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* Note: L'esempio qui sopra è il caso semplice, stiamo dicendo a tcpd di permettere connessioni da ovunque. Potreste fare una scelta più appropriata della clausola fin troppo permissiva ALL. Assicuratevi solo che localhost e l' IP address (numerico o DNS) della interfaccia dalla quale vi collegate siano specificati.<br />
<br />
* Potrebbe anche essere necessario editare <code>/etc/my.cnf</code> e commentare la linea <code>skip-networking</code> così:<br />
<br />
skip-networking<br />
<br />
a<br />
<br />
#skip-networking</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Apache_and_PHP_Configuration&diff=40510Apache and PHP Configuration2008-04-30T15:54:02Z<p>Fwalch: Merged with LAMP</p>
<hr />
<div>#redirect [[LAMP]]</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=40509Apache HTTP Server2008-04-30T15:53:58Z<p>Fwalch: Merged with "Apache and PHP Configuration"</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|LAMP}}<br />
{{i18n_entry|Italiano|LAMP (Italiano)}}<br />
{{i18n_entry|Русский|LAMP (russian)}}<br />
{{i18n_entry|Česky|LAMP_(Česky)}}<br />
{{i18n_entry|简体中文|LAMP(简体中文)}}<br />
{{i18n_entry|Español|LAMP (Español)}}<br />
{{i18n_links_end}}<br />
<br />
===Apache, PHP, and MySQL===<br />
<br />
This document 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.<br />
<br />
====Install Packages====<br />
<br />
# pacman -Sy<br />
# pacman -S apache<br />
# pacman -S php<br />
# pacman -S mysql<br />
# pacman -S libxml2<br />
<br />
If you'd like, you can install just apache, apache and php, or all three. This document assumes you will install all three, but if you wish, you may stop after any of the sections.<br />
<br />
====Configure Apache====<br />
<br />
* Add this line to <code>/etc/hosts</code> (if the file doesn't exist, create it):<br />
127.0.0.1 localhost.localdomain localhost<br />
'''Note:''' If you want a different hostname, append it to the end:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* Edit <code>/etc/rc.conf</code>: If you set a hostname in Step One, the HOSTNAME variable should be the same; otherwise, use "localhost":<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* Comment one module in Apache configuration<br />
# nano /etc/httpd/conf/httpd.conf<br />
<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
to<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
* Run in terminal (as root):<br />
# /etc/rc.d/httpd start<br />
<br />
* Apache should now be running. Test by visiting <code>http://localhost/</code> in a web browser. It should display a simple Apache test page.<br />
<br />
* Edit <code>/etc/rc.conf</code> (to start Apache at boot):<br />
DAEMONS=(''... some daemons ...'' httpd)<br />
'''Or''' add this line to <code>rc.local</code>:<br />
/etc/rc.d/httpd start<br />
<br />
* If you want to use user directories (i.e. <code>~/public_html</code> on the machine is accessed as <code>http://localhost/~user/</code>) to be available on the web, uncomment the following lines in <code>/etc/httpd/conf/extra/httpd-userdir.conf</code>:<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 <code>~/public_html/</code> 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... You know how paranoid you are.<br />
<br />
=====Additional options=====<br />
<br />
This options in /etc/httpd/conf/httpd.conf might be interesting for you:<br />
<br />
# Listen 80<br />
<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 />
<br />
This is the admin's email-address which can be found on error-pages e.g.<br />
<br />
# DocumentRoot "/home/httpd/html"<br />
<br />
This is the directory where you should put your web pages. Change it, if you want to.<br />
<br />
<br />
====Configure PHP====<br />
<br />
PHP is practically available out of the box now.<br />
<br />
* Uncomment this line in <code>/etc/httpd/conf/httpd.conf</code><br />
#LoadModule php5_module modules/libphp5.so<br />
<br />
* For PHP5 file handlers are already set up:<br />
#<br />
# DirectoryIndex: sets the file that Apache will serve if a directory<br />
# is requested.<br />
#<br />
<IfModule dir_module><br />
<IfModule mod_php5.c><br />
DirectoryIndex index.php index.html<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
</IfModule><br />
DirectoryIndex index.html<br />
</IfModule><br />
<br />
* Remember to add a file handler for .phtml if you need it:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* If you want the libGD module, uncomment in <code>/etc/php/php.ini</code>:<br />
;extension=gd.so<br />
to<br />
extension=gd.so<br />
<br />
* If your <code>DocumentRoot</code> is outside of <code>/home/</code>, add it to <code>open_basedir</code> in <code>/etc/php/php.ini</code> as such:<br />
open_basedir = /home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* Restart the Apache service to make changes take effect (as root):<br />
# /etc/rc.d/httpd restart<br />
<br />
* Test PHP with a simple, but very informative script:<br />
<html><br />
<head><br />
<title>PHP Test Page</title><br />
</head><br />
<br />
<body><br />
This is Arch Linux, running PHP.<br />
<br />
<?php<br />
phpinfo();<br />
?><br />
</p><br />
</body><br />
</html><br />
<br />
Save this file as <code>test.php</code> and copy to <code>/home/httpd/html/</code> or to <code>~/public_html</code> if you permitted such a configuration. Also, remember to make it executable (<code>chmod o+x test.php</code>).<br />
<br />
* Test PHP: http://localhost/test.php or http://localhost/~myname/test.php<br />
<br />
<br />
<br />
====Setup MySQL support====<br />
<br />
Do these steps only if you want MySQL support. Configure MySQL as described here: [[MySQL]]<br />
<br />
* Edit <code>/etc/php/php.ini</code> (this is in <code>/usr/etc</code> on older systems) to uncomment the following line (<i>By removing <code>;</code></i>):<br />
<code>;extension=mysql.so</code><br />
<br />
* You can add minor privileged users for your web scripts by editing the tables found in the <code>mysql</code> database. You have to restart MySQL for changes to take effect. Don't forget to check the <code>mysql/users</code> table. If there's 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 />
* You can get the "<code>error no. 2013: Lost Connection to mysql server during query</code>" message instantly whenever you try to connect to the MySQL daemon by TCP/IP. This is the TCP wrappers system (tcpd), which uses the <code>hosts_access(5)</code> system to allow or disallow connections.<br />
<br />
* If you're running into this problem, be sure to add this to your /etc/hosts.allow file:<br />
<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* Notes: 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 />
* You might also need to edit <code>/etc/my.cnf</code> and comment out the <code>skip-networking</code> line as such:<br />
<br />
skip-networking<br />
<br />
to<br />
<br />
#skip-networking</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Ntpd&diff=40480Ntpd2008-04-29T18:42:14Z<p>Fwalch: redirect correction (double redirect)</p>
<hr />
<div>#REDIRECT [[Network Time Protocol]]</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Talk:Frequently_asked_questions&diff=40479Talk:Frequently asked questions2008-04-29T18:23:01Z<p>Fwalch: </p>
<hr />
<div>about six months ago I installed Arch on my laptop, and after not being able to use the laptop for a while, I have forgotten my passwords. Does anyone have an idea how to get into it with something like single user mode so that I can bypass the login, password and once in edit the administrator password? I can be reached at vincent_dorio@yahoo.com. Thanks<br />
<br />
<br />
Should this be merged with [[Arch FAQs for newbies]]? Or are they far enough apart... [[User:Alex anthony|Alex anthony]] 12:57, 29 December 2007 (EST)<br />
<br />
I think it's a very good idea - there should only be one FAQ. [[User:Jan-portugal|Jan-portugal]] 19:32, 29 December 2007 (EST)<br />
<br />
I also think it's a good idea to merge the FAQ's --[[User:Totalwormage|Totalwormage]] 09:35, 26 April 2008 (EDT)<br />
<br />
Okay, I merged the FAQs. [[User:Fwalch|Fwalch]] 14:23, 29 April 2008 (EDT)</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Frequently_asked_questions&diff=40478Frequently asked questions2008-04-29T18:18:08Z<p>Fwalch: Merged with "Arch FAQs for newbies"</p>
<hr />
<div>[[Category:About Arch (English)]]<br />
[[Category:FAQs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Dansk|FAQ_(Dansk)}}<br />
{{i18n_entry|English|FAQ}}<br />
{{i18n_entry|Español|FAQ_(Español)}}<br />
{{i18n_entry|Nederlands|FAQ_(Nederlands)}}<br />
{{i18n_entry|Français|FAQ (Français)}}<br />
{{i18n_entry|Italiano|FAQ (Italiano)}}<br />
{{i18n_entry|Polski|FAQ (Polski)}}<br />
{{i18n_entry|简体中文|FAQ常见问题集}}<br />
{{i18n_entry|正體中文|FAQ 常見問答集}}<br />
{{i18n_entry|Slovensky|FAQ_(Slovensky)}}<br />
{{i18n_entry|Česky|FAQ_(Česky)}}<br />
{{i18n_entry|Deutsch|FAQ_(Deutsch)}}<br />
{{i18n_entry|Português do Brasil|FAQ_(Português do Brasil)}}<br />
{{i18n_entry|Русский|FAQ_(Русский)}}<br />
{{i18n_entry|ไทย|FAQ_(ไทย)}}<br />
{{i18n_links_end}}<br />
<br />
Besides the questions covered below, you may find [[The Arch Way]], [[ArchLinux]], and [[Devland]] helpful. All three contain a good deal of information about Arch Linux.<br />
<br />
= General =<br />
<br />
==Q) I am a complete Linux beginner. Should I use Arch?==<br />
'''A)''' This question has had much debate. Arch is targeted at more-advanced Linux users, but some people feel "Arch is a good place to start". If you are a beginner and want to use Arch, just be warned that you MUST be willing to learn. Before asking any question, do your own independent research by googling, searching the Wiki, and searching the forum (and reading past FAQs). If you do that, you should be fine. Also know that many people do not want to answer the same basic questions over and over, so you are exposing yourself to that environment. There is a reason these resources were created/made available to you. You could reference the Arch Linux [[Beginner's Guide]].<br />
<br />
==Q) When will the new release be made?==<br />
'''A)''' Arch Linux releases coincide with each major kernel version, but are merely a snapshot of the /core repository, combined with various features or modifications to the installer script itself. The rolling release model keeps every Arch Linux system current and on the bleeding edge by issuing one command.<br />
<br />
For this reason, releases are not terribly important in Arch, because the rolling-release system makes new releases out of date as soon as a package has been updated. If you are looking to obtain the latest Arch Linux release, you do not need to reinstall. You simply run the ''pacman -Syu'' command and your system will be identical to what you would get with a brand-new install.<br />
<br />
For this same reason, new Arch Linux releases are not typically full of new and exciting features. New and exciting features are released as needed with the packages that are updated, and can be obtained immediately via ''pacman -Syu''.<br />
<br />
==Q) Arch needs more/less press (i.e. advertisement)==<br />
'''A)''' Arch gets plenty of press as it is. The goal of Arch Linux is not to be large. The goal is to be well done. Let growth occur naturally. Trying to force it to grow too quickly will just cause problems.<br />
<br />
Similarly, do not try to restrict the natural growth. More users might mean more devs to work on Arch Linux. This may cause some organizational issues at the "top", but those will be dealt with when they arrive.<br />
<br />
==Q) Arch needs more documentation==<br />
'''A)''' This is essentially true, so feel free to contribute. Documentation does not occur ex nihilo. After searching the forums and the wiki, if you cannot find the documentation you require, try creating it. Start a page on the wiki, and post in the forums regarding it. Likely other people have experience in the area, or are at least willing to help. If nobody does, don't be discouraged. When you finish your documentation, other people will likely find it an extremely valuable resource.<br />
There is always a need for documentation; contribute to the wiki.<br />
<br />
==Q) Arch needs more devs==<br />
'''A)''' Possibly so. Feel free to volunteer your time! Visit the forums, IRC channel, and mailing lists, and see what needs to be done.<br />
There is always a need for documentation; contribute to the wiki.<br />
<br />
==Q) Why is Arch so slow? I thought it's supposed to be fast!==<br />
'''A)''' Make sure that your hostname is correctly set in /etc/hosts (i.e., that it matches the hostname in /etc/rc.conf. Have a look at "Configure the System" in The [[Beginner's Guide]]). If the hostnames do not match, applications may start up very slowly.<br />
<br />
==Q) Why is my internet so slow compared to other operating systems?==<br />
'''A)''' Is your network configured correctly? Have you double checked your /etc/rc.conf /etc/hosts and /etc/resolv.conf? Have a look at "Configure the System" in The [[Beginner's Guide]].<br />
<br />
=Package Management=<br />
<br />
==Q) I've found an error with Package X. What should I do?==<br />
'''A)''' First, you need to figure out if this error is something the Arch team can fix. Sometimes it's not (that Firefox crash may be the fault of the Mozilla team) - this is called an ''upstream error''. If it is an Arch problem, there is a series of steps you can take:<br />
#Search the forums for information. See if anyone else has noticed it.<br />
#Notify the package maintainer. Try a "pacman -Qi <package name>" for this info.<br />
#Post a bug report with detailed information at http://bugs.archlinux.org.<br />
#If you'd like, write a forum post detailing the problem and the fact that you have reported it already. This will help prevent a lot of people from reporting the same error.<br />
<br />
==Q) Will Arch have a database for pacman?==<br />
'''A)''' Possibly. There is discussion over the issue. <br><br />
http://bbs.archlinux.org/viewtopic.php?t=11193 <br><br />
http://bbs.archlinux.org/viewtopic.php?t=10898 <br><br />
Look at http://bugs.archlinux.org/task/5328, too.<br />
<br />
==Q) Arch packages need to use a unique naming convention. .pkg.tar.gz is too long and/or confusing==<br />
'''A)''' This has been discussed on the Arch mailing list. Some proposed a .pac file extension. As far as is currently known, there is no plan to change the package extension.<br />
As Tobias Kieslich, one of the Arch devs, put it, "A package '''is''' a gzipped tarball! And it can be opened, investigated and manipulated by any tar-capable application. Moreover, the mime-type is automatically detected correctly by most applications."<br />
<br />
==Q) Pacman needs a library so other applications can easily access package information==<br />
'''A)''' Since version 3.0.0, pacman has been the front-end to libalpm, the "Arch Linux Package Management" library. This library allows alternative front-ends to be written (for instance, a GUI front-end).<br />
<br />
==Q) Why doesn't Pacman have an official GUI front-end?==<br />
'''A)''' Did you read [[The Arch Way]] and [[ArchLinux]] and [[Devland]]?<br />
The answer is basically that the Arch dev team will not be providing one. Feel free to use one of those developed by users. There is a nice list of them on the [[UserContributionsPage]] in the links section, and a selective list on [[Pacman_GUI_Frontends]].<br />
<br />
==Q) Pacman needs Feature X!==<br />
'''A)''' Did you read [[The Arch Way]] and [[ArchLinux]] and [[Devland]]?<br />
The Arch philosophy is "Keep It Simple". If you think the idea has merit, and does not violate this simple litany, then by all means, discuss it on the forum [http://bbs.archlinux.org/ here]. You might also like to check [http://bugs.archlinux.org here]; it's a place for feature requests if you find it is important.<br />
<br />
However, the best way to get a feature added to Pacman or Arch Linux is to implement it yourself. There's no telling whether the patch will be officially accepted, but others will appreciate and test your effort.<br />
<br />
==Q) Arch needs a stable package branch==<br />
'''A)'''<br />
Never say never.<br />
Some of the many discussions on the topic: <br><br />
http://bbs.archlinux.org/viewtopic.php?t=11288<br />
<br><br />
http://archlinux.org/pipermail/arch/2007-November/016048.html<br />
<br />
==Q) What's the difference between all these repositories?==<br />
'''A)''' See [[The Arch Linux Repositories]].<br />
<br />
==Q) Why doesn't Arch include docs and info pages in its packages?==<br />
'''A)''' In its goal to be simple and lightweight, the relatively useless portions of a Linux system have been left out, things like /usr/doc and the info pages, in favor of man pages. This question is brought up a lot; read some past discussions about it: <br><br />
http://www.archlinux.org/pipermail/arch/2005-April/004194.html <br><br />
http://bbs.archlinux.org/viewtopic.php?id=14527<br />
<br />
==Q) I just installed Package X. How do I start it?==<br />
'''A)''' If you're using a desktop environment like KDE or GNOME, the program should automatically show up in your menu. If you're trying to run the program from a terminal and don't know the binary name, try executing "pacman -Ql packagename | grep bin". A common problem for packages like Firefox or OpenOffice is that they are installed to /opt, which is not in your $PATH - you can "source /etc/profile" or logout/login to fix this.<br />
<br />
=Installation=<br />
<br />
==Q) Arch needs a better installer. Maybe a GUI installer.==<br />
'''A)''' The discussion of a "better" installer is a subjective opinion. The best way to cope with these issues it to fit the installer to "the Arch way". If this opinion on a better installer is backed with more-concrete arguments, it might be taken into account for further development of the installer. Since installation doesn't occur often (see the question above on rolling release), it is not a high priority for developers or users.<br />
However, two unofficial methods exist: [http://archie.dotsrc.org/ Archie Live CD] for XFCE (other desktops in development) and [http://user-contributions.org/wikis/userwiki/index.php?title=Arch_Linux_Office_Install_CD Arch Linux Office Install CD] for KDE.<br />
<br />
==Q) I installed Arch, and now I am at a bash login! What now?==<br />
'''A)''' Have a look at the Arch Linux [[Beginner's Guide]]<br />
<br />
=Other=<br />
<br />
==Q) I get an error every time I use pacman saying 'warning: current locale is invalid; using default "C" locale'. What do I do?==<br />
'''A)''' As the error message says, your locale isn't correctly configured. Have a look at the [[Configuring locales|locale configuration wiki page]].<br />
<br />
==Q) How do I automount/mount something? ==<br />
'''A)''' If you use GNOME, install gnome-volume-manager:<br />
pacman -Sy gnome-volume-manager<br />
<br />
Now add yourself to the storage group:<br />
gpasswd -a ''your_user'' storage<br />
<br />
If you don't want to use gnome-volume-manager, check out the [[AutoFS_HowTo|AutoFS HowTo]].<br />
<br />
==Q) How do I reduce the amount of kernel modules loaded/shown in lsmod?==<br />
'''A)''' If you are using kernel26, edit /etc/mkinitrd.conf. Enable auto-detection of HOSTCONTROLlER and FILESYSTEMS.<br />
AUTODETECT=1<br />
<br />
==Q) How do I connect to my wireless network?==<br />
'''A)''' See [[Wireless Setup]].<br />
<br />
==Q) How do I connect to my wired network?==<br />
'''A)''' See [[Configuring network]].<br />
<br />
==Q) What is this AUR thing I keep hearing about?==<br />
'''A)''' See [[AUR Q & A]].<br />
<br />
==Q) Why do I get a green screen whenever I try to watch a video?==<br />
'''A)''' Your colour depth is set wrong. It may need to be 24 instead of 16, for example.</div>Fwalchhttps://wiki.archlinux.org/index.php?title=Arch_FAQs_for_newbies&diff=40477Arch FAQs for newbies2008-04-29T18:18:08Z<p>Fwalch: Merged with FAQ; added redirect.</p>
<hr />
<div>#redirect [[FAQ]]</div>Fwalch