Basic Service Settings xclin Computer Center CS NCTU
Basic Service & Settings xclin
Computer Center, CS, NCTU 2 If you want to transfer a file…
Computer Center, CS, NCTU 3 By MSN ?
Computer Center, CS, NCTU 4 By CS or NCTU’s Web ? q. Upload to bsd. X and download from www. cs q. Quota is full!
Computer Center, CS, NCTU By FTP Server Inside Your Windows ? ÞLAG ÞDie! ÞGG 5
Computer Center, CS, NCTU 6 With your own BSD
Configuration Files
Computer Center, CS, NCTU 8 Most Common Flow 1. Install q Package, ports and tar-ball 2. Configuration q Program specified config file q rc. conf 3. Startup 4. Maintenance
Computer Center, CS, NCTU Configuration Files (1/3) q Local-installed programs’ configuration files can be found in /usr/local/etc • Daemon → program-name. conf Ø dhcpd. conf • user-program → program-namerc Ø wgetrc Ø tinrc q Default config file usually installed with. sample or. default suffix • dhcpd. conf. sample or different suffix for different purpose • php. ini-dist • php. ini-recommended copy before use it 9
Computer Center, CS, NCTU Configuration Files (2/3) q A program with many config files are usually located in /usr/local/etc/program-name/ • apach 22 • postfix q Most config files have clear comment at the beginning or Example: proftpd. conf before each description # Port 21 is the standard FTP port. q Most popular styles Port 21 # To prevent Do. S attacks, set the maximum • name <space>value # number of child processes to 30. …. . Max. Instances 30 • name = value Read documents to know each option’s meaning 10
Computer Center, CS, NCTU 11 Configuration Files (3/3) q Some with local effectiveness • Markup language-like <directory /path> setting-for-this-path… </direction> • Samba、rsync [xxxx] settings… [yyyy] settings….
RC Script
Computer Center, CS, NCTU RC Script q. Dependency between each service is described in header of the script q. Rcorder is used to find out dependency ordering of each script q. Each rc script define what to do when start/stop … q/etc/rc. subr defines what to do & check before/after start stop …. 13
Computer Center, CS, NCTU How to use rc script(1/2) q Example ntpd >/etc/rc. d/ntpd Usage: /etc/rc. d/ntpd [fast|force|one](start|stop|restart|rcvar|status|poll) q Rcvar • Display which rc. conf variable are used to control the startup of service • Ex: ntpd_enable=“YES” q pidfile • Record (master) process id of the service q Start q Stop q Restart • Start + stop 14
Computer Center, CS, NCTU How to use rc script(2/2) q Status • Check the service is running or not q Relaod • Reload configuration file if the service support q One fast force • One Ø set rcvar = yes Ø Start the service even if XXXX_enable=NO • Force Ø Set rcvar = yes and • Fast Ø Skip pid check 15
Computer Center, CS, NCTU Local installed service q After install a service by ports, ports will display • This port has installed the following startup scripts which may cause • these network services to be started at boot time. • /usr/local/etc/rc. d/pure-ftpd q Use path-to-rcscript rcvar command to know which variable should set to “YES” to enable this service q For further information, read comments from that script • • 16 # Add the following lines to /etc/rc. conf to enable pure-ftpd: # # pureftpd_enable="YES" # # For launch uploadscript daemon define # pureftpd_upload_enable="YES" # pureftpd_uploadscript="/full/path/to/launch_script"
HTTP & FTP (bonus homework) Due 2009/12/4
Computer Center, CS, NCTU FTP q Install proftpd or pure-ftpd 1. Anonymous Login q Chrooted (/home/ftp is your root) q Can download from /home/ftp/public q Can upload & mkdir but no download or delete from /home/ftp/upload q Hidden directry /home/ftp/hidden q There is a directory called “target” inside q Client can’t list in /home/ftp/hidden/ but can in hidden/target 18
Computer Center, CS, NCTU 19 FTP 2 Create a system user “sysadm” q Could login by ssh q Password is your student id 3. Create a virtual user “ftp-vip” q q q Chrooted Password is your student-id Can login from 140. 113. 17. 225 & your ip only Full access to /home/ftp Hidden directory is visible to vip
Computer Center, CS, NCTU 20 HTTP q Install Apache 22 or Lighttpd q Support userdir • http: //your-ip/~username = /home/username/public_html q Files uploaded by FTP-2 can download through HTTP
Computer Center, CS, NCTU 21 Demo q Demo with X-window
- Slides: 21