技术开发 频道

Gentoo/Sabayon下LAMP架构搭建实例

    【IT168 技术】本文主要给大家介绍如何在Gentoo/Sabayon 安装LAMP组合。

  LAMP:Linux+Apache,+MySQL+PHP

  #1,升级系统

#emerge --sync

  #2,安装Apache 网络服务器

  安装过程:

  sabayon6 ~ # emerge apache

  ^
[OH

  * IMPORTANT:
3 news items need reading for repository 'gentoo'.

  * Use eselect news to read news items.

  Calculating dependencies... done!

  >>> Verifying ebuild manifests

  >>> Starting parallel fetch

  >>> Emerging (
1 of 2) app-admin/apache-tools-2.2.17

  * waiting for lock on /usr/portage/distfiles/.httpd-
2.2.17.tar.bz2.portage_lockfile

  ...
[ ok ]

  root目录在/var/www/localhost/htdocs/

  如果允许用户拥有自己的网页(public_html),执行命令:

echo "www-servers/apache userdir" >> /etc/portage/package.use emerge apache

  After that you also need to edit the file /etc/conf.d/apache2 and add “-D USERDIR” to APACHE2_OPTS as shown:

  APACHE2_OPTS=”-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D USERDIR”

  Then every user have to make a public_html directory in order to put his/her index.html and any other files in there.

  [edit] 00_mod_userdir.conf

  If you want to allow just some users to have their own web pages, then you have to edit the userdir module in:

  /etc/apache2/modules.d/00_mod_userdir.conf

  and add to it the following lines:

  Code: add to 00_mod_userdir.conf

  UserDir public_html

  UserDir disabled

  UserDir enabled user1 user2 root

  接下来,可以启动apache:

sabayon6 ~ # /etc/init.d/apache2 start

  * Caching service dependencies ...
[ ok ]

  * Starting apache2 ...

  apache2:

  Could not reliably determine the server's fully qualified domain name
,

  using
10.0.2.15 for

  ServerName
[ ok]

  设置apache2 为开机启动:

  # rc-update -v add apache2 default

  输出结果为:

  * apache2 added to runlevel default

  * Caching service dependencies...
[ ok ]

  * rc-update complete.

0
相关文章