2017年2月6日 星期一

Ubuntu 16.04 vsftp 設定

安裝:
sudo apt update
sudo apt-get install vsftpd

設定檔/etc/vsftpd.conf修改:
listen=YES
#listen_ipv6=YES #listen和listen_ipv6只能啟動一個,listen_ipv6支援ipv6與v4

# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=002

# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# If enabled, vsftpd will display directory listings with the time
# in  your  local  time  zone.  The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES

#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
# Activate logging of uploads/downloads.
xferlog_enable=YES
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log

# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
chroot_local_user=YES
allow_writeable_chroot=YES
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
#chroot_local_user=YES
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list

# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

# Uncomment this to indicate that vsftpd use a utf8 filesystem.
utf8_filesystem=YES

Ubuntu 16.04 Mysql 5.7 max connections設定值大於214

修改/etc/mysql/mysql.conf.d/mysqld.cnf,設定需要的連線數:
max_connections=1000


再修改/lib/systemd/system/mysql.service,增加以下設定值:
LimitNOFILE=8192


接著執行以下指令:
systemctl daemon-reload
systemctl restart mysql.service


驗證:
進mysql後執行
show variables like "max_connections";
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 1000  |
+-----------------+-------+
1 row in set (0.01 sec)

2017年2月3日 星期五

Ubuntu 16.04 Mariadb phpmyadmin 登入

在Ubuntu 16.04安裝Mariadb 10,預設值卻不能登入phpmyadmin(mariadb預設空白密碼與預設禁止root登入phpmyadmin),在安裝完Mariadb與phpmyadmin後可進行以下修改:

安裝Mariadb,Apache,php7.0,phpmyadmin
sudo apt update
sudo apt upgrade
sudo apt install mariadb-server mariadb-client apache2 php7.0 libapache2-mod-php7.0 phpmyadmin

變更Mariadb root密碼:
$ sudo mysqladmin -u root password

變更允許Mariadb root登入phpmyadmin
$ sudo mysql -u root -p mysql
update user set plugin='' where user='root';
flush privileges;
exit;


2016年10月8日 星期六

2016年10月6日 星期四

Ubuntu 16.04 apache2+php

sudo apt update
sudo apt install apache2 php libapache2-mod-php

一般來說安裝應該只需要下apache2與php,但這個版本不知是啥問題,libapache2-mod-php
這個套件若沒指定安裝,php會無法執行.......

2016年9月23日 星期五

Windows 10 遠端桌面多人連線 (20160923)

參考文章:http://www.nextofwindows.com/how-to-allow-multiple-concurrent-remote-desktop-sessions-in-windows-10

最近發現之前設定的windows 10遠端桌面連線沒辦法多人同時連入使用,大概是又有了相關服務的更新,導致之前的修改失效了!爬了一下文找到了新的處理方式!

1.先下載termsrv.dll 檔案
https://drive.google.com/open?id=0B5wYiB4M70SVNjFnXzhfME1CdTQ


2.用管理員權限開啟”命令提示字元“,停止RDP服務
net stop termservice
3.修改c:\windows\system32 下的termsrv.dll 檔案權限讓自己擁有完整的權限
4.將termsrv.dll 另存一份到其他資料夾,避免問題時可以還原檔案
5.將下載的termsrv.dll 複製到c:\windows\system32下取代原來的檔案
6.啟動RDP服務
net start termservice
7.收工!