debian install lamp

安装LAMP:

1
apt-get install mysql-server apache2 php5

安装nginx:

1
apt-get install nginx

配置文件位置:

1
2
3
4
5
6
7
- apache2: /etc/apache2

- nginx: /etc/nginx

- mysql: /etc/mysql

- php5: /etc/php5

重启apache2服务:

1
sudo /etc/init.d/apache2 restart

测试php

/var/www/新建一个info.php文件,内容为:

1
2
3
<?php
phpinfo();
?>

使用curl进行测试,需要安装下curl,然后在CLI输入:

1
curl localhost

一切正常的话,会看到N多html代码,如果只看到info.php的源文件内容,则说明需要重启下apache服务器。

tar 打包(带压缩):

1
tar -jcvf /tmp/test.tar.bz2 /home/www

tar 解压:

1
2
tar -jxvf test.tar.bz2 /tmp <= .bz2
tar -zxvf test.tar.gz /tmp <= .gz

查看文件内容

1
tar -ztvf test.tar.gz

ssh

1
2
3
scp FILE user@host:/dir
or
scp user@host:/dir/FILE .

更改用户所属及组

1
2
chown USER FILE
chown :USER FILE

相关资料及工具介绍:

// Related posts