个人工具

“源码安装LAMP”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
源码编译安装Apache+PHP5+MySQL5
 
(未显示7个用户的13个中间版本)
第1行: 第1行:
源码编译安装Apache+PHP5+MySQL5
+
===== '''第一步,安装Apache2'''  =====
  
apache开启rewrite扩展,php开启curl,soap,imagick,mb_string扩展等。
+
下载httpd-2.0.59.tar.gz,执行<br>
 +
<source lang="bash">(下面的 xzfv 应该是  zxvf  吧 By Missll)</source>
 +
<source lang="bash">(一样的 By a new hand)</source>
 +
<source lang="bash">sudo tar xzfv httpd-2.0.59.tar.gz
  
follow me! go!
+
sudo cd  httpd-2.0.59
  
<br>
+
sudo ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so</source> <br> <br>  
  
第一步,安装Apache2
+
如果提示如下错误:
  
下载httpd-2.0.59.tar.gz,执行<br>
+
checking for C compiler default output file name... configure: error: C compiler cannot create executables<br><br>原因是未安装libc6-dev ,执行<br>  
  
sudo tar xzfv httpd-2.0.59.tar.gz <br>
+
<source lang="bash">sudo apt-get install build-essential</source><br>  
  
cd&nbsp; httpd-2.0.59<br>
+
就ok了。
  
./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so<br>
+
然后从新执行:
  
<br>
+
<source lang="bash">sudo ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so</source><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&nbsp; ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so<br>
+
 
+
未报错,接着执行
+
  
sudo make
+
未报错,接着执行
 +
<source lang="bash">sudo make
  
 
sudo make install
 
sudo make install
  
sudo groupadd apache<br>
+
sudo groupadd apache
  
sudo useradd -g apache apache<br>
+
sudo useradd -g apache apache
  
 
sudo passwd apache
 
sudo passwd apache
  
sudo chown -R apache:apache /usr/local/apache
+
sudo chown -R apache:apache /usr/local/apache2</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>
  
User nobody
+
找到
 +
<source lang="bash">User nobody
  
Group #-1<br>
+
Group #-1</source><br>
 +
修改成
 +
<source lang="bash">User apache
  
修改成
+
Group apache</source><br>
 +
<br>
  
User apache
+
找到
  
Group apache<br>
+
<source lang="bash">#ServerName www.example.com:80</source><br>  
  
+
改为
  
#ServerName www.example.com:80
+
<source lang="bash">ServerName *:80</source><br>
  
 +
保存!<br>
  
 +
执行命令<source lang="bash">sudo /usr/local/apache2/bin/apachectl start</source> 启动apache.
  
改为
 
  
ServerName *:80<br>
 
  
保存!<br>
+
打开浏览器,访问[http://localhost http://localhost]
 
+
执行命令sudo /usr/local/apache/bin/apachectl start 启动apache.
+
 
+
打开浏览器,访问http://localhost
+
  
 
如果一切顺利,应该可以看到apache的测试页面。恭喜你,apache安装好了!<br>
 
如果一切顺利,应该可以看到apache的测试页面。恭喜你,apache安装好了!<br>
  
 +
==MySQL==
 +
[[MYSQL5FromSource]]
  
 +
待续.....
  
待续.....
+
<br>
  
 
+
<br>  
 
+
<br>
+
  
 
<br>
 
<br>
 +
[[Category:服务器]]
 +
[[Category:程序开发]]

2014年1月20日 (一) 21:16的最新版本

第一步,安装Apache2

下载httpd-2.0.59.tar.gz,执行

(下面的 xzfv 应该是  zxvf  吧 By Missll)
(一样的 By a new hand)
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


如果提示如下错误:

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/apache2


修改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/apache2/bin/apachectl start
启动apache.


打开浏览器,访问http://localhost

如果一切顺利,应该可以看到apache的测试页面。恭喜你,apache安装好了!

MySQL

MYSQL5FromSource

待续.....