偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

LAMP、phpMyAdmin的使用

運維 系統(tǒng)運維
LAMP、phpMyAdmin的使用:LAMP是Linux操作系統(tǒng),Apache網(wǎng)絡(luò)服務(wù)器,MySQL數(shù)據(jù)庫,Perl、PHP或者Python編程語言,他具有Web資源豐富、輕量、快速開發(fā)等特點,是企業(yè)搭建網(wǎng)站的首選平臺。LAMP、phpMyAdmin的使用

LAMP、phpMyAdmin的安裝、配置、整合與使用詳解

  Linux系統(tǒng)中程序的安裝和使用切記:

  1、查看相關(guān)權(quán)限是否允許。

  2、查看版本是否與附屬軟件版本對應(yīng)。

  3、查看服務(wù)目錄與操作目錄是否對應(yīng)。

  apache知識:

  netstat -a -o:查看監(jiān)聽的端口程序和相應(yīng)的端口及程序的PID。

  netstat -lnp|grep 端口號:查看使用端口號程序相關(guān)信息、

  #ps 端口號:查看端口號相關(guān)信息、kill -9 端口:殺掉端口號。

  /etc/httpd/conf:httpd文件一般所有位置。

   Options Indexes FollowSymLinks AllowOverride None:保留Indexes時表示沒有主顯示頁面時頁面將以列表的方式顯示。

  ./configure --prefix=/usr/local/apache/ ... -enable-dav -enable-so -enable-maintainer-mode -enable-rewrite:安裝編輯時要加上應(yīng)有的后綴名才能與其它程序(SVN)整合使用。

  當(dāng)訪問主目錄顯示的頁面內(nèi)容為:Apache 2 Test Page [powered by CentOS]……時:修改/etc/httpd/conf.d/welcome.conf文件,注釋ErrorDocument 403 /error/noindex.html等相關(guān)內(nèi)容。

  netstat -utl:查看apache是否啟動。

  netstat -tuln | grep ':80':查看80端口狀態(tài)。

  權(quán)限的設(shè)定范例:

  

  1.   Options ExecCGI  
  2.  
  3.   SetHandler cgi-script  
  4.  
  5.     
  6.  
  7.   order allow,deny  
  8.  
  9.   deny from 192.168.100  
  10.  
  11.   allow from all  
  12.  
  13.     
  14.  
  15.     
  16.  
  17.   order allow,deny  
  18.  
  19.   allow from 192.168.1.50  
  20.  
  21.   deny from all  
  22.  
  23.     
  24.  
  25.   order allow,deny  
  26.  
  27.   deny from 192.168.1.100  
  28.  
  29.   allow from all  
  30.  

  

  虛擬主機設(shè)定范例:

  # 在這個檔案的最下方加入底下這些字眼!

  # 設(shè)定你的虛擬主機判定的依據(jù)!這里是* 亦即是

  1.   NameVirtualHost *  
  2.  

  # 所有連上這部機器的名稱都會被使用來當(dāng)作虛擬主機的設(shè)定之用!

  

  1.   ServerName mdk90.vbird.net  
  2.  
  3.   DocumentRoot /home/mdk90  
  4.  
  5.     
  6.  
  7.     
  8.  
  9.   ServerName www.mdk90.vbird.net  
  10.  
  11.   DocumentRoot /home/www.mdk90  
  12.  
  13.   CustomLog /var/log/httpd/www.access_log combined # 特別將登錄檔額外分離出來  
  14.  
  15.     
  16.  
  17.     
  18.  
  19.   ServerName phorum.mdk90.vbird.net  
  20.  
  21.   DocumentRoot /home/phorum.mdk90  
  22.  
  23.     
  24.  

  ab:Apache 的效能測試,/usr/sbin/ab [-dSk] [-c number] [-n number] 網(wǎng)頁.php,參數(shù)說明:

  -d :不要顯示 saved table 的百分比資料;通常不要那個數(shù)據(jù),所以會加 -d

  -k :還記得上面的 KeepAlive 吧!加入 -k 才會以這樣的功能測試;

  -S :不顯示長訊息,僅顯示類似 min/avg/max 的簡短易懂訊息!

  -c :同時有多少個『同時聯(lián)機』的設(shè)定(可想成同時聯(lián)機的 IP )

  -n :同一個聯(lián)機建立幾個要求通道!(可想成同一個 IP 要求的幾條聯(lián)機)。

  403:Forbidden You don't have permission to access / on this server問題解決方法:

  1、查看httpd的真實作用位置打開后進行配,位置:/etc/httpd/conf/httpd.conf。

  2、Directory <”\www\”>:中括號里的內(nèi)容就是你更改的新值、conf 配置文件:# Options Indexes FollowSymLinks,AllowOverride Non,Order allow,deny,Allow from all。

  3、你沒有為該目錄或者該文件設(shè)置guest組權(quán)限,chmod -R 755 /www。

  mysql知識:chown –R 賬戶:密碼 /usr/local/mysql:修改文件夾權(quán)限所屬用戶。

  ps -auxwww|grep mysql:檢查mysql服務(wù)是否啟動。

  service mysqld start:開啟mysql服務(wù)。

  mysql -uroot -p -S/tmp/mysql.sock:用-S參數(shù)在運行時指定正確的socket。

  rpm -qa | grep mysql| mysql --version:查看mysql安裝的版本。

  yum install mysql-server php-mysql:安裝mysql服務(wù)。

  mysql -uroot -p123456:進入mysql安裝目錄114.92.120.11中的bin中進行mysql的登錄。

  # /etc/init.d/mysql stop、# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &、# mysql -u root mysql、mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’、mysql> FLUSH PRIVILEGES:修改數(shù)據(jù)庫密碼。

  mysqladmin -uroot -p密碼 shutdown:停止mysql服務(wù)。

  long_query_time=2;log-slow-queries=/usr/var/slowquery.log:設(shè)置SQL語句查詢慢時,輸出SQL語句到指定文件。

  mysqldump -uroot -p密碼 數(shù)據(jù)庫名>backup.sql:備份數(shù)據(jù)庫到指定目錄。

  mysql -uroot -p 數(shù)據(jù)庫名

  系統(tǒng)出現(xiàn):ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)錯誤時:使用service mysqld restart重啟即可。

  vi /etc/rc.d/rc.local:# 將這一行加入這個檔案***(cd /usr/local/mysql; /usr/local/mysql/bin/safe_mysqld --user=mysql &)# 這樣一來,每次開機就可以自動的啟動 MySQL 啰!

  mysql與phpMyAdmin整合知識:

  切記mysql與php整合時要使用yum install php-mysql安裝php-mysql。

  復(fù)制 library/config.default.php到../config.inc.php,文件權(quán)限全為755,修改其中內(nèi)容:

  1.   $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin/';  
  2.  
  3.   $cfg['Servers'][$i]['host'] = 'localhost'; #將host值改為localhost或者127.0.0.1或者是真實IP,如我寫的192.168.6.166  
  4.  
  5.   $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';  
  6.  
  7.   $cfg['Servers'][$i]['user'] = 'root';  
  8.  
  9.   $cfg['Servers'][$i]['password'] = '123456';  
  10.  

  錯誤:#2002 - 服務(wù)器沒有響應(yīng) (or the local MySQL server's socket is not correctly configured)解決方法:

  1、查看my.cnf文件中的 bind-address = 127.0.0.1與config.inc.php 參數(shù) $cfg['Servers'][$i]['host']='localhost'; 中l(wèi)ocalhost 改為 127.0.0.1。

  2、查看phpinfo.php輸入?yún)?shù)中mysql.sock在php配置的文件所在位置對應(yīng)my.cnf文件中的socket=/tmp/mysql.sock屬性是否一致,再重啟。

  錯誤:#104***ccess denied for user 'root'@'localhost' (using password: NO)解決方法:

  1、***次使用phpMyAdmin可能不要設(shè)置用戶名與密碼。

  2、如果要設(shè)置,設(shè)置注意以下地方:

  1.   $cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/';  
  2.  
  3.   $cfg['PmaNoRelation_DisableWarning']= FALSE;  
  4.  
  5.   $cfg['blowfish_secret'] = 'husumiao';  
  6.  
  7.   $i = 1;  
  8.  
  9.   $i++;  
  10.  
  11.   $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address  
  12.  
  13.   $cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port  
  14.  
  15.   $cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket  
  16.  
  17.   $cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')  
  18.  
  19.   $cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')  
  20.  
  21.   $cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection  
  22.  
  23.   $cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?  
  24.  
  25.   $cfg['Servers'][$i]['user'] = 'root'; // MySQL user  
  26.  

  錯誤:沒有發(fā)現(xiàn) PHP的擴展設(shè)置mbstring,而當(dāng)前系統(tǒng)好像在使用寬字符集。沒有 mbstring 擴展的 phpMyAdmin不能正確識別字符串,可能產(chǎn)生不可意料的結(jié)果解決方法: yum install php-mbstring安裝。

  php知識:

  ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib --enable-track-vars --with-xml --enable-pdo --with-mysql=/user/mysql --with-pdo-mysql=/usr/bin/mysql --with-mysql-sock=/tmp/mysql.sock這里--enable-pdo是指使用PDO連接MySQL,--with-pdo-mysql=/usr/bin/mysql指定mysql的路徑。

  --with-mysql-sock=/tmp/mysql.sock指定mysql.sock的路徑。

  找不到路徑請用 find / -name xxxx來查找。

  修改httpd.conf:找到 AddType application/x-gzip .gz .tgz 在其下添加如下內(nèi)容:AddType application/x-httpd-php .php、AddType application/x-httpd-php-source .phps,安裝完后需配置的文件內(nèi)容。

  修改httpd.conf:去掉LoadModule xxxxx moudule/xxxxx.so前面的#來開啟所需要的.so文件。

  apache 與 php 整合:/usr/share/apache/modules/ 或 /etc/httpd/conf/modules 目錄下是否存在libphp5.so文件(必須存在),編輯httpd.conf添加:LoadModule php5_module modules/libphp5.so。之后添加:AddType application/x-httpd-php .php .php3、AddType application/x-httpd-php-source .phps。

