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