https://wiki.archlinux.org/api.php?action=feedcontributions&user=BookMoth&feedformat=atom
ArchWiki - User contributions [en]
2024-03-28T20:11:40Z
User contributions
MediaWiki 1.41.0
https://wiki.archlinux.org/index.php?title=PhpMyAdmin&diff=87901
PhpMyAdmin
2009-12-16T08:44:15Z
<p>BookMoth: </p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|PhpMyAdmin}}<br />
{{i18n_entry|Русский|PhpMyAdmin (russian)}}<br />
{{i18n_entry|简体中文|PhpMyAdmin (简体中文)}}<br />
{{i18n_links_end}}<br />
==Pre-Installation==<br />
Read the [http://wiki.archlinux.org/index.php/LAMP LAMP] wiki entry to setup apache, php and mysql.<br />
<br />
==Installation==<br />
To install [http://www.phpmyadmin.net/ phpMyAdmin] just type this into the console.<br />
<br />
<pre><br />
#pacman -S phpmyadmin php-mcrypt<br />
</pre><br />
<br />
==Configuration==<br />
<br />
Make sure you delete any old version of phpmyadmin.<br />
<br />
<pre><br />
rm -r /srv/httpd/phpMyAdmin<br />
</pre><br />
<br />
Copy the example configuration file to your httpd configuration file directory.<br />
<br />
<pre><br />
cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
Add the following line to /etc/httpd/conf/httpd.conf:<br />
<br />
<pre><br />
Include conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
You can type this into the console to produce the same effect:<br />
<br />
<pre><br />
echo -e "\nInclude conf/extra/httpd-phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf<br />
</pre><br />
<br />
Comment out (or delete) 'deny form all' in /usr/share/webapps/phpMyAdmin/.htaccess, the line should look like this:<br />
<br />
<pre><br />
#deny from all<br />
</pre><br />
<br />
Otherwise you will get "Error 403 - Access forbidden!" when you try to access your phpmyadmin installation.<br />
<br />
Your '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' should have the following information:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
<Directory "/usr/share/webapps/phpMyAdmin"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</pre><br />
<br />
Open your '/etc/php/php.ini' and edit the line containing 'open_basedir' so it has the following:<br />
<br />
<pre><br />
:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
For example, mine contains the following:<br />
<br />
<pre><br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
You need the mcrypt module, so uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=mcrypt.so<br />
:to<br />
extension=mcrypt.so<br />
==Access your phpmyadmin installation==<br />
<br />
You can access your phpmyadmin installation using the following url:<br />
<br />
<pre><br />
http://localhost/phpmyadmin/<br />
or<br />
http://localhost/phpmyadmin/index.php<br />
</pre><br />
<br />
Note: 'localhost' is the hostname in your /etc/rc.conf file.<br />
<br />
If you want to access it using:<br />
<br />
<pre><br />
http://localhost/phpmyadmin<br />
</pre><br />
<br />
in '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' change:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
</pre><br />
<br />
to<br />
<br />
<pre><br />
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"<br />
</pre><br />
<br />
You should also read [http://bbs.archlinux.org/viewtopic.php?pid=632500 this thread].<br />
<br />
If you get the error "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)" then you might want to change "localhost" in /etc/webapps/phpmyadmin/config.inc.php on this line:<br />
<br />
<pre><br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
</pre><br />
<br />
to your hostname specified in /etc/hosts and /etc/rc.conf under HOSTNAME.<br />
<br />
If you would like to use phpmyadmin setup script by calling http://localhost/phpmyadmin/setup you will need to create a config directory that's writeable by the httpd in the /usr/share/webapps/phpmyadmin as follows:<br />
<br />
<pre><br />
cd /usr/share/webapps/phpmyadmin<br />
sudo mkdir config<br />
sudo chgrp http config<br />
sudo chmod g+w config<br />
</pre><br />
<br />
==Other (Older) information==<br />
<br />
This page holds a sample 'config.inc.php' file that you can place in the main phpMyAdmin directory so that it immediately starts working<br />
<br />
'''Things you should do first'''<br />
<br />
Create a 'controluser', so that phpmyadmin can read from the main mysql database.<br />
<br />
<pre>mysql -u root -pYOURROOTPASSWORD<br />
mysql> grant usage on mysql.* to controluser@localhost identified by 'CONTROLPASS';<br />
</pre><br />
<br />
'''Where is phpmyadmin'''<br />
<br />
in phpmyadmin 3.2.2-3 the file is missing /srv/http/ create this symlik<br />
<br />
<pre>ln -s /usr/share/webapps/phpMyAdmin/ /srv/http/phpmyadmin<br />
</pre><br />
<br />
'''Things you should change'''<br />
<br />
controluser is set to controluser <br><br />
controlpass is set to password <br><br />
verbose is set to name_of_server<br />
<br />
'''Sample 'config.inc.php' file'''<br />
<pre><br />
<?php<br />
/*<br />
* Generated configuration file<br />
* Generated by: phpMyAdmin 2.11.8.1 setup script by Michal Čihař <michal@cihar.com><br />
* Version: $Id: setup.php 11423 2008-07-24 17:26:05Z lem9 $<br />
* Date: Mon, 01 Sep 2008 20:34:02 GMT<br />
*/<br />
<br />
/* Servers configuration */<br />
$i = 0;<br />
<br />
/* Server ravi-test-mysql (http) [1] */<br />
$i++;<br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
$cfg['Servers'][$i]['extension'] = 'mysql';<br />
$cfg['Servers'][$i]['port'] = '3306';<br />
$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />
$cfg['Servers'][$i]['compress'] = false;<br />
$cfg['Servers'][$i]['controluser'] = 'controluser';<br />
$cfg['Servers'][$i]['controlpass'] = 'password';<br />
$cfg['Servers'][$i]['auth_type'] = 'http';<br />
$cfg['Servers'][$i]['verbose'] = 'name_of_server';<br />
<br />
/* End of servers configuration */<br />
<br />
$cfg['LeftFrameLight'] = true;<br />
$cfg['LeftFrameDBTree'] = true;<br />
$cfg['LeftFrameDBSeparator'] = '_';<br />
$cfg['LeftFrameTableSeparator'] = '__';<br />
$cfg['LeftFrameTableLevel'] = 1;<br />
$cfg['LeftDisplayLogo'] = true;<br />
$cfg['LeftDisplayServers'] = false;<br />
$cfg['DisplayServersList'] = false;<br />
$cfg['DisplayDatabasesList'] = 'auto';<br />
$cfg['LeftPointerEnable'] = true;<br />
$cfg['DefaultTabServer'] = 'main.php';<br />
$cfg['DefaultTabDatabase'] = 'db_structure.php';<br />
$cfg['DefaultTabTable'] = 'tbl_structure.php';<br />
$cfg['LightTabs'] = false;<br />
$cfg['ErrorIconic'] = true;<br />
$cfg['MainPageIconic'] = true;<br />
$cfg['ReplaceHelpImg'] = true;<br />
$cfg['NavigationBarIconic'] = 'both';<br />
$cfg['PropertiesIconic'] = 'both';<br />
$cfg['BrowsePointerEnable'] = true;<br />
$cfg['BrowseMarkerEnable'] = true;<br />
$cfg['ModifyDeleteAtRight'] = false;<br />
$cfg['ModifyDeleteAtLeft'] = true;<br />
$cfg['RepeatCells'] = 100;<br />
$cfg['DefaultDisplay'] = 'horizontal';<br />
$cfg['TextareaCols'] = 40;<br />
$cfg['TextareaRows'] = 7;<br />
$cfg['LongtextDoubleTextarea'] = true;<br />
$cfg['TextareaAutoSelect'] = false;<br />
$cfg['CharEditing'] = 'input';<br />
$cfg['CharTextareaCols'] = 40;<br />
$cfg['CharTextareaRows'] = 2;<br />
$cfg['CtrlArrowsMoving'] = true;<br />
$cfg['DefaultPropDisplay'] = 'horizontal';<br />
$cfg['InsertRows'] = 2;<br />
$cfg['EditInWindow'] = true;<br />
$cfg['QueryWindowHeight'] = 310;<br />
$cfg['QueryWindowWidth'] = 550;<br />
$cfg['QueryWindowDefTab'] = 'sql';<br />
$cfg['ForceSSL'] = false;<br />
$cfg['ShowPhpInfo'] = false;<br />
$cfg['ShowChgPassword'] = false;<br />
$cfg['AllowArbitraryServer'] = false;<br />
$cfg['LoginCookieRecall'] = 'something';<br />
$cfg['LoginCookieValidity'] = 1800;<br />
?><br />
</pre></div>
BookMoth
https://wiki.archlinux.org/index.php?title=Phpmyadmin_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=87900
Phpmyadmin (简体中文)
2009-12-16T08:43:21Z
<p>BookMoth: moved Phpmyadmin (简体中文) to PhpMyAdmin (简体中文)</p>
<hr />
<div>#REDIRECT [[PhpMyAdmin (简体中文)]]</div>
BookMoth
https://wiki.archlinux.org/index.php?title=PhpMyAdmin_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=87899
PhpMyAdmin (简体中文)
2009-12-16T08:43:21Z
<p>BookMoth: moved Phpmyadmin (简体中文) to PhpMyAdmin (简体中文)</p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|PhpMyAdmin}}<br />
{{i18n_entry|Русский|PhpMyAdmin (russian)}}<br />
{{i18n_entry|简体中文|PhpMyAdmin (简体中文)}}<br />
{{i18n_links_end}}<br />
==准备==<br />
按照 [http://wiki.archlinux.org/index.php/LAMP LAMP] wiki 所说的方法安装apache, php 和 mysql。<br />
<br />
==安装==<br />
运行下面的命令安装 [http://www.phpmyadmin.net/ phpMyAdmin]。<br />
<br />
<pre><br />
#pacman -S phpmyadmin php-mcrypt<br />
</pre><br />
<br />
==配置==<br />
<br />
如果已经安装过老版本的phpmyadmin,请先删除:<br />
<br />
<pre><br />
rm -r /srv/httpd/phpMyAdmin<br />
</pre><br />
<br />
复制配置文件到你的httpd的配置文件目录<br />
<br />
<pre><br />
cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
将下面这行添加到 /etc/httpd/conf/httpd.conf:<br />
<br />
<pre><br />
Include conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
或者,在命令行执行下面的命令也是相同的结果:<br />
<br />
<pre><br />
echo -e "\nInclude conf/extra/httpd-phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf<br />
</pre><br />
<br />
编辑/usr/share/webapps/phpMyAdmin/.htaccess,像下面这样注释掉(或者删除)'deny form all':<br />
<br />
<pre><br />
#deny from all<br />
</pre><br />
<br />
否则在访问phpmyadmin installation时,会返回错误信息"Error 403 - Access forbidden!"。<br />
<br />
'/etc/httpd/conf/extra/httpd-phpmyadmin.conf'中应该包含了下面这些信息:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
<Directory "/usr/share/webapps/phpMyAdmin"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</pre><br />
<br />
打开'/etc/php/php.ini',编辑'open_basedir'这行,将下面的路径补充在后面:<br />
<br />
<pre><br />
:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
例如,像下面这个样子:<br />
<br />
<pre><br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
phpmyadmin需要PHP的mcrypt模块支持,编辑{{Filename|/etc/php/php.ini}}的:<br />
;extension=mcrypt.so<br />
:取消前面的注释<br />
extension=mcrypt.so<br />
<br />
==访问 phpmyadmin 安装==<br />
<br />
通过浏览器访问下面的链接,完成phpmyadmin安装:<br />
<br />
<pre><br />
http://localhost/phpmyadmin/<br />
或者<br />
http://localhost/phpmyadmin/index.php<br />
</pre><br />
<br />
注意: 'localhost' 是/etc/rc.conf文件中你配置的主机名.<br />
<br />
如果你希望像下面这样,不需要最后的/访问phpmyadmin:<br />
<br />
<pre><br />
http://localhost/phpmyadmin<br />
</pre><br />
<br />
需要将 '/etc/httpd/conf/extra/httpd-phpmyadmin.conf'当中的:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
</pre><br />
<br />
修改为:<br />
<br />
<pre><br />
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"<br />
</pre><br />
<br />
你可能需要参考 [http://bbs.archlinux.org/viewtopic.php?pid=632500 this thread].<br />
<br />
如果你看到了错误信息 "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)",你可能需要修改 /etc/webapps/phpmyadmin/config.inc.php 文件中的这一行:<br />
<br />
<pre><br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
</pre><br />
<br />
将"localhost"替换为你的 /etc/hosts 和 /etc/rc.conf文件中指定的主机名。<br />
<br />
<br />
如果你希望通过访问http://localhost/phpmyadmin/setup 使用phpmyadmin的安装脚本, 需要在/usr/share/webapps/phpmyadmin 目录下创建一个httpd用户可写的配置文件夹:<br />
<br />
<pre><br />
cd /usr/share/webapps/phpmyadmin<br />
sudo mkdir config<br />
sudo chgrp http config<br />
sudo chmod g+w config<br />
</pre><br />
<br />
==其他信息(过时)==<br />
<br />
This page holds a sample 'config.inc.php' file that you can place in the main phpMyAdmin directory so that it immediately starts working<br />
<br />
'''Things you should do first'''<br />
<br />
Create a 'controluser', so that phpmyadmin can read from the main mysql database.<br />
<br />
<pre>mysql -u root -pYOURROOTPASSWORD<br />
mysql> grant usage on mysql.* to controluser@localhost identified by 'CONTROLPASS';<br />
</pre><br />
<br />
'''Where is phpmyadmin'''<br />
<br />
in phpmyadmin 3.2.2-3 the file is missing /srv/http/ create this symlik<br />
<br />
<pre>ln -s /usr/share/webapps/phpMyAdmin/ /srv/http/phpmyadmin<br />
</pre><br />
<br />
'''Things you should change'''<br />
<br />
controluser is set to controluser <br><br />
controlpass is set to password <br><br />
verbose is set to name_of_server<br />
<br />
'''Sample 'config.inc.php' file'''<br />
<pre><br />
<?php<br />
/*<br />
* Generated configuration file<br />
* Generated by: phpMyAdmin 2.11.8.1 setup script by Michal Čihař <michal@cihar.com><br />
* Version: $Id: setup.php 11423 2008-07-24 17:26:05Z lem9 $<br />
* Date: Mon, 01 Sep 2008 20:34:02 GMT<br />
*/<br />
<br />
/* Servers configuration */<br />
$i = 0;<br />
<br />
/* Server ravi-test-mysql (http) [1] */<br />
$i++;<br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
$cfg['Servers'][$i]['extension'] = 'mysql';<br />
$cfg['Servers'][$i]['port'] = '3306';<br />
$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />
$cfg['Servers'][$i]['compress'] = false;<br />
$cfg['Servers'][$i]['controluser'] = 'controluser';<br />
$cfg['Servers'][$i]['controlpass'] = 'password';<br />
$cfg['Servers'][$i]['auth_type'] = 'http';<br />
$cfg['Servers'][$i]['verbose'] = 'name_of_server';<br />
<br />
/* End of servers configuration */<br />
<br />
$cfg['LeftFrameLight'] = true;<br />
$cfg['LeftFrameDBTree'] = true;<br />
$cfg['LeftFrameDBSeparator'] = '_';<br />
$cfg['LeftFrameTableSeparator'] = '__';<br />
$cfg['LeftFrameTableLevel'] = 1;<br />
$cfg['LeftDisplayLogo'] = true;<br />
$cfg['LeftDisplayServers'] = false;<br />
$cfg['DisplayServersList'] = false;<br />
$cfg['DisplayDatabasesList'] = 'auto';<br />
$cfg['LeftPointerEnable'] = true;<br />
$cfg['DefaultTabServer'] = 'main.php';<br />
$cfg['DefaultTabDatabase'] = 'db_structure.php';<br />
$cfg['DefaultTabTable'] = 'tbl_structure.php';<br />
$cfg['LightTabs'] = false;<br />
$cfg['ErrorIconic'] = true;<br />
$cfg['MainPageIconic'] = true;<br />
$cfg['ReplaceHelpImg'] = true;<br />
$cfg['NavigationBarIconic'] = 'both';<br />
$cfg['PropertiesIconic'] = 'both';<br />
$cfg['BrowsePointerEnable'] = true;<br />
$cfg['BrowseMarkerEnable'] = true;<br />
$cfg['ModifyDeleteAtRight'] = false;<br />
$cfg['ModifyDeleteAtLeft'] = true;<br />
$cfg['RepeatCells'] = 100;<br />
$cfg['DefaultDisplay'] = 'horizontal';<br />
$cfg['TextareaCols'] = 40;<br />
$cfg['TextareaRows'] = 7;<br />
$cfg['LongtextDoubleTextarea'] = true;<br />
$cfg['TextareaAutoSelect'] = false;<br />
$cfg['CharEditing'] = 'input';<br />
$cfg['CharTextareaCols'] = 40;<br />
$cfg['CharTextareaRows'] = 2;<br />
$cfg['CtrlArrowsMoving'] = true;<br />
$cfg['DefaultPropDisplay'] = 'horizontal';<br />
$cfg['InsertRows'] = 2;<br />
$cfg['EditInWindow'] = true;<br />
$cfg['QueryWindowHeight'] = 310;<br />
$cfg['QueryWindowWidth'] = 550;<br />
$cfg['QueryWindowDefTab'] = 'sql';<br />
$cfg['ForceSSL'] = false;<br />
$cfg['ShowPhpInfo'] = false;<br />
$cfg['ShowChgPassword'] = false;<br />
$cfg['AllowArbitraryServer'] = false;<br />
$cfg['LoginCookieRecall'] = 'something';<br />
$cfg['LoginCookieValidity'] = 1800;<br />
?><br />
</pre></div>
BookMoth
https://wiki.archlinux.org/index.php?title=PhpMyAdmin&diff=87898
PhpMyAdmin
2009-12-16T08:42:31Z
<p>BookMoth: </p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|PhpMyAdmin}}<br />
{{i18n_entry|Русский|PhpMyAdmin (russian)}}<br />
{{i18n_entry|简体中文|Phpmyadmin (简体中文)}}<br />
{{i18n_links_end}}<br />
==Pre-Installation==<br />
Read the [http://wiki.archlinux.org/index.php/LAMP LAMP] wiki entry to setup apache, php and mysql.<br />
<br />
==Installation==<br />
To install [http://www.phpmyadmin.net/ phpMyAdmin] just type this into the console.<br />
<br />
<pre><br />
#pacman -S phpmyadmin php-mcrypt<br />
</pre><br />
<br />
==Configuration==<br />
<br />
Make sure you delete any old version of phpmyadmin.<br />
<br />
<pre><br />
rm -r /srv/httpd/phpMyAdmin<br />
</pre><br />
<br />
Copy the example configuration file to your httpd configuration file directory.<br />
<br />
<pre><br />
cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
Add the following line to /etc/httpd/conf/httpd.conf:<br />
<br />
<pre><br />
Include conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
You can type this into the console to produce the same effect:<br />
<br />
<pre><br />
echo -e "\nInclude conf/extra/httpd-phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf<br />
</pre><br />
<br />
Comment out (or delete) 'deny form all' in /usr/share/webapps/phpMyAdmin/.htaccess, the line should look like this:<br />
<br />
<pre><br />
#deny from all<br />
</pre><br />
<br />
Otherwise you will get "Error 403 - Access forbidden!" when you try to access your phpmyadmin installation.<br />
<br />
Your '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' should have the following information:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
<Directory "/usr/share/webapps/phpMyAdmin"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</pre><br />
<br />
Open your '/etc/php/php.ini' and edit the line containing 'open_basedir' so it has the following:<br />
<br />
<pre><br />
:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
For example, mine contains the following:<br />
<br />
<pre><br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
You need the mcrypt module, so uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=mcrypt.so<br />
:to<br />
extension=mcrypt.so<br />
==Access your phpmyadmin installation==<br />
<br />
You can access your phpmyadmin installation using the following url:<br />
<br />
<pre><br />
http://localhost/phpmyadmin/<br />
or<br />
http://localhost/phpmyadmin/index.php<br />
</pre><br />
<br />
Note: 'localhost' is the hostname in your /etc/rc.conf file.<br />
<br />
If you want to access it using:<br />
<br />
<pre><br />
http://localhost/phpmyadmin<br />
</pre><br />
<br />
in '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' change:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
</pre><br />
<br />
to<br />
<br />
<pre><br />
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"<br />
</pre><br />
<br />
You should also read [http://bbs.archlinux.org/viewtopic.php?pid=632500 this thread].<br />
<br />
If you get the error "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)" then you might want to change "localhost" in /etc/webapps/phpmyadmin/config.inc.php on this line:<br />
<br />
<pre><br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
</pre><br />
<br />
to your hostname specified in /etc/hosts and /etc/rc.conf under HOSTNAME.<br />
<br />
If you would like to use phpmyadmin setup script by calling http://localhost/phpmyadmin/setup you will need to create a config directory that's writeable by the httpd in the /usr/share/webapps/phpmyadmin as follows:<br />
<br />
<pre><br />
cd /usr/share/webapps/phpmyadmin<br />
sudo mkdir config<br />
sudo chgrp http config<br />
sudo chmod g+w config<br />
</pre><br />
<br />
==Other (Older) information==<br />
<br />
This page holds a sample 'config.inc.php' file that you can place in the main phpMyAdmin directory so that it immediately starts working<br />
<br />
'''Things you should do first'''<br />
<br />
Create a 'controluser', so that phpmyadmin can read from the main mysql database.<br />
<br />
<pre>mysql -u root -pYOURROOTPASSWORD<br />
mysql> grant usage on mysql.* to controluser@localhost identified by 'CONTROLPASS';<br />
</pre><br />
<br />
'''Where is phpmyadmin'''<br />
<br />
in phpmyadmin 3.2.2-3 the file is missing /srv/http/ create this symlik<br />
<br />
<pre>ln -s /usr/share/webapps/phpMyAdmin/ /srv/http/phpmyadmin<br />
</pre><br />
<br />
'''Things you should change'''<br />
<br />
controluser is set to controluser <br><br />
controlpass is set to password <br><br />
verbose is set to name_of_server<br />
<br />
'''Sample 'config.inc.php' file'''<br />
<pre><br />
<?php<br />
/*<br />
* Generated configuration file<br />
* Generated by: phpMyAdmin 2.11.8.1 setup script by Michal Čihař <michal@cihar.com><br />
* Version: $Id: setup.php 11423 2008-07-24 17:26:05Z lem9 $<br />
* Date: Mon, 01 Sep 2008 20:34:02 GMT<br />
*/<br />
<br />
/* Servers configuration */<br />
$i = 0;<br />
<br />
/* Server ravi-test-mysql (http) [1] */<br />
$i++;<br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
$cfg['Servers'][$i]['extension'] = 'mysql';<br />
$cfg['Servers'][$i]['port'] = '3306';<br />
$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />
$cfg['Servers'][$i]['compress'] = false;<br />
$cfg['Servers'][$i]['controluser'] = 'controluser';<br />
$cfg['Servers'][$i]['controlpass'] = 'password';<br />
$cfg['Servers'][$i]['auth_type'] = 'http';<br />
$cfg['Servers'][$i]['verbose'] = 'name_of_server';<br />
<br />
/* End of servers configuration */<br />
<br />
$cfg['LeftFrameLight'] = true;<br />
$cfg['LeftFrameDBTree'] = true;<br />
$cfg['LeftFrameDBSeparator'] = '_';<br />
$cfg['LeftFrameTableSeparator'] = '__';<br />
$cfg['LeftFrameTableLevel'] = 1;<br />
$cfg['LeftDisplayLogo'] = true;<br />
$cfg['LeftDisplayServers'] = false;<br />
$cfg['DisplayServersList'] = false;<br />
$cfg['DisplayDatabasesList'] = 'auto';<br />
$cfg['LeftPointerEnable'] = true;<br />
$cfg['DefaultTabServer'] = 'main.php';<br />
$cfg['DefaultTabDatabase'] = 'db_structure.php';<br />
$cfg['DefaultTabTable'] = 'tbl_structure.php';<br />
$cfg['LightTabs'] = false;<br />
$cfg['ErrorIconic'] = true;<br />
$cfg['MainPageIconic'] = true;<br />
$cfg['ReplaceHelpImg'] = true;<br />
$cfg['NavigationBarIconic'] = 'both';<br />
$cfg['PropertiesIconic'] = 'both';<br />
$cfg['BrowsePointerEnable'] = true;<br />
$cfg['BrowseMarkerEnable'] = true;<br />
$cfg['ModifyDeleteAtRight'] = false;<br />
$cfg['ModifyDeleteAtLeft'] = true;<br />
$cfg['RepeatCells'] = 100;<br />
$cfg['DefaultDisplay'] = 'horizontal';<br />
$cfg['TextareaCols'] = 40;<br />
$cfg['TextareaRows'] = 7;<br />
$cfg['LongtextDoubleTextarea'] = true;<br />
$cfg['TextareaAutoSelect'] = false;<br />
$cfg['CharEditing'] = 'input';<br />
$cfg['CharTextareaCols'] = 40;<br />
$cfg['CharTextareaRows'] = 2;<br />
$cfg['CtrlArrowsMoving'] = true;<br />
$cfg['DefaultPropDisplay'] = 'horizontal';<br />
$cfg['InsertRows'] = 2;<br />
$cfg['EditInWindow'] = true;<br />
$cfg['QueryWindowHeight'] = 310;<br />
$cfg['QueryWindowWidth'] = 550;<br />
$cfg['QueryWindowDefTab'] = 'sql';<br />
$cfg['ForceSSL'] = false;<br />
$cfg['ShowPhpInfo'] = false;<br />
$cfg['ShowChgPassword'] = false;<br />
$cfg['AllowArbitraryServer'] = false;<br />
$cfg['LoginCookieRecall'] = 'something';<br />
$cfg['LoginCookieValidity'] = 1800;<br />
?><br />
</pre></div>
BookMoth
https://wiki.archlinux.org/index.php?title=PhpMyAdmin&diff=87897
PhpMyAdmin
2009-12-16T08:40:34Z
<p>BookMoth: </p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|PhpMyAdmin}}<br />
{{i18n_entry|Русский|PhpMyAdmin (russian)}}<br />
{{i18n_entry|简体中文|PhpMyAdmin (简体中文)}}<br />
{{i18n_links_end}}<br />
==Pre-Installation==<br />
Read the [http://wiki.archlinux.org/index.php/LAMP LAMP] wiki entry to setup apache, php and mysql.<br />
<br />
==Installation==<br />
To install [http://www.phpmyadmin.net/ phpMyAdmin] just type this into the console.<br />
<br />
<pre><br />
#pacman -S phpmyadmin php-mcrypt<br />
</pre><br />
<br />
==Configuration==<br />
<br />
Make sure you delete any old version of phpmyadmin.<br />
<br />
<pre><br />
rm -r /srv/httpd/phpMyAdmin<br />
</pre><br />
<br />
Copy the example configuration file to your httpd configuration file directory.<br />
<br />
<pre><br />
cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
Add the following line to /etc/httpd/conf/httpd.conf:<br />
<br />
<pre><br />
Include conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
You can type this into the console to produce the same effect:<br />
<br />
<pre><br />
echo -e "\nInclude conf/extra/httpd-phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf<br />
</pre><br />
<br />
Comment out (or delete) 'deny form all' in /usr/share/webapps/phpMyAdmin/.htaccess, the line should look like this:<br />
<br />
<pre><br />
#deny from all<br />
</pre><br />
<br />
Otherwise you will get "Error 403 - Access forbidden!" when you try to access your phpmyadmin installation.<br />
<br />
Your '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' should have the following information:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
<Directory "/usr/share/webapps/phpMyAdmin"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</pre><br />
<br />
Open your '/etc/php/php.ini' and edit the line containing 'open_basedir' so it has the following:<br />
<br />
<pre><br />
:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
For example, mine contains the following:<br />
<br />
<pre><br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
You need the mcrypt module, so uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=mcrypt.so<br />
:to<br />
extension=mcrypt.so<br />
==Access your phpmyadmin installation==<br />
<br />
You can access your phpmyadmin installation using the following url:<br />
<br />
<pre><br />
http://localhost/phpmyadmin/<br />
or<br />
http://localhost/phpmyadmin/index.php<br />
</pre><br />
<br />
Note: 'localhost' is the hostname in your /etc/rc.conf file.<br />
<br />
If you want to access it using:<br />
<br />
<pre><br />
http://localhost/phpmyadmin<br />
</pre><br />
<br />
in '/etc/httpd/conf/extra/httpd-phpmyadmin.conf' change:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
</pre><br />
<br />
to<br />
<br />
<pre><br />
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"<br />
</pre><br />
<br />
You should also read [http://bbs.archlinux.org/viewtopic.php?pid=632500 this thread].<br />
<br />
If you get the error "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)" then you might want to change "localhost" in /etc/webapps/phpmyadmin/config.inc.php on this line:<br />
<br />
<pre><br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
</pre><br />
<br />
to your hostname specified in /etc/hosts and /etc/rc.conf under HOSTNAME.<br />
<br />
If you would like to use phpmyadmin setup script by calling http://localhost/phpmyadmin/setup you will need to create a config directory that's writeable by the httpd in the /usr/share/webapps/phpmyadmin as follows:<br />
<br />
<pre><br />
cd /usr/share/webapps/phpmyadmin<br />
sudo mkdir config<br />
sudo chgrp http config<br />
sudo chmod g+w config<br />
</pre><br />
<br />
==Other (Older) information==<br />
<br />
This page holds a sample 'config.inc.php' file that you can place in the main phpMyAdmin directory so that it immediately starts working<br />
<br />
'''Things you should do first'''<br />
<br />
Create a 'controluser', so that phpmyadmin can read from the main mysql database.<br />
<br />
<pre>mysql -u root -pYOURROOTPASSWORD<br />
mysql> grant usage on mysql.* to controluser@localhost identified by 'CONTROLPASS';<br />
</pre><br />
<br />
'''Where is phpmyadmin'''<br />
<br />
in phpmyadmin 3.2.2-3 the file is missing /srv/http/ create this symlik<br />
<br />
<pre>ln -s /usr/share/webapps/phpMyAdmin/ /srv/http/phpmyadmin<br />
</pre><br />
<br />
'''Things you should change'''<br />
<br />
controluser is set to controluser <br><br />
controlpass is set to password <br><br />
verbose is set to name_of_server<br />
<br />
'''Sample 'config.inc.php' file'''<br />
<pre><br />
<?php<br />
/*<br />
* Generated configuration file<br />
* Generated by: phpMyAdmin 2.11.8.1 setup script by Michal Čihař <michal@cihar.com><br />
* Version: $Id: setup.php 11423 2008-07-24 17:26:05Z lem9 $<br />
* Date: Mon, 01 Sep 2008 20:34:02 GMT<br />
*/<br />
<br />
/* Servers configuration */<br />
$i = 0;<br />
<br />
/* Server ravi-test-mysql (http) [1] */<br />
$i++;<br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
$cfg['Servers'][$i]['extension'] = 'mysql';<br />
$cfg['Servers'][$i]['port'] = '3306';<br />
$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />
$cfg['Servers'][$i]['compress'] = false;<br />
$cfg['Servers'][$i]['controluser'] = 'controluser';<br />
$cfg['Servers'][$i]['controlpass'] = 'password';<br />
$cfg['Servers'][$i]['auth_type'] = 'http';<br />
$cfg['Servers'][$i]['verbose'] = 'name_of_server';<br />
<br />
/* End of servers configuration */<br />
<br />
$cfg['LeftFrameLight'] = true;<br />
$cfg['LeftFrameDBTree'] = true;<br />
$cfg['LeftFrameDBSeparator'] = '_';<br />
$cfg['LeftFrameTableSeparator'] = '__';<br />
$cfg['LeftFrameTableLevel'] = 1;<br />
$cfg['LeftDisplayLogo'] = true;<br />
$cfg['LeftDisplayServers'] = false;<br />
$cfg['DisplayServersList'] = false;<br />
$cfg['DisplayDatabasesList'] = 'auto';<br />
$cfg['LeftPointerEnable'] = true;<br />
$cfg['DefaultTabServer'] = 'main.php';<br />
$cfg['DefaultTabDatabase'] = 'db_structure.php';<br />
$cfg['DefaultTabTable'] = 'tbl_structure.php';<br />
$cfg['LightTabs'] = false;<br />
$cfg['ErrorIconic'] = true;<br />
$cfg['MainPageIconic'] = true;<br />
$cfg['ReplaceHelpImg'] = true;<br />
$cfg['NavigationBarIconic'] = 'both';<br />
$cfg['PropertiesIconic'] = 'both';<br />
$cfg['BrowsePointerEnable'] = true;<br />
$cfg['BrowseMarkerEnable'] = true;<br />
$cfg['ModifyDeleteAtRight'] = false;<br />
$cfg['ModifyDeleteAtLeft'] = true;<br />
$cfg['RepeatCells'] = 100;<br />
$cfg['DefaultDisplay'] = 'horizontal';<br />
$cfg['TextareaCols'] = 40;<br />
$cfg['TextareaRows'] = 7;<br />
$cfg['LongtextDoubleTextarea'] = true;<br />
$cfg['TextareaAutoSelect'] = false;<br />
$cfg['CharEditing'] = 'input';<br />
$cfg['CharTextareaCols'] = 40;<br />
$cfg['CharTextareaRows'] = 2;<br />
$cfg['CtrlArrowsMoving'] = true;<br />
$cfg['DefaultPropDisplay'] = 'horizontal';<br />
$cfg['InsertRows'] = 2;<br />
$cfg['EditInWindow'] = true;<br />
$cfg['QueryWindowHeight'] = 310;<br />
$cfg['QueryWindowWidth'] = 550;<br />
$cfg['QueryWindowDefTab'] = 'sql';<br />
$cfg['ForceSSL'] = false;<br />
$cfg['ShowPhpInfo'] = false;<br />
$cfg['ShowChgPassword'] = false;<br />
$cfg['AllowArbitraryServer'] = false;<br />
$cfg['LoginCookieRecall'] = 'something';<br />
$cfg['LoginCookieValidity'] = 1800;<br />
?><br />
</pre></div>
BookMoth
https://wiki.archlinux.org/index.php?title=PhpMyAdmin_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=87896
PhpMyAdmin (简体中文)
2009-12-16T08:40:08Z
<p>BookMoth: </p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|PhpMyAdmin}}<br />
{{i18n_entry|Русский|PhpMyAdmin (russian)}}<br />
{{i18n_entry|简体中文|PhpMyAdmin (简体中文)}}<br />
{{i18n_links_end}}<br />
==准备==<br />
按照 [http://wiki.archlinux.org/index.php/LAMP LAMP] wiki 所说的方法安装apache, php 和 mysql。<br />
<br />
==安装==<br />
运行下面的命令安装 [http://www.phpmyadmin.net/ phpMyAdmin]。<br />
<br />
<pre><br />
#pacman -S phpmyadmin php-mcrypt<br />
</pre><br />
<br />
==配置==<br />
<br />
如果已经安装过老版本的phpmyadmin,请先删除:<br />
<br />
<pre><br />
rm -r /srv/httpd/phpMyAdmin<br />
</pre><br />
<br />
复制配置文件到你的httpd的配置文件目录<br />
<br />
<pre><br />
cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
将下面这行添加到 /etc/httpd/conf/httpd.conf:<br />
<br />
<pre><br />
Include conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
或者,在命令行执行下面的命令也是相同的结果:<br />
<br />
<pre><br />
echo -e "\nInclude conf/extra/httpd-phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf<br />
</pre><br />
<br />
编辑/usr/share/webapps/phpMyAdmin/.htaccess,像下面这样注释掉(或者删除)'deny form all':<br />
<br />
<pre><br />
#deny from all<br />
</pre><br />
<br />
否则在访问phpmyadmin installation时,会返回错误信息"Error 403 - Access forbidden!"。<br />
<br />
'/etc/httpd/conf/extra/httpd-phpmyadmin.conf'中应该包含了下面这些信息:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
<Directory "/usr/share/webapps/phpMyAdmin"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</pre><br />
<br />
打开'/etc/php/php.ini',编辑'open_basedir'这行,将下面的路径补充在后面:<br />
<br />
<pre><br />
:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
例如,像下面这个样子:<br />
<br />
<pre><br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
phpmyadmin需要PHP的mcrypt模块支持,编辑{{Filename|/etc/php/php.ini}}的:<br />
;extension=mcrypt.so<br />
:取消前面的注释<br />
extension=mcrypt.so<br />
<br />
==访问 phpmyadmin 安装==<br />
<br />
通过浏览器访问下面的链接,完成phpmyadmin安装:<br />
<br />
<pre><br />
http://localhost/phpmyadmin/<br />
或者<br />
http://localhost/phpmyadmin/index.php<br />
</pre><br />
<br />
注意: 'localhost' 是/etc/rc.conf文件中你配置的主机名.<br />
<br />
如果你希望像下面这样,不需要最后的/访问phpmyadmin:<br />
<br />
<pre><br />
http://localhost/phpmyadmin<br />
</pre><br />
<br />
需要将 '/etc/httpd/conf/extra/httpd-phpmyadmin.conf'当中的:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
</pre><br />
<br />
修改为:<br />
<br />
<pre><br />
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"<br />
</pre><br />
<br />
你可能需要参考 [http://bbs.archlinux.org/viewtopic.php?pid=632500 this thread].<br />
<br />
如果你看到了错误信息 "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)",你可能需要修改 /etc/webapps/phpmyadmin/config.inc.php 文件中的这一行:<br />
<br />
<pre><br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
</pre><br />
<br />
将"localhost"替换为你的 /etc/hosts 和 /etc/rc.conf文件中指定的主机名。<br />
<br />
<br />
如果你希望通过访问http://localhost/phpmyadmin/setup 使用phpmyadmin的安装脚本, 需要在/usr/share/webapps/phpmyadmin 目录下创建一个httpd用户可写的配置文件夹:<br />
<br />
<pre><br />
cd /usr/share/webapps/phpmyadmin<br />
sudo mkdir config<br />
sudo chgrp http config<br />
sudo chmod g+w config<br />
</pre><br />
<br />
==其他信息(过时)==<br />
<br />
This page holds a sample 'config.inc.php' file that you can place in the main phpMyAdmin directory so that it immediately starts working<br />
<br />
'''Things you should do first'''<br />
<br />
Create a 'controluser', so that phpmyadmin can read from the main mysql database.<br />
<br />
<pre>mysql -u root -pYOURROOTPASSWORD<br />
mysql> grant usage on mysql.* to controluser@localhost identified by 'CONTROLPASS';<br />
</pre><br />
<br />
'''Where is phpmyadmin'''<br />
<br />
in phpmyadmin 3.2.2-3 the file is missing /srv/http/ create this symlik<br />
<br />
<pre>ln -s /usr/share/webapps/phpMyAdmin/ /srv/http/phpmyadmin<br />
</pre><br />
<br />
'''Things you should change'''<br />
<br />
controluser is set to controluser <br><br />
controlpass is set to password <br><br />
verbose is set to name_of_server<br />
<br />
'''Sample 'config.inc.php' file'''<br />
<pre><br />
<?php<br />
/*<br />
* Generated configuration file<br />
* Generated by: phpMyAdmin 2.11.8.1 setup script by Michal Čihař <michal@cihar.com><br />
* Version: $Id: setup.php 11423 2008-07-24 17:26:05Z lem9 $<br />
* Date: Mon, 01 Sep 2008 20:34:02 GMT<br />
*/<br />
<br />
/* Servers configuration */<br />
$i = 0;<br />
<br />
/* Server ravi-test-mysql (http) [1] */<br />
$i++;<br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
$cfg['Servers'][$i]['extension'] = 'mysql';<br />
$cfg['Servers'][$i]['port'] = '3306';<br />
$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />
$cfg['Servers'][$i]['compress'] = false;<br />
$cfg['Servers'][$i]['controluser'] = 'controluser';<br />
$cfg['Servers'][$i]['controlpass'] = 'password';<br />
$cfg['Servers'][$i]['auth_type'] = 'http';<br />
$cfg['Servers'][$i]['verbose'] = 'name_of_server';<br />
<br />
/* End of servers configuration */<br />
<br />
$cfg['LeftFrameLight'] = true;<br />
$cfg['LeftFrameDBTree'] = true;<br />
$cfg['LeftFrameDBSeparator'] = '_';<br />
$cfg['LeftFrameTableSeparator'] = '__';<br />
$cfg['LeftFrameTableLevel'] = 1;<br />
$cfg['LeftDisplayLogo'] = true;<br />
$cfg['LeftDisplayServers'] = false;<br />
$cfg['DisplayServersList'] = false;<br />
$cfg['DisplayDatabasesList'] = 'auto';<br />
$cfg['LeftPointerEnable'] = true;<br />
$cfg['DefaultTabServer'] = 'main.php';<br />
$cfg['DefaultTabDatabase'] = 'db_structure.php';<br />
$cfg['DefaultTabTable'] = 'tbl_structure.php';<br />
$cfg['LightTabs'] = false;<br />
$cfg['ErrorIconic'] = true;<br />
$cfg['MainPageIconic'] = true;<br />
$cfg['ReplaceHelpImg'] = true;<br />
$cfg['NavigationBarIconic'] = 'both';<br />
$cfg['PropertiesIconic'] = 'both';<br />
$cfg['BrowsePointerEnable'] = true;<br />
$cfg['BrowseMarkerEnable'] = true;<br />
$cfg['ModifyDeleteAtRight'] = false;<br />
$cfg['ModifyDeleteAtLeft'] = true;<br />
$cfg['RepeatCells'] = 100;<br />
$cfg['DefaultDisplay'] = 'horizontal';<br />
$cfg['TextareaCols'] = 40;<br />
$cfg['TextareaRows'] = 7;<br />
$cfg['LongtextDoubleTextarea'] = true;<br />
$cfg['TextareaAutoSelect'] = false;<br />
$cfg['CharEditing'] = 'input';<br />
$cfg['CharTextareaCols'] = 40;<br />
$cfg['CharTextareaRows'] = 2;<br />
$cfg['CtrlArrowsMoving'] = true;<br />
$cfg['DefaultPropDisplay'] = 'horizontal';<br />
$cfg['InsertRows'] = 2;<br />
$cfg['EditInWindow'] = true;<br />
$cfg['QueryWindowHeight'] = 310;<br />
$cfg['QueryWindowWidth'] = 550;<br />
$cfg['QueryWindowDefTab'] = 'sql';<br />
$cfg['ForceSSL'] = false;<br />
$cfg['ShowPhpInfo'] = false;<br />
$cfg['ShowChgPassword'] = false;<br />
$cfg['AllowArbitraryServer'] = false;<br />
$cfg['LoginCookieRecall'] = 'something';<br />
$cfg['LoginCookieValidity'] = 1800;<br />
?><br />
</pre></div>
BookMoth
https://wiki.archlinux.org/index.php?title=PhpMyAdmin_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=87895
PhpMyAdmin (简体中文)
2009-12-16T08:39:24Z
<p>BookMoth: Created page with 'Category:Web Server (English) {{i18n_links_start}} {{i18n_entry|English|PhpMyAdmin}} {{i18n_entry|Русский|PhpMyAdmin (russian)}} {{i18n_entry|Русский|PhpMyAdmin…'</p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|PhpMyAdmin}}<br />
{{i18n_entry|Русский|PhpMyAdmin (russian)}}<br />
{{i18n_entry|Русский|PhpMyAdmin (简体中文)}}<br />
{{i18n_links_end}}<br />
==准备==<br />
按照 [http://wiki.archlinux.org/index.php/LAMP LAMP] wiki 所说的方法安装apache, php 和 mysql。<br />
<br />
==安装==<br />
运行下面的命令安装 [http://www.phpmyadmin.net/ phpMyAdmin]。<br />
<br />
<pre><br />
#pacman -S phpmyadmin php-mcrypt<br />
</pre><br />
<br />
==配置==<br />
<br />
如果已经安装过老版本的phpmyadmin,请先删除:<br />
<br />
<pre><br />
rm -r /srv/httpd/phpMyAdmin<br />
</pre><br />
<br />
复制配置文件到你的httpd的配置文件目录<br />
<br />
<pre><br />
cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
将下面这行添加到 /etc/httpd/conf/httpd.conf:<br />
<br />
<pre><br />
Include conf/extra/httpd-phpmyadmin.conf<br />
</pre><br />
<br />
或者,在命令行执行下面的命令也是相同的结果:<br />
<br />
<pre><br />
echo -e "\nInclude conf/extra/httpd-phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf<br />
</pre><br />
<br />
编辑/usr/share/webapps/phpMyAdmin/.htaccess,像下面这样注释掉(或者删除)'deny form all':<br />
<br />
<pre><br />
#deny from all<br />
</pre><br />
<br />
否则在访问phpmyadmin installation时,会返回错误信息"Error 403 - Access forbidden!"。<br />
<br />
'/etc/httpd/conf/extra/httpd-phpmyadmin.conf'中应该包含了下面这些信息:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
<Directory "/usr/share/webapps/phpMyAdmin"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
</pre><br />
<br />
打开'/etc/php/php.ini',编辑'open_basedir'这行,将下面的路径补充在后面:<br />
<br />
<pre><br />
:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
例如,像下面这个样子:<br />
<br />
<pre><br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/srv/:/usr/share/webapps/:/etc/webapps<br />
</pre><br />
<br />
phpmyadmin需要PHP的mcrypt模块支持,编辑{{Filename|/etc/php/php.ini}}的:<br />
;extension=mcrypt.so<br />
:取消前面的注释<br />
extension=mcrypt.so<br />
<br />
==访问 phpmyadmin 安装==<br />
<br />
通过浏览器访问下面的链接,完成phpmyadmin安装:<br />
<br />
<pre><br />
http://localhost/phpmyadmin/<br />
或者<br />
http://localhost/phpmyadmin/index.php<br />
</pre><br />
<br />
注意: 'localhost' 是/etc/rc.conf文件中你配置的主机名.<br />
<br />
如果你希望像下面这样,不需要最后的/访问phpmyadmin:<br />
<br />
<pre><br />
http://localhost/phpmyadmin<br />
</pre><br />
<br />
需要将 '/etc/httpd/conf/extra/httpd-phpmyadmin.conf'当中的:<br />
<br />
<pre><br />
Alias /phpmyadmin/ "/usr/share/webapps/phpMyAdmin/"<br />
</pre><br />
<br />
修改为:<br />
<br />
<pre><br />
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"<br />
</pre><br />
<br />
你可能需要参考 [http://bbs.archlinux.org/viewtopic.php?pid=632500 this thread].<br />
<br />
如果你看到了错误信息 "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)",你可能需要修改 /etc/webapps/phpmyadmin/config.inc.php 文件中的这一行:<br />
<br />
<pre><br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
</pre><br />
<br />
将"localhost"替换为你的 /etc/hosts 和 /etc/rc.conf文件中指定的主机名。<br />
<br />
<br />
如果你希望通过访问http://localhost/phpmyadmin/setup 使用phpmyadmin的安装脚本, 需要在/usr/share/webapps/phpmyadmin 目录下创建一个httpd用户可写的配置文件夹:<br />
<br />
<pre><br />
cd /usr/share/webapps/phpmyadmin<br />
sudo mkdir config<br />
sudo chgrp http config<br />
sudo chmod g+w config<br />
</pre><br />
<br />
==其他信息(过时)==<br />
<br />
This page holds a sample 'config.inc.php' file that you can place in the main phpMyAdmin directory so that it immediately starts working<br />
<br />
'''Things you should do first'''<br />
<br />
Create a 'controluser', so that phpmyadmin can read from the main mysql database.<br />
<br />
<pre>mysql -u root -pYOURROOTPASSWORD<br />
mysql> grant usage on mysql.* to controluser@localhost identified by 'CONTROLPASS';<br />
</pre><br />
<br />
'''Where is phpmyadmin'''<br />
<br />
in phpmyadmin 3.2.2-3 the file is missing /srv/http/ create this symlik<br />
<br />
<pre>ln -s /usr/share/webapps/phpMyAdmin/ /srv/http/phpmyadmin<br />
</pre><br />
<br />
'''Things you should change'''<br />
<br />
controluser is set to controluser <br><br />
controlpass is set to password <br><br />
verbose is set to name_of_server<br />
<br />
'''Sample 'config.inc.php' file'''<br />
<pre><br />
<?php<br />
/*<br />
* Generated configuration file<br />
* Generated by: phpMyAdmin 2.11.8.1 setup script by Michal Čihař <michal@cihar.com><br />
* Version: $Id: setup.php 11423 2008-07-24 17:26:05Z lem9 $<br />
* Date: Mon, 01 Sep 2008 20:34:02 GMT<br />
*/<br />
<br />
/* Servers configuration */<br />
$i = 0;<br />
<br />
/* Server ravi-test-mysql (http) [1] */<br />
$i++;<br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
$cfg['Servers'][$i]['extension'] = 'mysql';<br />
$cfg['Servers'][$i]['port'] = '3306';<br />
$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />
$cfg['Servers'][$i]['compress'] = false;<br />
$cfg['Servers'][$i]['controluser'] = 'controluser';<br />
$cfg['Servers'][$i]['controlpass'] = 'password';<br />
$cfg['Servers'][$i]['auth_type'] = 'http';<br />
$cfg['Servers'][$i]['verbose'] = 'name_of_server';<br />
<br />
/* End of servers configuration */<br />
<br />
$cfg['LeftFrameLight'] = true;<br />
$cfg['LeftFrameDBTree'] = true;<br />
$cfg['LeftFrameDBSeparator'] = '_';<br />
$cfg['LeftFrameTableSeparator'] = '__';<br />
$cfg['LeftFrameTableLevel'] = 1;<br />
$cfg['LeftDisplayLogo'] = true;<br />
$cfg['LeftDisplayServers'] = false;<br />
$cfg['DisplayServersList'] = false;<br />
$cfg['DisplayDatabasesList'] = 'auto';<br />
$cfg['LeftPointerEnable'] = true;<br />
$cfg['DefaultTabServer'] = 'main.php';<br />
$cfg['DefaultTabDatabase'] = 'db_structure.php';<br />
$cfg['DefaultTabTable'] = 'tbl_structure.php';<br />
$cfg['LightTabs'] = false;<br />
$cfg['ErrorIconic'] = true;<br />
$cfg['MainPageIconic'] = true;<br />
$cfg['ReplaceHelpImg'] = true;<br />
$cfg['NavigationBarIconic'] = 'both';<br />
$cfg['PropertiesIconic'] = 'both';<br />
$cfg['BrowsePointerEnable'] = true;<br />
$cfg['BrowseMarkerEnable'] = true;<br />
$cfg['ModifyDeleteAtRight'] = false;<br />
$cfg['ModifyDeleteAtLeft'] = true;<br />
$cfg['RepeatCells'] = 100;<br />
$cfg['DefaultDisplay'] = 'horizontal';<br />
$cfg['TextareaCols'] = 40;<br />
$cfg['TextareaRows'] = 7;<br />
$cfg['LongtextDoubleTextarea'] = true;<br />
$cfg['TextareaAutoSelect'] = false;<br />
$cfg['CharEditing'] = 'input';<br />
$cfg['CharTextareaCols'] = 40;<br />
$cfg['CharTextareaRows'] = 2;<br />
$cfg['CtrlArrowsMoving'] = true;<br />
$cfg['DefaultPropDisplay'] = 'horizontal';<br />
$cfg['InsertRows'] = 2;<br />
$cfg['EditInWindow'] = true;<br />
$cfg['QueryWindowHeight'] = 310;<br />
$cfg['QueryWindowWidth'] = 550;<br />
$cfg['QueryWindowDefTab'] = 'sql';<br />
$cfg['ForceSSL'] = false;<br />
$cfg['ShowPhpInfo'] = false;<br />
$cfg['ShowChgPassword'] = false;<br />
$cfg['AllowArbitraryServer'] = false;<br />
$cfg['LoginCookieRecall'] = 'something';<br />
$cfg['LoginCookieValidity'] = 1800;<br />
?><br />
</pre></div>
BookMoth
https://wiki.archlinux.org/index.php?title=Apache_HTTP_Server_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=84430
Apache HTTP Server (简体中文)
2009-11-19T05:34:29Z
<p>BookMoth: /* Apache, PHP, and MySQL */</p>
<hr />
<div>[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
<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_links_end}}<br />
<br />
这个文档描述了怎样在Archlinux系统上安装设置Apache网页服务器。以及选择安装PHP和MySQL并集成到Apache服务器中。<br />
<br />
如果你只是用来开发和测试, [[Xampp]] 可能更简便一些。<br />
==安装==<br />
<br />
# pacman -S apache php php-apache mysql<br />
<br />
你可以只单独安装Apache,PHP或者MySQL,也可以安装所有包。这个文档假设你安装全部,当然你可以忽略任何部分。<br />
<br />
{{Box Note | 新默认用户和用户组: 取代了原先的用户组group "nobody" ,现在默认以user/group "http" 来运行Apache。根据这个变化,需要调整httpd.conf,虽然仍然能够用nobody来运行httpd。}}<br />
<br />
==配置==<br />
===配置Apache===<br />
<br />
* 添加新用户http<br />
# useradd -d /srv/http -r -s /bin/false -U http<br />
<br />
* 添加以下行到文件{{Filename|/etc/hosts}} (如果文件不存在,则创建一个新的):<br />
127.0.0.1 localhost.localdomain localhost<br />
'''注意:''' 如果你想要不同的域名,在末尾追加以下行:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* 编辑 {{Filename|/etc/rc.conf}}: 如果第一步你设置了域名,那么HOSTNAME 变量应该一致,否则使用"localhost":<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* 在Apache配置文件注释一个模块<br />
# nano /etc/httpd/conf/httpd.conf<br />
把<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
注释为<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
* 在终端以root用户运行:<br />
# /etc/rc.d/httpd start<br />
<br />
* 那么现在Apache应该在运行了。在网页浏览器里测试下<code>http://localhost/</code> 。应该显示一个简单的Apache测试页面。<br />
<br />
* 编辑 {{Filename|/etc/rc.conf}} (设置Apache为开机运行):<br />
DAEMONS=(''... some daemons ...'' httpd)<br />
'''或者''' 添加以下行到 {{Filename|/etc/rc.local}}:<br />
/etc/rc.d/httpd start<br />
<br />
* 如果你想使某用户目录(比如<code>~/public_html</code> 在机器上通过<code>http://localhost/~user/</code>访问) 可以被访问,请在{{Filename|/etc/httpd/conf/extra/httpd-userdir.conf}}取消注释以下行:<br />
UserDir public_html<br />
和<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 />
请确认你的用户目录权限正确设置使apache可以访问,你的用户目录和<code>~/public_html/</code>必有要有可执行权限。这样就可以了:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
如果你对安全问题很偏执的话,还有其它更安全的方法设置权限,可以创建一个只允许apache和你可以访问特别组。<br />
<br />
====高级选项====<br />
<br />
下面这些参数可以在{{Filename|/etc/httpd/conf/httpd.conf}} 中看到,有些可能你会感兴趣:<br />
<br />
# Listen 80<br />
<br />
这是Apache监听的端口。对于通过路由器的网络,应该转发这个端口。<br />
<br />
# ServerAdmin sample@sample.com<br />
<br />
这是管理员admin的email地址,可以在出错页面error-pages找到,比如.<br />
<br />
# DocumentRoot "/srv/http"<br />
<br />
这是你网页存放的目录,可以改变它,改了之后,还要把这也改成相应的目录<br />
<br />
<Directory "/srv/http"><br />
<br />
===配置PHP===<br />
<br />
PHP基本上可以使用的了.<br />
<br />
* 在{{Filename|/etc/httpd/conf/httpd.conf}}中添加:<br />
:把它们添加到 "LoadModule" 列表的后面或者文件的最后。<br />
LoadModule php5_module modules/libphp5.so<br />
Include /etc/httpd/conf/extra/php5_module.conf<br />
{{Box Note | 如果在Apache的modules目录中没有{{Filename|libphp.so}},请检查是否安装了''php-apache''包。}}<br />
<br />
* 如果你的<code>DocumentRoot</code>是在<code>/home/</code>以外地方,在<code>/etc/php/php.ini</code>添加这个<code>open_basedir</code> 成:<br />
open_basedir = /home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* 重启Apache服务使修改生效(以root用户):<br />
# /etc/rc.d/httpd restart<br />
<br />
* 用非常简单而又强大的脚本测试:<br />
<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 />
保存此文件为<code>test.php</code> 复制到<code>/srv/http/</code> 或 <code>~/public_html</code>如果你允许此权限。当然请把它设置为可执行文件(<code>chmod o+x test.php</code>).<br />
<br />
* 测试 PHP: http://localhost/test.php 或 http://localhost/~myname/test.php<br />
<br />
:如果php脚本没有执行 (你看到了: <html>...</html>),在{{Filename|/etc/httpd/conf/httpd.conf}}中添加:<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
<br />
====高级选项====<br />
* 如果有需要默认解析.phtml文件,请记住在 {{Filename|/etc/httpd/conf/extra/php5_module.conf}}中添加.phtml:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* 如果你要libGD模块请把<code>/etc/php/php.ini</code>里的<br />
;extension=gd.so<br />
取消注释为<br />
extension=gd.so<br />
<br />
* 如果你在调试PHP时需要显示PHP的错误信息,将 {{Filename|/etc/php/php.ini}}当中的这行:<br />
display_errors=Off<br />
修改为<br />
display_errors=On<br />
<br />
* 如果你需要使用 mcrypt module,安装php-mcrypt包,并将 {{Filename|/etc/php/php.ini}}这行:<br />
;extension=mcrypt.so<br />
:前面的注释取消<br />
extension=mcrypt.so<br />
<br />
===配置MySQL===<br />
<br />
如果只要设置支持MySQL,做以下步骤就行了,至于具体配置MySQL请参考: [[MySQL]]<br />
<br />
* 编辑{{Filename|/etc/php/php.ini}} (旧系统在<code>/usr/etc</code>里) to 取消注释如下行(<i>移除<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 />
* 在终端下运行:<br />
# /etc/rc.d/mysqld start<br />
<br />
* 有必要的话重启Apache,在终端下运行:<br />
# /etc/rc.d/httpd restart<br />
<br />
* MySQL应该在运行了。设置 root 密码并进行测试:<br />
# mysqladmin -u root password ''password''<br />
# mysql -u root -p<br />
<br />
:输入 ''exit'' 退出MySQL命令行客户端<br />
<br />
* 编辑 {{Filename|/etc/rc.conf}} (设置MySQL开机运行):<br />
DAEMONS=(... '''mysqld''' ...)<br />
或者在 {{Filename|rc.local}}中添加:<br />
/etc/rc.d/mysqld start<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 />
* 如果你出现这个问题,请在{{Filename|/etc/hosts.allow}} 添加以下行:<br />
<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* 注意: 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 />
* 你可能需要编辑{{Filename|/etc/my.cnf}}把<code>skip-networking</code>注释掉:<br />
<br />
skip-networking<br />
<br />
修改为<br />
<br />
#skip-networking<br />
<br />
==参考==<br />
* [[MySQL]] - MySQL相关内容<br />
* [[Xampp]] - 一个支持PHP, Perl和MySQL的服务器套件<br />
<br />
==链接==<br />
* http://www.apache.org/<br />
* http://www.php.net/<br />
* http://www.mysql.com/</div>
BookMoth
https://wiki.archlinux.org/index.php?title=Apache_HTTP_Server_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=84429
Apache HTTP Server (简体中文)
2009-11-19T05:17:16Z
<p>BookMoth: /* 配置PHP */</p>
<hr />
<div>[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
<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_links_end}}<br />
<br />
===Apache, PHP, and MySQL===<br />
<br />
这个文档描述了怎样在Archlinux系统上安装设置Apache网页服务器。以及选择安装PHP和MySQL并集成到Apache服务器中。如果你只是用来开发和测试, [[Xampp]] 可能更简便一些。<br />
====安装软件包====<br />
<br />
# pacman -S apache php php-apache mysql<br />
<br />
你可以只单独安装Apache,PHP或者MySQL,也可以安装所有包。这个文档假设你安装全部,当然你可以忽略任何部分。<br />
<br />
{{Box Note | 新默认用户和用户组: 取代了原先的用户组group "nobody" ,现在默认以user/group "http" 来运行Apache。根据这个变化,需要调整httpd.conf,虽然仍然能够用nobody来运行httpd。}}<br />
<br />
====配置Apache====<br />
<br />
* 添加新用户http<br />
# useradd -d /srv/http -r -s /bin/false -U http<br />
<br />
* 添加以下行到文件<code>/etc/hosts</code> (如果文件不存在,则创建一个新的):<br />
127.0.0.1 localhost.localdomain localhost<br />
'''注意:''' 如果你想要不同的域名,在末尾追加以下行:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* 编辑 <code>/etc/rc.conf</code>: 如果第一步你设置了域名,那么HOSTNAME 变量应该一致,否则使用"localhost":<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* 在Apache配置文件注释一个模块<br />
# nano /etc/httpd/conf/httpd.conf<br />
把<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
注释为<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
* 在终端以root用户运行:<br />
# /etc/rc.d/httpd start<br />
<br />
* 那么现在Apache应该在运行了。在网页浏览器里测试下<code>http://localhost/</code> 。应该显示一个简单的Apache测试页面。<br />
<br />
* 编辑 <code>/etc/rc.conf</code> (设置Apache为开机运行):<br />
DAEMONS=(''... some daemons ...'' httpd)<br />
'''或者''' 添加以下行到 <code>/etc/rc.local</code>:<br />
/etc/rc.d/httpd start<br />
<br />
* 如果你想使某用户目录(比如<code>~/public_html</code> 在机器上通过<code>http://localhost/~user/</code>访问) 可以被访问,请在<code>/etc/httpd/conf/extra/httpd-userdir.conf</code>取消注释以下行:<br />
UserDir public_html<br />
和<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 />
请确认你的用户目录权限正确设置使apache可以访问,你的用户目录和<code>~/public_html/</code>必有要有可执行权限。这样就可以了:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
如果你对安全问题很偏执的话,还有其它更安全的方法设置权限,可以创建一个只允许apache和你可以访问特别组。<br />
<br />
=====另外的参数=====<br />
<br />
下面这些参数可以在/etc/httpd/conf/httpd.conf 中看到,有些可能你会感兴趣:<br />
<br />
# Listen 80<br />
<br />
这是Apache监听的端口。对于通过路由器的网络,应该转发这个端口。<br />
<br />
# ServerAdmin sample@sample.com<br />
<br />
这是管理员admin的email地址,可以在出错页面error-pages找到,比如.<br />
<br />
# DocumentRoot "/srv/http"<br />
<br />
这是你网页存放的目录,可以改变它,改了之后,还要把这也改成相应的目录<br />
<br />
<Directory "/srv/http"><br />
<br />
====配置PHP====<br />
<br />
PHP基本上可以使用的了.<br />
<br />
* 在<code>/etc/httpd/conf/httpd.conf</code>中添加:<br />
:把它们添加到 "LoadModule" 列表的后面或者文件的最后。<br />
LoadModule php5_module modules/libphp5.so<br />
Include /etc/httpd/conf/extra/php5_module.conf<br />
{{Box Note | 如果在Apache的modules目录中没有{{Filename|libphp.so}},请检查是否安装了''php-apache''包。}}<br />
<br />
* 如果你的<code>DocumentRoot</code>是在<code>/home/</code>以外地方,在<code>/etc/php/php.ini</code>添加这个<code>open_basedir</code> 成:<br />
open_basedir = /home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* 重启Apache服务使修改生效(以root用户):<br />
# /etc/rc.d/httpd restart<br />
<br />
* 用非常简单而又强大的脚本测试:<br />
<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 />
保存此文件为<code>test.php</code> 复制到<code>/srv/http/</code> 或 <code>~/public_html</code>如果你允许此权限。当然请把它设置为可执行文件(<code>chmod o+x test.php</code>).<br />
<br />
* 测试 PHP: http://localhost/test.php 或 http://localhost/~myname/test.php<br />
<br />
:如果php脚本没有执行 (你看到了: <html>...</html>),在{{Filename|/etc/httpd/conf/httpd.conf}}中添加:<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
<br />
====Advanced options====<br />
* 如果有需要默认解析.phtml文件,请记住在 {{Filename|/etc/httpd/conf/extra/php5_module.conf}}中添加.phtml:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* 如果你要libGD模块请把<code>/etc/php/php.ini</code>里的<br />
;extension=gd.so<br />
取消注释为<br />
extension=gd.so<br />
<br />
* 如果你在调试PHP时需要显示PHP的错误信息,将 {{Filename|/etc/php/php.ini}}当中的这行:<br />
display_errors=Off<br />
修改为<br />
display_errors=On<br />
<br />
* 如果你需要使用 mcrypt module,安装php-mcrypt包,并将 {{Filename|/etc/php/php.ini}}这行:<br />
;extension=mcrypt.so<br />
:前面的注释取消<br />
extension=mcrypt.so<br />
<br />
====设置支持MySQL数据库====<br />
<br />
如果只要设置支持MySQL,做以下步骤就行了,至于具体配置MySQL请参考: [[MySQL]]<br />
<br />
* 编辑 <code>/etc/php/php.ini</code> (旧系统在<code>/usr/etc</code>里) to 取消注释如下行(<i>移除<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 />
* 在终端下运行:<br />
# /etc/rc.d/mysqld start<br />
<br />
* 有必要的话重启Apache,在终端下运行:<br />
# /etc/rc.d/httpd restart<br />
<br />
* MySQL应该在运行了。设置 root 密码并进行测试:<br />
# mysqladmin -u root password ''password''<br />
# mysql -u root -p<br />
<br />
:输入 ''exit'' 退出MySQL命令行客户端<br />
<br />
* 编辑 {{Filename|/etc/rc.conf}} (设置MySQL开机运行):<br />
DAEMONS=(... '''mysqld''' ...)<br />
或者在 {{Filename|rc.local}}中添加:<br />
/etc/rc.d/mysqld start<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 />
* 如果你出现这个问题,请在/etc/hosts.allow 添加以下行:<br />
<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* 注意: 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 />
* 你可能需要编辑<code>/etc/my.cnf</code>把<code>skip-networking</code>注释掉:<br />
<br />
skip-networking<br />
<br />
修改为<br />
<br />
#skip-networking</div>
BookMoth
https://wiki.archlinux.org/index.php?title=Apache_HTTP_Server_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=84428
Apache HTTP Server (简体中文)
2009-11-19T04:44:24Z
<p>BookMoth: /* Apache, PHP, and MySQL */</p>
<hr />
<div>[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
[[Category:简体中文]]<br />
<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_links_end}}<br />
<br />
===Apache, PHP, and MySQL===<br />
<br />
这个文档描述了怎样在Archlinux系统上安装设置Apache网页服务器。以及选择安装PHP和MySQL并集成到Apache服务器中。如果你只是用来开发和测试, [[Xampp]] 可能更简便一些。<br />
====安装软件包====<br />
<br />
# pacman -S apache php php-apache mysql<br />
<br />
你可以只单独安装Apache,PHP或者MySQL,也可以安装所有包。这个文档假设你安装全部,当然你可以忽略任何部分。<br />
<br />
{{Box Note | 新默认用户和用户组: 取代了原先的用户组group "nobody" ,现在默认以user/group "http" 来运行Apache。根据这个变化,需要调整httpd.conf,虽然仍然能够用nobody来运行httpd。}}<br />
<br />
====配置Apache====<br />
<br />
* 添加新用户http<br />
# useradd -d /srv/http -r -s /bin/false -U http<br />
<br />
* 添加以下行到文件<code>/etc/hosts</code> (如果文件不存在,则创建一个新的):<br />
127.0.0.1 localhost.localdomain localhost<br />
'''注意:''' 如果你想要不同的域名,在末尾追加以下行:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* 编辑 <code>/etc/rc.conf</code>: 如果第一步你设置了域名,那么HOSTNAME 变量应该一致,否则使用"localhost":<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* 在Apache配置文件注释一个模块<br />
# nano /etc/httpd/conf/httpd.conf<br />
把<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
注释为<br />
#LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
* 在终端以root用户运行:<br />
# /etc/rc.d/httpd start<br />
<br />
* 那么现在Apache应该在运行了。在网页浏览器里测试下<code>http://localhost/</code> 。应该显示一个简单的Apache测试页面。<br />
<br />
* 编辑 <code>/etc/rc.conf</code> (设置Apache为开机运行):<br />
DAEMONS=(''... some daemons ...'' httpd)<br />
'''或者''' 添加以下行到 <code>/etc/rc.local</code>:<br />
/etc/rc.d/httpd start<br />
<br />
* 如果你想使某用户目录(比如<code>~/public_html</code> 在机器上通过<code>http://localhost/~user/</code>访问) 可以被访问,请在<code>/etc/httpd/conf/extra/httpd-userdir.conf</code>取消注释以下行:<br />
UserDir public_html<br />
和<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 />
请确认你的用户目录权限正确设置使apache可以访问,你的用户目录和<code>~/public_html/</code>必有要有可执行权限。这样就可以了:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
如果你对安全问题很偏执的话,还有其它更安全的方法设置权限,可以创建一个只允许apache和你可以访问特别组。<br />
<br />
=====另外的参数=====<br />
<br />
下面这些参数可以在/etc/httpd/conf/httpd.conf 中看到,有些可能你会感兴趣:<br />
<br />
# Listen 80<br />
<br />
这是Apache监听的端口。对于通过路由器的网络,应该转发这个端口。<br />
<br />
# ServerAdmin sample@sample.com<br />
<br />
这是管理员admin的email地址,可以在出错页面error-pages找到,比如.<br />
<br />
# DocumentRoot "/srv/http"<br />
<br />
这是你网页存放的目录,可以改变它,改了之后,还要把这也改成相应的目录<br />
<br />
<Directory "/srv/http"><br />
<br />
====配置PHP====<br />
<br />
PHP基本上可以使用的了.<br />
<br />
* 在<code>/etc/httpd/conf/httpd.conf</code>中把下面这行注释去掉(uncomment)<br />
#LoadModule php5_module modules/libphp5.so<br />
改为to<br />
LoadModule php5_module modules/libphp5.so<br />
<br />
* PHP5文件解析已经默认设置了:<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 />
* 在Apache配置文件里不存在LoadModule php5_module modules/libphp5.so这行,正确的方法应该在/etc/httpd/conf/httpd.conf结束部分加上<br />
# PHP support<br />
Include conf/extra/php5_module.conf<br />
{{Box Note | 如果在Apache的modules目录中没有{{Filename|libphp.so}},请检查是否安装了''php-apache''包。}}<br />
<br />
* 如果有需要默认解析.phtml文件,请记住添加.phtml到这行:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* 如果你要libGD模块请把<code>/etc/php/php.ini</code>里的<br />
;extension=gd.so<br />
取消注释为<br />
extension=gd.so<br />
<br />
* 如果你的<code>DocumentRoot</code>是在<code>/home/</code>以外地方,在<code>/etc/php/php.ini</code>添加这个<code>open_basedir</code> 成:<br />
open_basedir = /home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* 重启Apache服务使修改生效(以root用户):<br />
# /etc/rc.d/httpd restart<br />
<br />
* 用非常简单而又强大的脚本测试:<br />
<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 />
保存此文件为<code>test.php</code> 复制到<code>/srv/http/</code> 或 <code>~/public_html</code>如果你允许此权限。当然请把它设置为可执行文件(<code>chmod o+x test.php</code>).<br />
<br />
* 测试 PHP: http://localhost/test.php 或 http://localhost/~myname/test.php<br />
<br />
====设置支持MySQL数据库====<br />
<br />
如果只要设置支持MySQL,做以下步骤就行了,至于具体配置MySQL请参考: [[MySQL]]<br />
<br />
* 编辑 <code>/etc/php/php.ini</code> (旧系统在<code>/usr/etc</code>里) to 取消注释如下行(<i>移除<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 />
* 在终端下运行:<br />
# /etc/rc.d/mysqld start<br />
<br />
* 有必要的话重启Apache,在终端下运行:<br />
# /etc/rc.d/httpd restart<br />
<br />
* MySQL应该在运行了。设置 root 密码并进行测试:<br />
# mysqladmin -u root password ''password''<br />
# mysql -u root -p<br />
<br />
:输入 ''exit'' 退出MySQL命令行客户端<br />
<br />
* 编辑 {{Filename|/etc/rc.conf}} (设置MySQL开机运行):<br />
DAEMONS=(... '''mysqld''' ...)<br />
或者在 {{Filename|rc.local}}中添加:<br />
/etc/rc.d/mysqld start<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 />
* 如果你出现这个问题,请在/etc/hosts.allow 添加以下行:<br />
<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
* 注意: 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 />
* 你可能需要编辑<code>/etc/my.cnf</code>把<code>skip-networking</code>注释掉:<br />
<br />
skip-networking<br />
<br />
修改为<br />
<br />
#skip-networking</div>
BookMoth