LAMP小记

LAMP:
    Linux+Apache+PHP+MySQL

httpd+php

  php做成apache的模块
  php做成一个单独的应用程序服务器

  <?php
     phpinfo();
  ?>

MySQL
PostgreSQL, EnterpriseDB

chkconfig mysqld on 开机自动启用

  <?php
  $link=mysql_connect('127.0.0.1','root','');
  if ($link)
   echo "Success...";
  else
   echo "Failure...";
  ?>

phpmyadmin
pma.a.com,虚拟主机,phpmyadmin,/www/phpmyadmin

本地安装:
  yum --nogpgcheck localinstall pack_name -y

论坛:
  phpwind
  discuz

编译环境:
  yum grouplist
  yum groupinstall

make menuconfig
make gconfig
make xconfig

killall -9 mysqld

安装MySQL
  mysql-
  tar /usr/local/mysql
  ln -sv
  cd mysql
  userdel -r mysql
  groupadd -g 306 -r mysql
  useradd -g mysql -u 306 -r -s /sbin/nologin -M mysql
  chown -R mysql:mysql .
  以Mydql的身份做初始化
    scripts/mysql_install_db --user=mysql
  chown -R root .
  chown -R mysql /data
  bin/mysqld_safe --user=mysql &
  netstat -tnl | grep 3306
 
  使客户端命令可用:
  vim /etc/profile
    PATH=$PATH:/usr/local/mysql/bin
  . /etc/profile

APACHE、PHP:
库文件:
  vim /etc/ld.so.conf.d/mysql.conf
    /usr/local/mysql/lib
  ldconfig -v | grep mysql
头文件:
  ln -sv /usr/local/mysql/include /usr/include/mysql

CGI脚本以运行apache的用户和组运行

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=mysqlnd ---enable-mbstring=all


PHP:
  cd /usr/local/apache/htdocs
  mv index.html index.php
  vim /etc/httpd/conf/httpd.conf
    DirectoryIndex index.php
    AddType application/x-httpd-php .php

你可能感兴趣的:(apache,PHP,linux,lamp,mqsql)