标签:
以下内容*参考自OSC的这篇文章*
在慕课网上有一个LAMP配置的课程讲的也很好,还讲了一些Ubuntu和Linux的拓展知识
安装
sudo apt-get install apache2(在安装之后会新建一个目录/var/www)sudo apt-get install mysql-server mysql-clientsudo apt-get install php5 libapache2-mod-php5 sudo /etc/init.d/apache2 restart重启apache使其加载php模块 配置
sudo vim /etc/apache2/apache2.conf AddType application/x-httpd-php .php .html .htm AddDefaultCharset UTF-8 <IfModule dir_module> DirectoryIndex index.htm index.html index.php </IfModule> sudo vim /etc/apache2/sites-enabled/000-default.conf DocumentRoot /var/www/html改成/var/www service apache2 restartsudo vim /etc/php5/apache2/php.ini ;date.timezone=改为date.timezone=PRCsudo vim /etc/mysql/my.cnf bind-address 127.0.0.1 测试
sudo netstat -tap | grep mysql tcp 0 0 localhost:mysql *.* LISTEN 1060/mysqld等类似的样子就说明能够正常运行,如果不能正常运行的话 mysql:sudo /etc/init.d/mysql restartsudo chmod -R 777 /var/www <?php phpinfo(); ?> 标签:
原文地址:http://blog.csdn.net/flyingstudio_cumt/article/details/44838191