New project development and running environment configuration-nodejs frontend + java background + postgresql database + nginx + tomcat,-nodejsng.pdf
Preface
To open a new project a few days ago, you need to create a new svn and website runtime environment. So Lee wrote this article.
Now, you can read this article first:
Stage-centos + php-fpm + mariaDB + svn + nodejs, configure the linux php and nodejs website runtime environments.
Configure ocaml and unison for two-way file synchronization in centos
[Centos] configure the postgresql database.
[Java development and deployment] uses svn, ocaml, and unison to deploy java Web websites.
Unison Configuration
Rsync file sync
Tomcat configuration points. Installation instructions installation environment: CentOS-7.0.1406 Installation Method: source code Installation Software: apache-tomcat-7.0.29.tar.gz: http://tomcat.apache.org/download-70.cgi Installation prerequisites the system must have JDK6 + installed, see install and configure the CentOS-6.3 in the JDK-7. Install tomcat to upload the apache-tomcat-7.0.29.tar.gz file to/usr/local and perform the following operations: [plain] view plaincopyprint? View the CODE piece on the CODE and derive it to my CODE piece [root @ admin local] # cd/usr/local [root @ admin local] # wget http://apache.fayea.com/apache-mirror/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz [Root @ admin local] # tar-zxv-f apache-tomcat-7.0.29.tar.gz // extract the compressed package [root @ admin local] # rm-rf apache-tomcat-7.0.29.tar.gz // Delete the compressed package [root @ admin local] # mv start apache-tomcat-7.0.29 tomcat and perform the following operations: the Code is as follows: [plain] view plaincopyprint? View the CODE piece on the CODE and derive it to my CODE piece [root @ admin ~] #/Usr/local/tomcat/bin/startup. sh // start tomcat Using CATALINA_BASE:/usr/local/tomcat Using CATALINA_HOME:/usr/local/tomcat Using CATALINA_TMPDIR:/usr/local/tomcat/temp Using JRE_HOME: /usr/java/jdk1.7.0/jre Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/tomcat-juli.jar the above information indicates that the startup was successful. Open port 8080 in the firewall and add port 8080 to the firewall configuration. perform the following operations: [plain] view plaincopyprint? View the CODE piece on the CODE and derive it to my CODE piece [root @ admin ~] # Vi +/etc/sysconfig/iptables # Add the following code [plain] view plaincopyprint? View the CODE piece on CODE derived from my CODE piece-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT restart firewall [plain] view plaincopyprint? On the CODE page, view the CODE piece derived from my CODE piece [root @ admin java] # service iptables restart to check whether Tomcat is running properly through the following address: http://192.168.15.231:8080/ The tomcat System Interface is displayed, indicating that the installation is successful! Stop Tomcat [plain] view plaincopyprint? View the CODE piece on the CODE and derive it to my CODE piece [root @ admin ~] #/Usr/local/tomcat/bin/shutdown. sh // stop tomcat
Step 1: configure the nodejs project skeleton in svn
To create a nodejs project, follow these steps:
1. Create a code repository
2. Set hook-post-commit to automatically synchronize to the website directory.
3. Set the nginx sub-website configuration file and open relevant ports.
4. Check whether the test is successful.
Note that the express framework of nodejs is used and the port used must be set in app. js. The pre-adopted port 3007 is used here.
Here are the relevant settings:
Write link content here
Related commands
The project name is tentatively set to blue-hatsudo mkdir-p/var/svn/blue-hatsudo svnadmin create/var/svn/blue-hatsudo vim/var/svn/blue-hat/ conf/svnserve. confsudo vim/var/svn/blue-hat/conf/passwdsudo vim/var/svn/blue-hat/conf/authzsudo systemctl restart svnserve
Note: Please complete the configuration step by step based on the references. Next, add a corresponding web running directory to the project. The directory path is initially set to/usr/local/webroot/blue-hat.
/usr/local/webroot/blue-hatmkdir -p /usr/local/webroot/blue-hatsvn checkout svn://localhost/blue-hat /usr/local/webroot/blue-hat --username testuser --password abc --non-interactive
Add post commit
cd /var/svn/blue-hat/hookscp post-commit.tmpl post-commitchmod +x post-commitvi post-commit
Modify
#! /Bin/sh # library path repos = "$1" # New Version Number REV = "$2" WEB =/usr/local/webroot/blue-hatSVN =/usr /bin/svnLOG =/usr/local/webroot/auto_svn.logexport LC_ALL = zh_CN.UTF-8changed =$ (svnlook changed-r $ REV $ REPOS) log = $ (svnlook log-r $ REV $ REPOS) echo "now the changed is: $ changed "> $ LOGn = $ '\ n' $ SVN update $ WEB -- username testuser -- password abc -- non-interactive # update to our target website directory.
Restart svn
The next step is to upload and download svn.
Note: you do not need to configure nginx + express in the development environment.
Configure the ipvs Database
Omitted. Please use the script for configuration.
Note: database backup, recovery, and migration are all required.
Configure svn for the java Project
The project name is tentatively set to blue-hat-serversudo mkdir-p/var/svn/blue-hat-serversudo svnadmin create/var/svn/blue-hat-serversudo vim/var/ svn/blue-hat-server/conf/svnserve. confsudo vim/var/svn/blue-hat-server/conf/passwdsudo vim/var/svn/blue-hat-server/conf/authzsudo systemctl restart svnserve
Note: you do not need to configure the post hook here.Because the source code cannot be directly executed.
Configure the directory for storing compilation files of java Projects
Note that after java is compiled, put it into an output directory, output the svn directory, update the compiled file to the production environment, and restart the tomcat server.
The project name is tentatively set to blue-hat-buildsudo mkdir-p/var/svn/blue-hat-buildsudo svnadmin create/var/svn/blue-hat-buildsudo vim/var/ svn/blue-hat-build/conf/svnserve. confsudo vim/var/svn/blue-hat-build/conf/passwdsudo vim/var/svn/blue-hat-build/conf/authzsudo systemctl restart svnserve
Configure the relevant web directory.
mkdir -p /usr/local/webroot/blue-hat-buildsvn checkout svn://localhost/blue-hat-build /usr/local/webroot/blue-hat-build --username testuser --password abc --non-interactive
Next we want to modify the hook script post commit, first copy the post-coomit.tmpl to become a post-commit, svn will execute the post-commit script after each update and then give the script execution permissions, next, add the script content-the following script example. Save the configuration, restart the svn service, and test whether the configuration is successful. Cd/var/svn/blue-hat-build/hookscp post-commit.tmpl post-commitchmod + x post-commitvi post-commit
#! /Bin/sh # library path repos = "$1" # New Version Number REV = "$2" WEB =/usr/local/webroot/blue-hat-buildSVN = /usr/bin/svnLOG =/usr/local/webroot/auto_svn.logexport LC_ALL = zh_CN.UTF-8changed =$ (svnlook changed-r $ REV $ REPOS) log = $ (svnlook log-r $ REV $ REPOS) echo "now the changed is: $ changed "> $ LOGn = $ '\ n' $ SVN update $ WEB -- username testuser -- password abc -- non-interactive # update to our target website directory.
-
Top
-
0
-
Step on
-
0
View comments