Chinaunix首页 | 论坛 | 博客
  • 博客访问: 327300
  • 博文数量: 53
  • 博客积分: 1037
  • 博客等级: 准尉
  • 技术积分: 1066
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-13 14:09
文章分类

全部博文(53)

文章存档

2016年(1)

2015年(10)

2013年(2)

2012年(40)

分类: LINUX

2012-05-27 17:41:34

安装lamp的详细安装过程见 archlinux 的wiki


  1. sudo pacman -S apache php php-apache mysql
安装结束会有下面的提示:

  1. To start mysqld at boot time you have to copy
  2. support-files/mysql.server to the right place for your system
  3. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
  4. To do so, start the server, then issue the following commands:
  5. /usr/bin/mysqladmin -u root password 'new-password'
  6. /usr/bin/mysqladmin -u root -h arch password 'new-password'
  7. Alternatively you can run:
  8. /usr/bin/mysql_secure_installation
  9. which will also give you the option of removing the test
  10. databases and anonymous user created by default. This is
  11. strongly recommended for production servers.
  12. See the manual for more instructions.
  13. You can start the MySQL daemon with:
  14. cd /usr ; /usr/bin/mysqld_safe &
  15. You can test the MySQL daemon with mysql-test-run.pl
  16. cd /usr/mysql-test ; perl mysql-test-run.pl
  17. Please report any problems with the /usr/scripts/mysqlbug script!

添加新用户http

  1. [haifeng@arch ~]$ sudo useradd -d /srv/http -r -s /bin/false -U http
  2. [sudo] password for haifeng:
  3. useradd: user 'http' already exists
这里 -d /srv/http 是指定用户 http 的用户目录是 /srv/http
-r 指创建一个系统账号
-s /bin/false 指定 shell

通过查看 /etc/passwd, 确实已经存在 http 用户

  1. http:x:33:33:http:/srv/http:/bin/false



但是如果要访问 ~user/ 别忘了更改用户user的属性
chmod 711 /home/user/

默认是700

之后建议再安装 phpmyadmin

  1. sudo pacman -S phpmyadmin
  2. sudo pacman -S php-mcrypt
但此时安装的 phpmyadmin 位于 /usr/share/webapps/
因此必须拷贝到相应的目录, 如

sudo cp -r /usr/share/webapps/phpMyAdmin/ /srv/http/

最后测试一下, 访问 
如果显示缺少 mysqli 扩展, 则编辑 /etc/php/php.ini, 将 extension=mysqli.so 前面的分号去掉.
然后重启 apache


  1. sudo /etc/rc.d/httpd restart

阅读(1887) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~