LAMP、phpMyAdmin的安裝、配置及使用學(xué)會了嗎?

【編輯推薦】

Ubuntu下LAMP的配置

LAMP的優(yōu)化技巧

CentOS下安裝LAMP的方法

責(zé)任編輯:zhaolei 來源: javaeye
相關(guān)推薦

2011-03-11 14:48:03

phpmyadmin配置

2011-03-11 14:02:52

PHPmyadmin安裝

2011-03-22 12:26:58

lampMysqlphpmyadmin

2011-03-09 15:32:57

2011-03-10 15:47:45

2011-03-22 13:42:06

LAMP終端命令

2011-03-11 13:58:54

2011-03-18 09:56:20

lamp

2011-03-08 10:14:45

LAMP介紹

2011-03-14 13:51:14

LAMP配置

2011-03-11 10:39:02

YUM安裝LAMP

2010-01-11 09:12:15

Fedora LAMP

2009-12-03 14:43:46

phpMyAdmin配

2011-03-09 10:55:33

LAMP優(yōu)化技巧

2011-03-10 10:09:33

LAMP優(yōu)化

2011-03-10 11:06:02

Ubuntu搭建LAMP

2011-03-18 10:06:48

LAMP組成

2011-03-22 15:30:51

LAMP

2011-03-10 10:09:13

Ubuntu搭建LAMP

2011-03-23 14:09:38

點贊
收藏

51CTO技術(shù)棧公眾號