建立帳戶
adduser allie
接下來就會有一些資訊,填完之後就會自動建立好home dir
要讓帳戶可以使用sudo
sudo usermod -a -G sudo hduser
收工
adduser allie
sudo usermod -a -G sudo hduser
vagrant@vagrant:/$ sudo vim /etc/hostname
vagrant@vagrant:/$ sudo vim /etc/hosts
vagrant@vagrant:/$ sudo reboot now
sudo apt-get update sudo apt-get install apache2 sudo apt-get install apache2 apache2-doc apache2-utils
ServerName localhost即可解決
sudo apt-get update sudo apt-get install vsftpd libpam-pwdfile
sudo vim /etc/vsftpd.conf
# 預設的情況下,要將使用者限制在自己的家目錄之內 chroot_local_user=YES # 支援檔案上傳 write_enable=YES # 為了讓透過 FTP 上傳的檔案的預設群組權限為「可寫入」 local_umask=002 # 支援local端登入使用 local_enable=YES # 要求vsftpd讓使用者在對自己的家目錄有寫入的權限下仍然允許連線 allow_writeable_chroot=YES
sudo vim /etc/pam.d/vsftpd
#Standard behaviour for ftpd(8). auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed #Note: vsftpd handles anonymous logins on its own. Do not enable pam_ftp.so. #Standard pam includes #@include common-account #註解掉 #@include common-session #註解掉 #@include common-auth #註解掉 #auth required pam_shells.so #註解掉 #下面兩行加上 auth required pam_pwdfile.so pwdfile /etc/vsftpd.passwd account required pam_permit.so
# 創造一個不能登入系統的帳號 sudo useradd -M -s /usr/sbin/nologin htmlAdmin sudo passwd htmlAdmin # 第一次設定密碼需要先create htpasswd檔案 (HTTP基本認證的user帳密) sudo htpasswd -cd /etc/vsftpd.passwd htmlAdmin # -c : Create the passwdfile. # -d : Use crypt() encryption for passwords. # ps. 如果要創第二組帳號的密碼,去掉-c (因為已經create過了) # sudo htpasswd -d /etc/vsftpd.passwd user2
sudo chmod 555 /var/www/ sudo chmod 755 /var/www/html/ sudo chown htmlAdmin:ftp -R /var/www/html/ sudo usermod --home /var/www/html/ htmlAdmin
sudo service vsftpd restart
sudo useradd -M -s /usr/sbin/nologin meteor sudo passwd meteor sudo htpasswd -d /etc/vsftpd.passwd meteor sudo chmod 777 /var/www/html/meteor sudo chown meteor:ftp -R /var/www/html/meteor/ sudo usermod --home /var/www/html/meteor meteor sudo service vsftpd restart
sudo a2enmod ssl接下來要建立金鑰,為了管理方便,
sudo mkdir /etc/apache2/ssl金鑰設定為365天後到期
sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key金鑰產生過程會有一些額外資訊要求你填寫,
sudo vim /etc/apache2/sites-available/000-default.conf設定內容如下:
<VirtualHost *:443> ServerAdmin webmaster@localhost ServerName example.com:443 DocumentRoot /var/www/html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/html/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> # SSL Engine Switch: # Enable/Disable SSL for this virtual host. SSLEngine on # A self-signed (snakeoil) certificate can be created by installing # the ssl-cert package. See # /usr/share/doc/apache2.2-common/README.Debian.gz for more info. # If both key and certificate are stored in the same file, only the # SSLCertificateFile directive is needed. SSLCertificateFile /etc/apache2/ssl/apache.pem SSLCertificateKeyFile /etc/apache2/ssl/apache.key ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
sudo service apache2 restart
iface eth0 inet static
address 192.168.16.99
netmask 255.255.255.0
gateway 192.168.16.1
dns-nameservers 8.8.8.8
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-org
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
sudo service mongod start
sudo service mongod status
mongostat
mongostat --rowcount 5 2
mongo
mongo --port 22222
sudo service mongod stop
sudo service mongod restart
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian
sudo apt-get install nodejs-legacy