安装lamp的详细安装过程见 archlinux 的wiki
- sudo pacman -S apache php php-apache mysql
安装结束会有下面的提示:
- To start mysqld at boot time you have to copy
- support-files/mysql.server to the right place for your system
- PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
- To do so, start the server, then issue the following commands:
- /usr/bin/mysqladmin -u root password 'new-password'
- /usr/bin/mysqladmin -u root -h arch password 'new-password'
- Alternatively you can run:
- /usr/bin/mysql_secure_installation
- which will also give you the option of removing the test
- databases and anonymous user created by default. This is
- strongly recommended for production servers.
- See the manual for more instructions.
- You can start the MySQL daemon with:
- cd /usr ; /usr/bin/mysqld_safe &
- You can test the MySQL daemon with mysql-test-run.pl
- cd /usr/mysql-test ; perl mysql-test-run.pl
- Please report any problems with the /usr/scripts/mysqlbug script!
添加新用户http
- [haifeng@arch ~]$ sudo useradd -d /srv/http -r -s /bin/false -U http
- [sudo] password for haifeng:
- useradd: user 'http' already exists
这里 -d /srv/http 是指定用户 http 的用户目录是 /srv/http
-r 指创建一个系统账号
-s /bin/false 指定 shell
通过查看 /etc/passwd, 确实已经存在 http 用户
- http:x:33:33:http:/srv/http:/bin/false
但是如果要访问 ~user/ 别忘了更改用户user的属性
chmod 711 /home/user/
默认是700
之后建议再安装 phpmyadmin
- sudo pacman -S phpmyadmin
- 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
- sudo /etc/rc.d/httpd restart
阅读(1923) | 评论(0) | 转发(0) |