“源码安装LAMP”的版本间的差异
来自Ubuntu中文
第1行: | 第1行: | ||
− | 源码编译安装Apache+PHP5+MySQL5 | + | 源码编译安装Apache+PHP5+MySQL5 |
− | + | apache开启rewrite扩展,php开启curl,soap,imagick,mb_string扩展等。 | |
− | follow me! go! | + | follow me! go! |
+ | |||
+ | <br> | ||
+ | |||
+ | 第一步,安装Apache2 | ||
+ | |||
+ | 下载httpd-2.0.59.tar.gz,执行<br> | ||
+ | |||
+ | sudo tar xzfv httpd-2.0.59.tar.gz <br> | ||
+ | |||
+ | cd httpd-2.0.59<br> | ||
+ | |||
+ | ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so<br> | ||
+ | |||
+ | <br> | ||
+ | |||
+ | 提示如下错误: | ||
+ | |||
+ | checking for C compiler default output file name... configure: error: C compiler cannot create executables<br><br>原因是未安装libc6-dev ,执行<br> | ||
+ | |||
+ | sudo apt-get install build-essential<br> | ||
+ | |||
+ | 就ok了。 | ||
+ | |||
+ | 然后执行: | ||
+ | |||
+ | sudo ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so<br> | ||
+ | |||
+ | 未报错,接着执行 | ||
+ | |||
+ | sudo make | ||
+ | |||
+ | sudo make install | ||
+ | |||
+ | sudo groupadd apache<br> | ||
+ | |||
+ | sudo useradd -g apache apache<br> | ||
+ | |||
+ | sudo passwd apache | ||
+ | |||
+ | sudo chown -R apache:apache /usr/local/apache | ||
+ | |||
+ | <br>sudo vi /usr/local/apache2/conf/httpd.conf | ||
+ | |||
+ | 找到 | ||
+ | |||
+ | User nobody | ||
+ | |||
+ | Group #-1<br> | ||
+ | |||
+ | 修改成 | ||
+ | |||
+ | User apache | ||
+ | |||
+ | Group apache<br> | ||
+ | |||
+ | 把 | ||
+ | |||
+ | #ServerName www.example.com:80 | ||
+ | |||
+ | |||
+ | |||
+ | 改为 | ||
+ | |||
+ | ServerName *:80<br> | ||
+ | |||
+ | 保存!<br> | ||
+ | |||
+ | 执行命令sudo /usr/local/apache/bin/apachectl start 启动apache. | ||
+ | |||
+ | 打开浏览器,访问http://localhost | ||
+ | |||
+ | 如果一切顺利,应该可以看到apache的测试页面。恭喜你,apache安装好了!<br> | ||
+ | |||
+ | |||
+ | |||
+ | 待续..... | ||
+ | |||
+ | |||
+ | |||
+ | <br> | ||
+ | |||
+ | <br> |
2009年12月11日 (五) 00:10的版本
源码编译安装Apache+PHP5+MySQL5
apache开启rewrite扩展,php开启curl,soap,imagick,mb_string扩展等。
follow me! go!
第一步,安装Apache2
下载httpd-2.0.59.tar.gz,执行
sudo tar xzfv httpd-2.0.59.tar.gz
cd httpd-2.0.59
./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so
提示如下错误:
checking for C compiler default output file name... configure: error: C compiler cannot create executables
原因是未安装libc6-dev ,执行
sudo apt-get install build-essential
就ok了。
然后执行:
sudo ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so
未报错,接着执行
sudo make
sudo make install
sudo groupadd apache
sudo useradd -g apache apache
sudo passwd apache
sudo chown -R apache:apache /usr/local/apache
sudo vi /usr/local/apache2/conf/httpd.conf
找到
User nobody
Group #-1
修改成
User apache
Group apache
把
- ServerName www.example.com:80
改为
ServerName *:80
保存!
执行命令sudo /usr/local/apache/bin/apachectl start 启动apache.
打开浏览器,访问http://localhost
如果一切顺利,应该可以看到apache的测试页面。恭喜你,apache安装好了!
待续.....