LAMP部署:
gcc*
lib*
ncurses
1.安装apache
tar -zxf httpd-2.0.64.tar.gz
./configure --prefix=/usr/local/apache2
make && make install
出现
httpd: Could not reliably determine the server's fully qualified domain name
usr/local/apache/conf
vim httpd.conf
将里面的#ServerName localhost:80注释去掉就可以正常启动
2.安装mysql
groupadd mysq
useradd -g mysql mysql
tar -zxf mysql-5.0.18.tar.gz
cd /usr/local/mysql.***
./configure --prefix=/usr/local/mysql
make && make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
bin/mysqld_safe --user=root &
(mysqld_safe来启动mysqld服务器)
/usr/local/mysql/bin/mysqladmin -u root password '123456'
出现
Installing MySQL system tables...
[ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'
[ERROR] Aborting
[Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
将/etc/my.cnf文件中的skip-federated注释掉即可
3.安装php
tar -zxf php-5.2.8.tar.bz2
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql
make && make install
cp php.ini-dist /usr/local/lib/php.ini
4.在apache中增加php扩展(增加类型)
vi /usr/local/apache2/conf/httpd.conf
AddType application/x-httpd-php .php
vi /usr/local/apache2/htdocs/test.php
<?php
phpinfo()
?>
bin/apachectl restart
-----------------虚拟主机 域名方式-------------
NameVirtualHost 192.168.8.222:80 (去#,ip)
<VirtualHost 192.168.8.222:80>
DocumentRoot /var/www/a
ServerName a.xxx.com
</VirtualHost>
<VirtualHost 192.168.8.222:80>
DocumentRoot /var/www/b
ServerName b.xxx.com
</VirtualHost>
转载于:https://blog.51cto.com/fanhb517/763317