Do Not Think!!!

Posted
Filed under 01010101

install nginx

$ sudo apt-get install nginx

install mariadb

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
$ sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu trusty main'

$ sudo apt-get update
$ sudo apt-get install mariadb-server

install tomcat

$ sudo apt-get install tomcat7
download tomcat8
https://tomcat.apache.org/download-80.cgi

install java

$ sudo add-apt-repository ppa:openjdk-r/ppa
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk

configure nginx

$ sudo vi /etc/nginx/sites-enable/example.com
server {
    server_name example.com;
    rewrite ^ http://www.example.com$request_uri? permanent;
}

server {
    server_name *.example.com;

    root /var/lib/tomcat-8/webapps/ROOT/;
    index index.html;

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8080/;
    }
}

configure tomcat

...