換源,安裝ssh,lamp

1.換源
cd /etc/apt/
vim soursec.list

```
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

```

apt-get update && apt-get upgrade

apt-get clear //刪除已經更新過的安裝包

2.安裝ssh
apt-get install ssh

cd /etc/ssh

vim sshd_conf

修改sshd_conf文件使他可以使用root登陸
輸入”sudo gedit /etc/ssh/sshd_config”–>回車–>把配置文件中的”PermitRootLogin without-password”加一個”#”號,把它註釋掉–>再增加一句”PermitRootLogin yes”–>保存,修改成功。

shell root登陸


3.安裝LAMP環境

安裝apache
apt-get install apache2
修改安全配置 cd /etc/apache2  vim apache2.conf
(1)關閉列目錄
<Directory /var/www/>
        Options Indexes FollowSymLinks//Options FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
(2)apache2版本信息隱藏

# 解決問題1 Apache響應消息header中的Server帶有Apache的版本信息
ServerTokens ProductOnly
# 解決問題2:Apache的錯誤返回頁面中,也包含同樣的信息。除了Apache的信息外,還包括ip地址和端口
ServerSignature Off    
安裝 mysql

apt-get install mysql-server


安裝php apt-get install php5

安裝 php常用拓展
apt-get install php5-mysql php5-curl php5-gd php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-idn

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章