XShell tutorial
Xshell login without password
- 使用xshell 输出密钥
ssh-keygen -t rsa -f test -C "test-key"
- 放置密钥
mkdir -p /root/.ssh chmod 700 /root/.ssh cat id_rsa.pub >> authorized_keys chmod 600 authorized_keys
- restart sshd
service ssh restart /etc/ssh/sshd_config PubkeyAuthentication yes PasswordAuthentication no ChallengeResponseAuthentication no
LAMP
- Install Apache
apt-get install apache2
- Install MySQL
apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql mysql_install_db /usr/bin/mysql_secure_installation
- Install PHP
apt-get install php5 libapache2-mod-php5 php5-mcrypt apt-get install phpmyadmin /etc/init.d/apache2 restart
- PHPMyAdmin
/etc/apache2/apache2.conf Include /etc/phpmyadmin/apache.conf service apache2 restart
Apache Virtual Host
- a2ensite
- a2dissite
- a2enmod
- a2dismod
fdisk
fdisk /dev/sdc
mkfs.ext4 /dev/sda5
Apache https
- 确认是否安装ssl模块
是否有mod_ssl.so文件 - 生成证书和密钥
- 配置apache
- 修改httpd-ssl.conf文件
注意在此文件中配置证书和密钥
SSLCertificateFile /apache/conf/server.crt
SSLCertificateKeyFile /apache/conf/server.key - 虚拟机设置NameVirtualHost *:443
l. 修改httpd.conf文件
LoadModule ssl_module /opt/taobao/install/httpd/modules/mod_ssl.so- 引入ssl配置文件
Include “/apache/conf/httpd-ssl.conf” - 如果你配置的虚拟机,注意一下端口的访问接受情况
NameVirtualHost *:80
- 引入ssl配置文件
- 修改httpd-ssl.conf文件
- 重新启动apache
用https方式访问,查看是否生效
QA
- Trouble downloading packages list due to a “Hash sum mismatch” error
sudo rm -rf /var/lib/apt/lists/* sudo apt-get update
- Enable debug apt-get
apt-get update -o Debug::Acquire::http=true
- Enable ssh server
apt-get install openssh-server
- xshell transfer file
sudo apt-get install lrzsz rz sz
- chown
chown user:group file
- Enable root login Ubuntu 12.04
sudo passwd root
- Shutdown command
shutdown -h now