# CustomeRepo **Repository Path**: lhearen/CustomeRepo ## Basic Information - **Project Name**: CustomeRepo - **Description**: Configure the local and remote machine to make sure the internal repository is the only available source to the remotes - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-09-10 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ######################################################### #Author: LHearen #E-mail: LHearen@126.com, luosonglei14@otcaix.iscas.ac.cn ######################################################### This specification will explain how to make a custom repository in a server machine(CentOS 7) and how to re-edit a remote machine(CentOS 7) to install packages from the custom server machine ################################################################################### #Section 1 How to create a set up a Apache server and make it serve as a repository ################################################################################### 1) Before we configure the host machine to a server, we have to firstly install httpd, start and enable the service; 2) If we encounter no problem, we now can install another tool - createrepo to build a repository under /var/www/html/repos; 3) Till now, we can access our newly built repository via a browser by localhost/repos/ to test its fitness. ######################################################################################################### #Section 2 How to configure the remote machine to make its repository redirected to our repository server ######################################################################################################### 1) Considering there are many tools we can adopt to control remote machine and automatically execute shells or commands, I personally make some comparison between the most two popular ones: expect based on Tcl and JSch implemented by java; Tool expect implemented in Tcl languange can be easily used for automating interactive applications such as telnet, ftp, passswd, fsck, rlogin, tip, etc. Another alternative can be JSch(Java Secure Channel) which is also a useful tool to connect to an sshd server and use port forwarding, X11 forwarding, file transfer, etc. But compared to JSch which is implemented in java depending on JCE and known for working with J2SE, the coding burden in expect is rather weightlighted. 2) Let's start to prepare the environment for 'expect' first; there are two available ways to configure it while the first and comparablly stable one is to download Tcl and expect source packages from its offical site, compile and install Tcl first and then expect: Tcl: home site: www.tcl.tk tar xfvz tcl*-src.tar.gz cd tcl*/unix ./configure –prefix=/usr/tcl –enable-shared make make install and then install expect: home site: expect.nist.gov/ tar xzvf expect*.tar.gz cd expect* ./configure –prefix=/usr/expect –with-tcl=/usr/tcl/lib –with-tclinclude=../tcl*/generic make make install ln -s /usr/tcl/bin/expect /usr/bin/expect. but if you can easily let the program to configure it, that will be simple enough too; After its installation, you can now use ‘expect’ to do some interactive stuff; 3) First we will use a start up shell script to guide the user to input some basic information and then call the interactive shell to edit the repository source of the remote client. ####################### #Section 3 Installation ####################### There are two main directoris: client_config, host_config Under host_conig, there is a install.sh which is the only shell script the user can directly use, by the way there is a login.sh to assist the user to complete the login process when using ISCAS LAN; Under client_config, install.sh is another only directly usable for the user to configure remote clients; All the rest of the stuff is just to follow the tips the shells prompt. ############### #Section 4 TODO ############### 1) Use mysql to store some basic configuration: which client completed re-configuration, to which repository server etc; 2) Web UI to assist the user to efficiently control the remote clients.