Ubuntu12.04 install and deploy the nginx, tomcat, mysql, and startup memo

Source: Internet
Author: User
Ubuntu12.04 install and deploy the nginx, tomcat, mysql, and startup notes: jdk, tomcat, and mysql should not be installed in your home directory, so that the startup will fail, the system will prompt that the corresponding files are not found much. It may be because www.2cto is not mounted to the home directory at that time ....
Ubuntu 12.04 installation and deployment environment nginx, tomcat, mysql, and boot notes: jdk, tomcat, and mysql should not be installed in your home directory, so that the boot will fail, the system will prompt that the corresponding files are not found much. It may be because www.2cto.com 1 is not mounted to the home directory at that time: install nginx to download nginx http://nginx.org/download/nginx-1.2.2.tar.gz Decompress the Java code tar-zxf nginx-1.2.2.tar.gz compilation, Java code. /configure -- prefix =/usr/local/nginx Java code make & sudo make install configure may prompt errors: install two dependencies on the Java code www.2cto.com sudo apt-get install libpcre3-dev sudo apt-get install libssl-dev default generated nginx with debugging information, if you want to remove debugging information, modify the auto/cc/gcc file in the nginx directory and find the Java code # debug CFLAGS = "$ CFLAGS-g, then you can re-compile and set the boot start: in/etc/init. d/. create a new file called nginx. the content is: Java code #! /Bin/bash # nginx Startup script for the Nginx HTTP Server # it is v.0.0.2 version. # chkconfig:-85 15 # description: Nginx is a high-performance web and proxy server. # It has a lot of features, but it's not for everyone. # processname: nginx # pidfile:/var/run/nginx. pid # config:/usr/local/nginx/conf/nginx. conf nginxd =/usr/local/nginx/sbin/nginx nginx_config =/usr/local/nginx/conf/nginx. conf n Ginx_pid =/var/run/nginx. pid RETVAL = 0 www.2cto.com prog = "nginx" # Check that networking is up. [$ {NETWORKING} = "no"] & exit 0 [-x $ nginxd] | exit 0 # Start nginx daemons functions. start () {if [-e $ nginx_pid]; then echo "nginx already running .... "exit 1 fi echo-n $" Starting $ prog: "$ nginxd-c $ {nginx_config} RETVAL =$? Echo [$ RETVAL = 0] return $ RETVAL} # Stop nginx daemons functions. stop () {echo-n $ "Stopping $ prog:" $ nginxd-s stop RETVAL = $? Echo [$ RETVAL = 0]} # reload nginx service functions. reload () {echo-n $ "Reloading $ prog:" # kill-HUP 'cat $ {nginx_pid} 'killproc $ nginxd-hup retval =$? Echo} www.2cto.com # See how we were called. case "$1" in start) start; stop) stop; reload) reload; restart) stop start; status) status $ prog RETVAL = $?; *) Echo $ "Usage: $ prog {start | stop}" exit 1 esac exit $ RETVAL: add the execution permission to the Java code sudo chmod + x nginx: java code sudo update-rc.d-f nginx defaults www.2cto.com 2: install jdk go to the official website to download jdk, suffix for .tar.gz, antidote to/usr/local/java set environment variables below: vi/etc // environment change the file to the following format: Java code PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin: /usr/bin:/sbin:/bin:/usr/games:/usr/local/java/bin "export JAVA_HOME =/usr/local/java: run the following Java code: sudo source/etc/environment 3: install tomcat and download tomcat directly. go to the/usr/local/tomcat directory to set tomcat as a system service: copy a copy of tomcat, catalina. sh file to/etc/init. d, and renamed tomcat. add the following lines to the front of the file: modify catalina using Java code. sh: add JAVA_HOME =/usr/local/java CATALINA_HOME +/usr/local/tomcat CLASSPATH = $ JAVA_HOME/lib: $ CATALINA_HOME/lib www.2cto.com to execute: java code update-rc.d-f tomcat defaults so OK 4. install mysql to download the green version of mysql. install the dependency Library: Java code sudo apt-get install libaio1 www.2cto.com in/usr/local/mysql: java code sudo groupadd mysql sudo useradd-r-g mysql sudo chown-R mysql: mysql/usr/local/mysql sudo scripts/mysql_install_db -- user = mysql set boot start: java code cd/etc/init. d sudo ln-s/usr/local/mysql/support-files/mysql. server sudo update-rc.d mysql. server ULTS: create user 'AAA' @ '%' identified by 'AAA'; grant all on *. * TO 'AAA' @ '%'; author: cmzx3444
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.