linux (apache/lighttpd) php mysql

来源:互联网 发布:云计算培训都学什么 编辑:程序博客网 时间:2024/04/28 00:59

##安装mysql
 tar xzvf mysql-5.1.52-linux-i686-glibc23.tar.gz
 mv  mysql-5.1.52-linux-i686-glibc23 /usr/local/mysql
 chown -R mysql /usr/local/mysql
 chgrp -R mysql /usr/local/mysql
 cp /usr/local/mysql/support-files/my-medium.cnf  /etc/my.cnf
 chown –R mysql /etc/my.cnf
 chgrp –R mysql /etc/my.cnf
 cd /usr/local/mysql/
 ./mysql_install_db --user=mysql
 /usr/local/mysql/bin/mysqld_safe --user=mysql&
 如果连接mysql报;Can't connect to local MySQL server through socket '/tmp/mysql.sock'
 执行
 ln -s /var/lib/mysql/mysql.sock mysql.sock
##安装apache2
 wget http://labs.renren.com/apache-mirror//httpd/httpd-2.0.64.tar.gz
 tar xzvf httpd-2.0.64.tar.gz
  mv /root/httpd-2.0.64 /usr/local/
  cd /usr/local/httpd-2.0.64
  ./configure --prefix=/usr/local/apache2 -enable-so
  make
  make install


  cd /usr/local/apache2/bin/
  ./apachectl start
 
 ##安装lighttpd
 wget http://www.lighttpd.net/download/lighttpd-1.4.23.tar.gz
 tar xzvf lighttpd-1.4.23.tar.gz
 cd lighttpd-1.4.23
 mkdir /etc/lighttpd
 mkdir /usr/local/lighttpd
 mkdir /usr/local/lighttpd/conf
 mkdir /usr/local/lighttpd/logs
 ./configure --prefix=/usr/local/lighttpd --without-pcre
  make
  make install

  cp doc/lighttpd.conf /usr/local/lighttpd/conf/lighttpd.conf

 vi /usr/local/lighttpd/conf/lighttpd.conf
 修改相应行为
 server.errorlog = "/opt/lighttpd/logs/lighttpd.error.log"
 server.username = "lighttpd"
 server.groupname = "lighttpd"
 #$HTTP["url"] =~ "/.pdf$" {
 # server.range-requests = "disable"
 #}

 

 

 ##安装PHP
 tar xzvf php-5.2.14.tar.gz
 cd php-5.2.14
 mkdir /usr/local/php
 ##lighttpd
 ./configure  --prefix=/usr/local/php    --enable-fastcgi  --enable-force-cgi-redirect  --with-mysql=/usr/local/mysql/
 ##apache2
 ./configure  --prefix=/usr/local/php  --with-mysql=/usr/local/mysql/ --with-apxs2=/usr/local/apache2/bin/apxs
 make
 make test
 make install

原创粉丝点击